I've been trying to get glyphs from a certain font in the shortcuts menu by editing shortcuts.json but I can't seem to get it done. This is what I've done so far:
- Loaded an OTF font via the main config file (it loads correctly).
- Tried get a certain glyph by using an icon name but the font doesn't seem to support it (apparently because it doesn't support ligatures)
- Tried to use a Unicode locator but normal 4-digit unicode (e.g. \u03B1) doesn't work, my glyph isn't defined as it's one of very many in the font.
- Tried to use an HTML numeric character reference (􀊢) but that just writes it as a string in the font i've loaded.
Is there a way to use the HTML character reference that I've missed? Or are there any plans to change the way the shortcuts are edited?
Getting glyphs in shortcuts
Re: Getting glyphs in shortcuts
Generally, that's exactly how it should work. A good example is Hudiy Symbols which is used in the main menu. Could you please check whether the Font Family name set in shortcuts config matches the loaded font? Sometimes items like Italic, Regular, or Bold get appended to the Font Family name. If you can, please upload the font and we'll test it on our side.
Re: Getting glyphs in shortcuts
I already saw that the Hudiy symbol for Android Auto was defined as "\ue900". The issue is that there's so many glyphs in this font, I can't define the symbol in this way with my font.
The font does load properly, but when I try to define it as "􀊢", it just puts this exact string in the shortcut bar instead of the desired glyph.
The font does load properly, but when I try to define it as "􀊢", it just puts this exact string in the shortcut bar instead of the desired glyph.
- Attachments
-
- SF-Pro-Display-Regular.otf.zip
- SF Pro Display Regular OTF
- (1.46 MiB) Downloaded 57 times
Re: Getting glyphs in shortcuts
In JSON (the configuration file format used by Hudiy), you need to use a surrogate pair for symbols > U+FFFF.
For the \u1002A2 surrogate pair is \uDBC0\uDEA2
You can use e. g. this online calculator for conversion https://russellcottrell.com/greek/utili ... ulator.htm
More details about surrogate pair: https://www.unicode.org/faq/utf_bom and https://en.wikipedia.org/wiki/UTF-16
shortcuts.json:
For the \u1002A2 surrogate pair is \uDBC0\uDEA2
You can use e. g. this online calculator for conversion https://russellcottrell.com/greek/utili ... ulator.htm
More details about surrogate pair: https://www.unicode.org/faq/utf_bom and https://en.wikipedia.org/wiki/UTF-16
shortcuts.json:
Code: Select all
{
"iconFontFamily": "SF Pro Display",
"iconName": "\uDBC0\uDEA2",
"action": "volume_mute"
}
Re: Getting glyphs in shortcuts
Thanks so much!
I actually came across this surrogate pair but I mean to recall it didn't work for me. I must have made a mistake. Thanks so much
It's really enjoyable to work on this with good support!
I actually came across this surrogate pair but I mean to recall it didn't work for me. I must have made a mistake. Thanks so much