How do I type diminished character? "𝇈"

I'm able to print a musical dimnished symbol with the following line of code:


print("\u{1D1C8}") // output:  


However, when I assign that literal to a text field's text property, it doesn't show the diminished character in the text field.


        textField.text = "\u{1D1C8}"


I checked in Xcode->Preferences->Fonts & Colors. There isn't a setting for the font for the debug window, although there are font settings for the editor window.


How do I find a font that would print the diminished character? I have done a search on the internet, and I have tried a few fonts randomly.


I found some fonts that have the diminished symbol in it, but the code to initialize the UIFont object with that font returns a nil. The extension of the font file is ttf, like other font files that I've gotten to work.


        let font2 = UIFont(name: "Maestro Wide Regular", size: 12) // = nil


Anyone have any experience with this?

Accepted Reply

As far as I checked, there are no fonts which can display "\u{1D1C8}" in iOS 12.2 simulator. The AppleSymbols font in macOS Mojave can show the character but it is not included in iOS, neither the font "Maestro Wide Regular".


You may need to embed the font into your app (of course, you need to confirm that the license of the font permits it).

Replies

As far as I checked, there are no fonts which can display "\u{1D1C8}" in iOS 12.2 simulator. The AppleSymbols font in macOS Mojave can show the character but it is not included in iOS, neither the font "Maestro Wide Regular".


You may need to embed the font into your app (of course, you need to confirm that the license of the font permits it).

Mestro Wide Regular shows the "L" character as the diminshed symbol, according to the documentation, but I can't even get that font to load.


How do I get started with embedding a font in an app?

You can find many articles searchng with "embed font ios".


For example:

Adding a Custom Font to Your App