-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ligature for 0x (hexadecimal) prefix #98
Comments
@hugoferreira Sure, will be added in the future. |
ligatures for 0b and 0B as binary prefixes would also be nice, and 0X as another hexadecimal prefix |
Major changes — Added Greek alphabet #58 — Reworked diacritics #228 — Removed x-height increasing from hinting. Affects non Retina screens. #286 #265 #272 #262 #275 — A lot of tiding up of contours to meet Google Fonts criteria Other updated and fixes — Ligature for 0x (hexadecimal) prefix #98 — Lowered horizontal bar in Florin to make it more distinguishable form italic f #129 — Changes the 8 construction to make it more distinguishable from B and 0 #188 — Added Changelog #263 — Variable font correctly grouped in one family with Italics #270 — Reverted to previous construction of f #273 — Corrected OneNote line height #278 — Removed kerning pair #297 — Add Overline #298 — Increased difference between hyphen, en-dash, and em-dash #318 — Removed the "tail" in the italic a
Centered × looks controversial and contradicts other number base specifications b = 0b1001 × means multiplication or dimension, and loose the initial meaning of heX As an idea I propose such a ligatures: b = 0₂1001 it may be much nicer |
However attractive and accurate that looks, the problem there would be typing an 'x' on your keyboard, and getting a subscript 16 the width of any other monospace character. Than suddenly, the 2 and 8 have to be the same width as a 16, which has two characters. I've seen some arguing on FiraCode's issues (don't remember which) about also making the b and o smaller and vertically centred, which would solve the consistency problem. Personally I'd take the subscripts, I think they are much clearer to read and way more 'accurate', but I think that's not a feasible generalized option. Edit: tonsky/FiraCode#1080 :The issue I was talking about. |
Anyway, if we deal with letters, “x” should remain x-letter, not cross. |
Yeah, why would "0xFF" turn to "0 times FF"? That's not the meaning of the 0x prefix, never was. |
Exactly this discussion, most people there seemed to say a cross-looking small x is preferable, judging by the votes. Though I'm not impartial and part of the votes in favour of the cross looking option. I'm not sure how you mean "x" should remain a letter instead of a cross @Ilis. Are they substantially different? |
There's a reason people want JB Mono — the font used for professional software development, and motivated by needs of developers, such as distinguishing things that are fundamentally different. Fira Code, by contrast, is basically a Comic Sans MS Mono. |
Ok, looks like this feature not making everyone happy. Here is a point from @mvasilkov
the multiplication sign between numbers is commonly used for, well, multiplying numbers Please fix / revert. |
Hey, there's no need to sling such incredibly hurtful insults at FiraCode 😮 However, do you actually have something specific to say? Or do you think the whole ligature should just be removed? The fact is that 0xFF was chosen for hexadecimal at some point in the past and we have to deal with it. If there is another ligature that isn't confused with multiplication, but still makes both the meaning and the character that is present in the background obvious, I'm all for it. Do you have any ideas for such a ligature? Otherwise, this discussion may never be resolved. At least, until variable fonts are widespread and one can decide for themselves how they want to see the 0x prefix. |
But how often is there actually going to be confusion in the use case? But I feel like the case 0xFF being read as 0 times FF(hexadecimal) is non-existent. It makes no sense to ever write that. Besides, if the language requires the prefix, the reader would be looking for the 0x in any hexadecimal number. I'd argue finding the prefix and starting to read the actual number after it, is easier with the ligature as it is in 2.200. Most people don't read character by character, actual reading is done way faster and by shape. Identifying the shape of the prefix and ignoring it should be easier with the ligature. And finding a hexadecimal and suddenly separating it into an multiplication seems unnatural, but that is just my limited point of view. I'm just saying that things that seem wrong on their own in the change notes may not seem as wrong in context and use. I do still agree a different ligature would be optimal, but I would have no idea what would convey a hexadecimal number consistently without looking like a multiplication sign. Maybe it's possible to incorporate the leading 0 into the ligature as well, change the entirety of the first two characters to signify the base of the number. Similar as to how the >= ligature completely hides the underlying characters in favour of meaning and readability. This would also give an opening for other number bases, such as binary and octal. |
Re:@Omnieboer Look, I get that ligatures are cool. But if we change the meaning of the text as written in order to get in more ligatures, — is the trade off really worth it? Sure, like you say, In this case, it's not; the 0x (which is, zero-ex) gets replaced with 0× (zero multiplied-by). The notation M×N has a pretty universal meaning, and literally nobody gets confused whether 2×4 is a multiplication, or a misspelled hexadecimal 0x04. I think it's as clear cut a case as could be.
It's not what I read, it's what you write. It makes no sense to ever write that. 0 times FF is not a thing.
IMO it should be removed to improve readability.
But everyone loves Comic Sans! :) |
I wonder what is possible in the two character space of the prefix for non-decimal numbers. Please observe my obvious lack of design skills: After just making these, I do realise FF in octal doesn't make any sense whatsoever, but I think what I mean is still conveyed. Please someone who is actually good at this, take a crack at it? But most importantly @philippnurullin is it even possible to have a ligature for both the first characters? Or only for the second character i.e. the x/o/b in 0xFF, 0o33 or 0b11? |
OK, I think I have a good explanation for why I think it's a bug. The zero-multiplied-by ligature gets the cause and effect of ligatures backwards. When we write Same goes for But when you write hexadecimal, what you wanted was 0x, and it's on the keyboard, so you write 0x. There was no intent here to write a multiplication sign. When writing hex numbers by hand, you write 0x, not a "zero by something" math notation. So in this case the ligature goes against the intent of the person typing at the keyboard. If anything, let's maybe not center the thing after the 0, and instead make it a subscript:
Or like you proposed above,
(At smaller sizes this will probably be unreadable though.) |
I think we disagree on this base want. What I want to write (and read) personally is FF16, but I think in coding it's easier to prefix than suffix. In that case I'd want to read/write 16FF. The x in 0x feels kind of choses out of necessity. The unreadability in smaller sizes is true though, I wonder if an actual design-smart person (so definitely not me) could come up with a design if unrestricted by the 0-something notation. |
@Omnieboer Looks like Control codes #241 |
I should have specified, I think the 0x prefix (and 0b and 0o) could be replaced with a different sign/glyph that is 2 characters wide and shows the intent: base 16/8/2 number. Buy maybe instead of just moving the x in 0x, go the route of >= and <=, where an entirely 'new' glyph/character replaces the actual typed characters. Thus the ideas in the pictures I shared above, those prefixed are still supposed to be 2 characters wide. I am just saying that two characters worth of prefix for hex/oct/bin is plenty of room for creativity and out of the box thinking. Edit: So the 0x would be completely replaced, not just the x. |
As the OP of this request, it's amazing for me how far people go to disagree, up to the point of attacks based on "professionalism", whatever that is. This said, I believe every ligature should adhere to some kind of principles and guidelines. @philippnurullin already mentioned one that seems sensible: the space occupied by the ligature must be the same without it. I would add another one: the ligature must be as close as possible to the original text, minor cosmetic changes, up to the point that a programmer knows which character originated it. If we accept this guideline, things like base subscript should be out of the question. A third possible one: the ligature should not assume semantics that are not present in the language. Verilog doesn't use My suggestion is that we first stick to the discussion of these guidelines (perhaps in a different thread), before we start brainstorming specific ligatures. |
Though I appreciate that you started this thread, that is only because you beat me to it ;) But I guess it is fair to have the discussion "Should there be a ligature for 0x in the case of Hexadecimal?" first.
This is necessarily true and I don't think anyone was arguing that it shouldn't be so. As far as I can tell there was only a minor miscommunication about that (my bad).
I think this is true to a degree, but as argued above: sometimes the characters typed are there strictly due to shortcoming of keyboards, where ligatures can make the meaning explicitly clear. Besides, discussion about the specific options for the ligature is exactly about this point: trying to make the language as readable as possible, without disturbing meaning and disturbing the actual written text as little as possible. But taking the as close as possible to the original text approach too far (not saying you are arguing for this) would make the concept of connected ligatures pointless.
This is indeed an unsolvable problem, as there will probably always be at least some esoteric language that uses a combination of symbols for something else. I'm not saying languages that use these different assignments are esoteric or not as valid. But looking at the 2020 StackOverflow Survey, the most popular languages are JavaScript, Python, Java, and C# and all of those use 0x for hexadecimals. Trying to conform to all languages will lead to 0 ligatures, as @hugoferreira said. Until variant fonts are in widespread use, conforming to the majority seems reasonable. Edit: At least, that's my take on it. Please help me broaden my horizon if necessary! |
@Omnieboer all your considerations seem sensible to me :) If @philippnurullin agrees with our suggestion, maybe this conversation should spawn its own thread. |
@hugoferreira Sure, have fun. ) What bothers me is that by creating a too complex substitution the code become unreadable/strange in some languages. The font don't have ability to understand the programming language you using. So solution of this problem can create a "frankenstein" of a font (someone create a "clever" workaround), or it lies on the part of IDE. |
Then what is the decision for the current ligature? I'd prefer the current x to no ligature. |
I’d like to chime in that I also don’t like the
|
I would like to offer the following: vote for each option you'd be okay with, not just the top option. That way the most people get an option they're down with. For example, I'd like the centre letter ligatures, but I'd maybe vote for just the 0x ligature as a tactical vote, hoping more people agree there. So 'okay with these' votes make more sense to me, with 1 "no ligatures" vote, and 3 "yes ligatures, but" votes. I'd also like to add for posterity that this is obviously non-binding unless @philippnurullin supports this specific way of handling things. I'd say that the GitHub Issue comments from an issue from January might not be the most representative in the long run. |
I will remove the Sadly i'm not an expert in a lot of programming languages, if in any at all) and changing the |
Why isn't there a way to disable this? It is objectively confusing in more than one context (I'd argue most) even if it looks cool (to some) in some circumstances. I write code. |
What version are you using? This has been removed a long time ago. Maybe you should better update your font. |
Congratulations on the great job so far! Here's a proposal for enhancement: add a ligature for the
0x
prefix used in hexadecimal notation, as found in the Fira Code font. Bonus points for sequences like128x128
.The text was updated successfully, but these errors were encountered: