The Shape of Everything
A website mostly about Mac stuff, written by Gus Mueller
» Maybe Pizza?
» Micro feed
Today I'm doing some minor bug fixes in Acorn, and I'm currently tweaking the order in which font typefaces show up in the text palette's typeface popup.
Currently to get a list of typefaces for a font, I use NSFontManager's
availableMembersOfFontFamily:, and just loop through those and add it to the menu. Now I'm thinking I should sort them alphabetically (as suggested from a customer). However I'm not 100% sure that's the right way to go.
Should the listing start with the thinest font variant, and move down to the boldest? Should the Regular style be placed at the top if there is one? Should italic variants interleave with everything? Is there already an algorithm out there that I'm aware of?
Am I thinking too hard on this?
Update: The docs for
-[NSFontManager availableMembersOfFontFamily:] say:
"The members of the family are arranged in the font panel order (narrowest to widest, lightest to boldest, plain to italic)"
Unfortunately, it looks like this is broken on MacOS 10.15.1. Running Acorn on 10.14 produces the order as described (and as seen below with Helvetica Neue). Looks like I was sent on a wild goose chase and I need to file a bug report to Apple instead.
Filed as FB7476430, with a sample project.