FiraCode
FiraCode copied to clipboard
Similar to 0×F, add support for binary and octal constants
It would be great if a binary constant, such as 0b1101, could be displayed with a small, raised letter b, and likewise, an octal constant such as 0o644 could be displayed with a small, raised letter o.
I’d get confused with 0o644 rendered as 0○644
(I can't find any unicode for a small centered O)
Using a lowercase o is already established in JavaScript as the way to express octal numbers, so if that's confusing, the confusion already exists. This change would make the formatting more clear, not less clear, that an octal constant was intended.
And yes, unlike the case for 0×F, it's not as easy to point to an existing glyph to create this "ligature" (more technically, a "contextual alternate"). But I've accomplished this by hand-editing a font, taking the existing b and o, scaling them by a factor of 75%, shifting the positions upward a little, and then adding the results as two new non-Unicode glyphs which are used just for these contextual alternates.
What I’m saying is, centering the O makes it more similar to a 0, as much as there is no dot/slash.
If you look at the picture I added, I don't think it looks more like a zero at all. The result is even smaller than a normal lowercase o, so what you get looks less like a zero that what you get without the new ligature.
Sorry, I replied via email where I can't see pictures.
I guess it works, personally I'd make the B uppercase but that would be really confusing
Here's what it looks like as-is in JavaScript, without a special ligature:

I can for some reason now see the image via mail?
In general, I’m not against the idea. Let me think about it, maybe there’s a way to make it look better
I'm working on a programming language which will use 0c to denote octal simply because 0o is ugly and hard to read. Perhaps that idea can be swiped here?
How about using something the music flat sign: ♭ (0x266d) and armenian small letter oh: օ (0x0585)?
(Although the latter breaks the monospace)