Shaping ligatures in monospace fonts
46 points by todsacerdoti 11 hours ago | 7 comments
  • california-og 9 hours ago |
    Fonts are kind of dumb. There's usually nothing actually weird going on. Ligatures are simple character substitutions. What the LIGSPACE is, most likely, is a spacing character added by the designer to align the characters in the ligature correctly. So, the LIGSPACE is just a character like any other and is nothing special. For example, when you hit a space bar, you are inserting a character which doesn't render anything because the designer didn't draw anything there. There's no extra logic.
  • hbosch 8 hours ago |
    >Since we are working with a monospace font, every glyph must have the same advance

    Just pointing out that this is merely an expectation and not a rule. You can happily design a "monospace" font in any font publishing software that blatantly disrespects a single width. In fact, you can just manually make any letterform 2x width, and that is exactly what most monospace ligatures do! (except the bad ones, which combine e.g. "fi" ligature a single width letter)

    The ligature letters are just... 2x width. Believe it or not this is totally legal!

    https://www.hanselman.com/blog/monospaced-programming-fonts-...

    • DHowett 5 hours ago |
      > > advance

      > you can just manually make any letterform 2x width,

      Yes. Any glyph may be wider than its advance. The advance, however, must remain the same across all glyphs. If it does not, the font is not monospaced.

      The passage you’ve quoted refers not to the width, but to the advance.

  • Etheryte 8 hours ago |
    I think the ligature from MonoLisa is a good example of how not to do ligatures. I can't tell whether it stands for "#={" or "#{". Ligatures can be nice, to each their own, but only if they don't introduce ambiguity.
    • propter_hoc 8 hours ago |
      It also makes no sense and looks terrible to connect those two glyphs with a ligature. Unlike "fi" or "ij", there's no reason (kerning or spelling) to want to smush # into {.
      • weinzierl 3 hours ago |
        I don't doubt that but I cannot really pinpoint what the reason is to want "fi" and "ij" in a monospace font? Do these narrow letter ligatures then take up only a single character cell?
  • p4bl0 13 minutes ago |
    > The text is almost all English with glyphs from the Basic Latin Unicode block.

    Well, the code text probably, in most programming languages. But code also contains comments, and comments are very often written in other languages than English in personal project and/or during development phases before clean up for merging, and sometimes even after that.