Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Editor not handling non-standard glyphs, even when the font should be able to #3836
I was thinking of making a basic ASCII-graphics drawing program using (most of) the character set from code page 437, so I copy/pasted the following string into the processing sketch, to be manipulated by the code:
With the default font, most of the characters come out as empty "glyph-not-found" boxes. They still display correctly when running the sketch, or printing to the console, and when copied/pasted into other editors I get the original glyphs, not empty boxes. When changing fonts in the editor settings, some fonts do work correctly, further suggesting this is a missing-glyph issue on the font side, and not really Processing's "fault."
But here's the the weird thing: many fonts that I can choose from and have this issue, don't have this issue when used in other editors. For example, Ubuntu Mono, and the default Source Code Pro font handle these glyphs just fine in every other context. Eh?
Anyway, I'll just set the font to one that displays them correctly for now (DejaVu Sans works fine), and I can completely understand that this such a niche use-case that fixing it isn't high priority. But it's still kinda strange.
Trying to narrow down possible causes, I tried using
But when I wanted to use the CreateFont tool to pre-generate the font, to check if that produces the same results, I noticed the font had a different name:
So I tried changing the name in the createFont function to reflect that, and it "solved" the issue:
... except that I can't select "Source Code Pro Regular" in the drop down menu:
I tried manually overriding the settings in
Maybe that's indicative of what might cause the problem?
(I also double checked other programs: the fonts work fine when used in a terminal emulator, LibreOffice Writer and Sublime 3)
Yes, this is very helpful... So at the moment it looks like you have Source Code Pro installed on your machine and either that version, or the version that ships with Processing, is inferior. Can you try removing the version installed on your system (you'll probably need to log out and back in again for it to take) and see what happens?
Another attempt at useful feedback:
Re-installing the fonts fixed the issue, provided I chose any variant of Source Code Pro (Light, Medium, Semi-Bold, etc) except the default
As you can see, manually copying the latest version of the font to the data folder and loading that also gave good in-sketch results except for � again, so that glyph is apparently not supported by the font at the moment (for my particular use-case, it was a stand-in for the not-a-character-code of code page 437 anyway, so I'll just replace it with □).