commit-mono icon indicating copy to clipboard operation
commit-mono copied to clipboard

Commit Mono not listed as “Fixed Width” in macOS "Font Book.app"

Open rben01 opened this issue 2 years ago • 29 comments
trafficstars

In macOS’s Font Book app, if you look in the Fixed Width collection, Commit Mono is not listed. Is the fact that Commit Mono is monospace a missing piece of metadata? (I don't know anything about how font files work or what information they store about themselves, but other monospace fonts I've installed have correctly ended up in the Fixed Width collection.)

rben01 avatar Jul 20 '23 00:07 rben01

I will have a look to see if I can fix this, seems pretty crucial.

eigilnikolajsen avatar Jul 20 '23 20:07 eigilnikolajsen

Same on Windows 10.

glebd avatar Jul 27 '23 00:07 glebd

I think I've found the source of the issue. When exporting the font using opentype.js the value 'isFixedPitch' fromt the 'post' table seems to get lost. This value seems to be the indicator of font being monospaced. The default value is 0 and that overrides the 1 that I otherwise put. I've filed an issue in the opentype.js repository, hopefully a new version can fix this problem so the font can be exported with the correct category.

eigilnikolajsen avatar Aug 11 '23 21:08 eigilnikolajsen

I'm facing the same issue on my MacBook. My editor requires me to load a monospaced font but as Commit Mono is not listed as one, I cannot currently use it.

gaksaray avatar Aug 16 '23 10:08 gaksaray

Yes, I am sorry about @gaksaray, hoping to fix it as soon as possible. Meanwhile, if you're willing to use the un-customized version, I've created a version for you that should show up in the fixed-width category correctly: CommitMono-1.134-monospace.zip

eigilnikolajsen avatar Aug 16 '23 10:08 eigilnikolajsen

Thanks @eigilnikolajsen this works! However, I recall your suggestion from the website to use a weight of 500 in light mode environment (which I prefer). If that's the case, I will still be waiting for customized fonts with a fixed width.

gaksaray avatar Aug 16 '23 10:08 gaksaray

As an additional data point, Windows Terminal doesn't like it either. When choosing the "Font face" in settings, it initially doesn't even show up in the list:

image

If you choose to "Show all fonts" and then select CommitMono, you get the following warning:

image

DwayneBradley-eaton avatar Sep 29 '23 19:09 DwayneBradley-eaton

Did some debugging and experimenting and got it to export the correct monospaced font. The released versions of opentype.js doesn't pass in the post table when it creates the blob, so it creates a default post table. The current master has it correctly passed in. I built a script from master and updated commit-mono's download script to use it instead. If anyone wants to use it, can use my fork.

@eigilnikolajsen Don't know how you feel about using non official release version of a opentype.js, so didn't make a PR, but can make one if you're okay with that.

StreakInTheSky avatar Nov 02 '23 08:11 StreakInTheSky

Hey @StreakInTheSky ! Thank you so much for your testing. I'd love if you make a PR, I'm totally fine using a non-official version as long as it works.

I think this might resolve https://github.com/eigilnikolajsen/commit-mono/issues/62 and https://github.com/eigilnikolajsen/commit-mono/issues/10 as well!

eigilnikolajsen avatar Nov 03 '23 19:11 eigilnikolajsen

Thanks to the help of @StreakInTheSky this should now be resolved in the latest release

eigilnikolajsen avatar Nov 05 '23 10:11 eigilnikolajsen

I just installed the latest release and it still doesn't appear under Fixed Width in Font Book.

rossburton avatar Nov 06 '23 13:11 rossburton

Weird. It's difficult to find info on how Font Book recognises fixed-width fonts. My best guess is that it's the panose numbers. I think those are still an issue on OpenType.js.

eigilnikolajsen avatar Nov 06 '23 14:11 eigilnikolajsen

FWIW, the newest release can be set as the terminal font on e.g. Windows Terminal without it complaining about not being a fixed width font.

caksoylar avatar Nov 06 '23 17:11 caksoylar

I have found before that some monospaced fonts actually have a few stragglers that are just slightly different width than the rest which prevents it from showing up in that category of macOS's Font Book.app.

I ran the font through the ttx tool.

The file you posted (CommitMono-1.134-monospace.zip) has in hhea table

<numberOfHMetrics value="1"/>

On the other hand, v1.142 has in hhea table

<numberOfHMetrics value="1926"/>

which seems high to me.

Also, in CFF table

  <CFF>
    <major value="1"/>
    <minor value="0"/>
    <CFFFont name="CommitMono-Regular">
      <version value="Version 1.134"/>
      <Copyright value="Copyright 2023 Commit Mono authors \(https://github.com/eigilnikolajsen/commit-mono\)"/>
      <FullName value="CommitMono Regular"/>
      <FamilyName value="CommitMono"/>
      <Weight value="News"/>
      <isFixedPitch value="1"/>

is how the one you posted in this thread looks like.

And the latest release shows

<CFF>
    <major value="1"/>
    <minor value="0"/>
    <CFFFont name="CommitMono-Regular">
      <version value="Version 1.142"/>
      <FullName value="CommitMono Regular"/>
      <FamilyName value="CommitMono"/>
      <Weight value="Regular"/>
      <isFixedPitch value="0"/>

Please note the isFixedPitch. This is a separate entry that is different than the entry in post table.

stlee42 avatar Dec 11 '23 23:12 stlee42

So opentype.js has a number of issues with Monospaced font support, the post table was just the most obvious. Did a bunch of research a while back since I had no idea how font files worked before this, but it kind of went on the back burner. Should probably create an issue over there.

StreakInTheSky avatar Dec 12 '23 20:12 StreakInTheSky

JetBrains IDEs also doesn't recognise this font as monospaced font. I looked for this font under Proportional category, didn't find it either. image image

yvvt0379 avatar Feb 16 '24 09:02 yvvt0379

You can try the version with the modifications I described in #75. The changes make it possible to use it with the Windows Console, so maybe they'll work for you too. The files are attached below:

They're based on Commit Mono version 1.142 of 2023-12-09. The weights are 400 (Regular) and 700 (Bold). Hope it's OK with the author to share it like that, if not please feel free to delete. I can also post the .ttx diffs.

GeographicCone avatar Feb 16 '24 10:02 GeographicCone

I was really excited to try this font - especially with all the great customisations to my liking - but bumped into this issue. Using MacOS + Kitty and Kitty only recognises fixed widths fonts and it's not listed as that in neither Kitty nor Font Book.

pean avatar Apr 11 '24 06:04 pean

@GeographicCone your version worked for me, thanks for providing this!

nobe4 avatar Jan 30 '25 17:01 nobe4

I was really excited to try this font - especially with all the great customisations to my liking - but bumped into this issue. Using MacOS + Kitty and Kitty only recognises fixed widths fonts and it's not listed as that in neither Kitty nor Font Book.

struggling with same issue :(

kirchik95 avatar Feb 23 '25 21:02 kirchik95

I was really excited to try this font - especially with all the great customisations to my liking - but bumped into this issue. Using MacOS + Kitty and Kitty only recognises fixed widths fonts and it's not listed as that in neither Kitty nor Font Book.

struggling with same issue :(

I can also say that the issue persists on macOS Sequoia 15.3.1 with Commit Mono version 1.143. The font is not identified as "Fixed Width". I hope this gets resolved soon.

gaksaray avatar Feb 24 '25 09:02 gaksaray