Font Book picks the wrong weight for the family preview-how to fix?

Hi everyone,


I have this annoying problem where Font Book doesn't pick the right face to represent the font family in the preview window.


So instead of using the Roman/Regular for a given font, it will use the Bold, Italic, Condensed, or something even less representitave for the font. This makes it very difficult to cycle through them quickly in any useful way.


How does Font Book choose the "default" face in a family? How can I change it?


I know how to use TTX to decompile fonts in Terminal and edit wrong metadata, so I could fix this inside the fonts if only I knew what Font Book is looking for.

Posted on Mar 3, 2012 5:04 PM

17 replies

Mar 3, 2012 6:26 PM in response to Community User

I'm afraid I can't answer your question, but I can tell you that, on my machine, Font Book always seems to choose the Regular (or Plain) face for a font family preview. (If you give me a few names, and if I have them, I can check those specific fonts.)


I think I would try deleting the font cache and Font Book's prefs. If you're dealing with fonts, you probably are already aware of Kurt Lang's paper on font management


<http://www.jklstudios.com/misc/osxfonts.html>


If you use TTX, you may also have used Apple's Font Tools (or Font Tool Suite). It's a free package of CLI font tools which can be downloaded from Apple's developer site (sorry, I no longer have the link, but you should be able to find it). Maybe the accompanying docs have the answer.


HTH

Mar 4, 2012 12:09 PM in response to fane_j

Thanks for the reply. I've flushed the cache before, but I'll try that again. Also, thanks for the tip about Apple's Developer tools and resources. I might find the answer somewhere in there, and try to remember to post back here.


I doubt bad cache files are the issue because the problem font families are pretty predictable. The ones that come with the Mac work fine. It's more an issue with downloaded fonts, fonts made before OS X, and fonts with naming schemes Mac appears not to expect, like "45 Light" and "55 Roman".


It seems every time it doesn't choose the regular/roman face, it defaults instead to the first alphabetical face listed. In other words, it's not getting it "wrong", it simply didn't find whatever cue it was looking for and gives up.


For instance Cabin—which is a family you can download for free from Google Web Fonts—defaults to "Medium", which is the first alphabetical choice. This is the bigger problem when that first alphabetical face is something offbeat like "Ornaments".


I probably just have to figure out what exactly Font Book is looking for, and set the appropriate flag in the font file.

Mar 4, 2012 7:22 PM in response to Community User

Clint1459 wrote:


For instance Cabin—which is a family you can download for free from Google Web Fonts—defaults to "Medium", which is the first alphabetical choice.

Mm, but it isn't. I downloaded and installed Cabin, and, indeed, Font Book's default for the family is Medium, but it's not the first alphabetical choice, that's Bold. Alphabetically, Medium is the fourth, so that's not it. The question is, why Medium and not Regular? Maybe there's a clue in comparing them. And if I do that (using FontDoctor -- I don't have anything else handy) I see that both Medium and Regular have family "Cabin" and style (I think that's subfamily in TT specs) "Plain".


So, my working hypothesis would be that Font Book chooses the "plain" style font as representative for the family; and, if there are more than one 'plain', then perhaps it chooses the first one in alphabetical order among them; further, that the problem is with the designer, who created two subfamilies with the same name in the same font family. Perhaps you can test this.


(Additional support is the fact that, if I remove Cabin Medium -- and only Cabin Medium -- then Font Book defaults to Cabin Regular as representative for the family.)

Mar 5, 2012 8:05 AM in response to Community User

You're right about the alphabetical thing, sorry! I quickly scanned to find a font people could access for free, and I forgot Font Book doesn't alphabetize styles.



Thanks for the tip… do you have any idea what field FontDoctor might be looking at to come up with "plain"?



I went through the code on Cabin Bold, Regular, and Medium, and none of them have the word "plain" in any of their name fields (in fact, not anywhere in the font files). The Subfamily value (nameID="2") seems to be correctly labeled by weight for both platform 1 (Mac) and platform 3 (Win) in all three.



This makes me think FontDoctor might be basing "plain" off a field that it expects to find, but is absent from all three files. I could add that field if I knew what it is.



I couldn't spot any inconsistencies in the name fields which would seem to prioritize Medium above the others. However, it does seem to be the rule that when Font Book can't find the true Regular/Roman/Plain style, it simply picks the first font in the Family list (which as you pointed out, is not necessarily alphabetical).



I tried changing the Medium fonts' macStyle field in <head> from the default to Bold, but it still picks Medium over Regular. I also tried playing with the weight values in the OS/2 table, but this made no difference (Mac isn't supposed to use it anyway)



I don't understand Font Book's list ordering logic either. Medium, Regular, Italic, Medium Italic, Bold, SemiBold, Bold Italic, Semibold Italic? What possible field could that be ordered by? Perhaps that would be a clue as well.

Mar 5, 2012 8:55 AM in response to Community User

This makes me think FontDoctor might be basing "plain" off a field that it expects to find, but is absent from all three files. I could add that field if I knew what it is.

With internal font names, there is no "plain" designation. At least not as far as weights go. You select Normal as the font weight for plain/regular. You can give the menu name something like Cabin Plain if you want, but the font itself will be categorized as Normal.


Font Book also may just be jumping to the nearest last selected weight. As an example, open TextEdit and make sure it's in Rich Text mode. Now press Command+T to call up the font palette. Select any font and then a weight, such as bold. Now select Cabin. Note that the app assumes you want to remain on a bold face and selects Cabin Bold rather than moving to Regular. It will do this if you select Italic, or other typeface. When you move to another font, it will try to stay on the same style. So perhaps that's what Font Book is doing? Can't be sure since I don't have it on my Mac to test.

Mar 5, 2012 9:47 AM in response to Kurt Lang

Hey, I think I've figured out a universally consistent pattern to how Font Book picks the default face. I think it's based on the nameID=2 field (that's the Subfamily or Face field), and prioritizes them this way:


1. "Book"

2. "Medium"

3. "Regular"

4. If none of the above exact matches are found, it picks the first font in the list.


AgaiN, this works only for exact matches–fonts with a number before the weight like "45 Book" will go straight to the first font in the list.


Also, I still don't have a good handle on how Font Book orders the list of faces within a family.


This pattern is a bit confusing; I think most typographers would assume "Regular" would win over "Medium", so I'd been assuming this wasn't a conscious design decision on Apple's part. Looks like it is.

Mar 7, 2012 7:15 AM in response to Community User

Clint1459 wrote:


do you have any idea what field FontDoctor might be looking at to come up with "plain"

None.

I went through the code on Cabin Bold, Regular, and Medium, and none of them have the word "plain" in any of their name fields

You're right, I checked it too. I was quite wrong about that. I surmise now that Font Doctor uses Plain for anything that's not Bold, Italic, etc. Since I couldn't be sure about that, I gave up on FD, and I used ftxdumperfuser from Apple's font tools suite.

I've figured out a universally consistent pattern to how Font Book picks the default face. I think it's based on the nameID=2 field (that's the Subfamily or Face field)

Or Style. Yes, I believe you've got it; it's as I suspected above.

prioritizes them this way:


1. "Book"

2. "Medium"

3. "Regular"

4. If none of the above exact matches are found, it picks the first font in the list.

1–3, yes. 4, not quite. Here's how I tested it.


First, I had a quick, rough peek at Font Book's code. It seems that five words have special meaning:


  • Medium
  • Book
  • Roman
  • Plain
  • Regular


(Sorry, Kurt, Normal isn't there. There's W3 and W6, but that's for Japanese fonts, so I ignored them.)


Second, I used ftxdumperfuser to change the subfamily name (only) in the Cabin faces according to this list, then I checked how Font Book picked up the representative face. The result was,


  1. Book
  2. Medium
  3. Regular
  4. Plain
  5. Roman


So 1–3 is exactly as you determined; 4 and 5 may seem alphabetical -- but if other faces are added, Plain or Roman are chosen before them.


Of course, that's not definitive, but I think it's enough to make a case.

Mar 7, 2012 7:28 AM in response to fane_j

(Sorry, Kurt, Normal isn't there. There's W3 and W6, but that's for Japanese fonts, so I ignored them.)

No, you won't see that in the font names listed in a font manager or app. As I noted, that's in internal designation. See below.


User uploaded file


Note that under Weight, the font is referred to as Normal. There's a bunch of choices under that menu, such as Bold, Italic, Thin, etc. The Menu Name and Full Name can say pretty much anything you want. If I wanted to call the the font Grunge Face Plain there, that's what would show up in your menus.

Mar 7, 2012 2:17 PM in response to Kurt Lang

Kurt Lang wrote:


you won't see that in the font names listed in a font manager or app.

I said, "I had a quick, rough peek at Font Book's code". So I'm talking about Font Book's code, not what may be listed by a font manager or may appear in a font table. The names I listed appear to have special meaning for the Font Book code, and the tests suggest why that is; "Normal" does not appear in the code, and Font Book does not appear to treat it in any special way (I tested it).

Mar 7, 2012 4:51 PM in response to Kurt Lang

Kurt Lang wrote:


Note that under Weight, the font is referred to as Normal.

This is a different issue from the OP's.


The problem is that I don't know either FontLab Studio (displayed in your screen shot) nor the TT/OT specs well enough to figure out to which table and to which entry FLS refers to when it says "weight". (It is certainly not id2 in the name table, because we've already dealt with that -- id2 must correspond to "Style Name" in the FLS dialogue.) Can you elucidate this?

Mar 7, 2012 5:24 PM in response to fane_j

Thank you, this is incredibly useful info about Font Book! The internet thanks you all!


I should mention I made a mistake in singling out the Font Subfamily field. With Cabin, it didn't change for me until I changed the #17 field (Windows preferred Subfamily) platform #3 (if I remember right from yesterday.) Mac isn't even supposed to look at that field, but for some reason Font Book gives it priority. That field isn't even present in many fonts, in which case I'm sure Font Book uses the #2 field.

Mar 7, 2012 5:44 PM in response to Kurt Lang

I wonder if "Normal" terminology might have come from the earlier days of font files before TT's elaborate name table, when the simple distinctions of Bold, Italic, Bold Italic, and normal/regular/plain was hard-coded in somewhere. Perhaps using the macStyle field? At any rate it doesn't seem to matter these days and "Normal" isn't a common'y used term when typeface weight ranges are designed.

Mar 7, 2012 9:14 PM in response to Community User

Clint1459 wrote:


Cabin, it didn't change for me until I changed the #17 field (Windows preferred Subfamily) platform #3 (if I remember right from yesterday.) Mac isn't even supposed to look at that field, but for some reason Font Book gives it priority. That field isn't even present in many fonts, in which case I'm sure Font Book uses the #2 field.

Cool. Just when I thought I had a grip on things, another wrinkle crops up.


The tables dumped by ftxdumperfuser do not contain any entry between id14 and id18. Either there aren't any, or fdf ignores them (id15 is reserved; id16 & id17 are Windows-only). I used Cabin fonts from Google, so the latter is probably the case.


The question then becomes, what happens when fdf fuses the modified table back into the font? Either it replaces the original table, or it merges the two tables. On one hand, the former is easier to implement; and the absence of the Windows-only entries would explain my not encountering the issue you described. On the other, it would be rather paradoxical for Font Book to give precedence to Windows-only entries. So it would be good if it were possible to make sure that the issue you came across was not caused by a bug in TTX.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Font Book picks the wrong weight for the family preview-how to fix?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.