In Ignition 7.9, we’re able to render arrows from the unicode characters (0x2190 - 0x2200), and sometimes use those on labels as a clarification for the operators.
No matter what font is chosen in 7.9, it will always show arrows in the label. But I guess there’s some fallback fonts working here.
On 8.0 however we get those “character not found” boxes for most of the arrows.
Only Lucida Sans Unicode comes close (has a few unknown characters), and Cambria renders all glyps, but can’t be used as a default font due to being Serif.
Is there someone who can explain what fonts are used when, how fallback fonts are chosen and how it relates to the JRE/JDK (which I expect is the issue here).
And ultimately, how to change the configuration in order to have fallback fonts, and make the glyphs visible in the designer too.
Ok, found some further info.
It looks like Google Noto separates the fonts by language. The fonts are primarily needed for web development: by splitting it per language they limit the download size, and CSS can accept multiple fallback fonts anyway. So you can get the full range of characters (see Guidelines for Using Noto – Google Noto Fonts).
The really strange part is how Noto is now split in different languages, but neither
Noto Symbols nor
Noto Symbols 2 supports a majority of arrows (though they do have different support).
In 7.9 however, Lucida was apparently shipped and used as fallback font, but this isn’t shipped anymore in new JRE’s. (see Font issues with Symbols - #3 by fred.berryman). Strangely enough, I still see
Lucida Sans Unicode in my list, which has a pretty good support for symbols, but not as good as in 7.9.
But now I’m wondering if Java has a feature similar to CSS where you can define multiple fallbacks. And how to even configure fonts for the designer.
The longer I try to research it, the weirder it gets.
I now found some other arrows too, that looked very similar. And tried to render them. They are (in order)
- ⭮ : 0x2B6E
Clockwise triangle headed circle arrow (part of Unicode 1.0, in the
- ↻ : 0x21BB
Clockwise open circle arrow (part of unicode 7.0, in the
Miscellaneous Symbols and Arrows block)
And when putting it in a label, I chose the fonts
Noto Sans Symbols2 and
Lucida Sans Unicode in that order.
How messy is this all?
Fonts in the JRE right now are a bit of a mess. Oracle used to ship Lucida with the JRE which had really good coverage for a large number of glyphs and symbols but they aren’t included with openJDK so we bundled Googles Noto fonts with the JRE we ship with Ignition. The core Noto Sans font does a reasonably good job at representing fonts for a large number of languages, a good number of fallback fonts are shipped by default with the our runtime. But yes, they do splinter some of their fonts to reduce their footprint meaning some of these edge cases may appear. Symbols and Symbols2 contain a lot, but it does appear they are missing these arrows.
There is support for multiple fallbacks in the JRE and the first match will be used, all you have to do is drop a font that renders the glyphs into the JRE’s fallback font folder using the process described HERE. That being said, I’d like to add this to our JRE for you for a future release using a Google Noto (or other) font since this process is a bit cumbersome at the moment. Could you DM me this project which has all of these characters (so i don’t have to re-invent the wheel) and I will open a ticket?
Thanks for the reply. We don’t have a project where we use all of those. But we do use arrows from time to time.
To test it, I just generated it as a string in Python (of the block we normally use), and copied it to a label.
string = u"<html>"
for c in range(0x2190, 0x2200):
string += unichr(c) + " "
Thanks in any case for looking into this. I’ve come to realize how difficult Unicode and fonts are, and really appreciate your work on it.