Skip to content
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

fix(mono): maintain fixed width for fractions and code ligatures #44

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

wayne-shih
Copy link

Fixes #33

Rationale and fixes implemented

Few things to note here, this PR tweaks all the mono glyphs to the same metric width (600) -- thus, system and code editors will recognise Geist Mono as a monospace font.

In doing so, a few things needed to be changed :

  • Fractions
    • Previously 1200 wide, this is changed to 600 wide as each are individual unicode glyph rather than a custom ligature
    • NOTE: It has been redrawn to fit 600 wide ; please review from a stylistic point of view, I'm happy to remove this if you'd like to redraw it differently yourself
    • Removed frac open type feature. It didn't make sense to include it as the input was 3 characters (ie. 1 / 2) to result in 1 character (½)
  • Code ligatures
    • Previously these were various widths (multiple of 600; ie. 1200, 1800, 2400, 3000), these have all been changed to fixed 600.
    • To make the code ligature still work, I introduced a SPC glyph -- empty character -- which is used as a filler character to construct the ligature
    • Disabled liga (standard ligature) feature -- previously auto generated
    • Added a new calt (contextual alternative) feature -- this replaces the liga and contains all previous instructions but utilising the SPC character. This is the same/similar approach as how JetBrains Mono, Fire Code, et al... uses.
      lookup asciitilde_asciitilde_greater.liga {
          sub SPC SPC greater' by asciitilde_asciitilde_greater.liga;
          sub SPC asciitilde' greater by SPC;
          sub asciitilde' asciitilde greater by SPC;
      } asciitilde_asciitilde_greater.liga ;
      

Test export files -- ttf only

8f30371GeistMono.zip

Note
This is a direct export from Glyphs -- not using fontmake or any other undocumented flows you might have in place already

Supporting screenshots

Redrawn fraction glyphs
CleanShot 2023-11-06 at 21 16 00@2x

Now recognised as a monospace by WebStorm
(I didn't test other code editors or systems, would be super surprised if others don't recognise it now as a monospace)
CleanShot 2023-11-06 at 21 22 22@2x

Ligature still works
CleanShot 2023-11-06 at 21 24 58@2x

Actions and next steps

Keen to get some peer (/stress) testing in to see if I'm missed any code ligature pairings and if any ignore sub needed to be added.

Fractions should be viewed from a design perspective.

If all happy, would need to cut a new release -- I didn't do this bit as it's not documented how y'all are exporting the binary font files (either directly from Glyphs or using fontmake or other scripts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Geist Mono not recognised as 'Fixed Width' on macOS
1 participant