On Apr 9, 7:35 pm, Seiji Zenitani <[EMAIL PROTECTED]> wrote: > On Tiger, only "Italic" "Bold" "Regular" "Bold-italic" seems to work. > If you select the other style (e.g. "UltraLight"), > emacs automatically employ "Regular", but not at random.
Finally got so sick of having to disable/enable a font every time I started Emacs that I figured it out. The problem is mentioned at line 6908 of macterm.c (in fm_get_style_from_font): /* FMGetFontFamilyInstanceFromFont returns `normal' as the style of some font (e.g., Optima) even if it is `bold'. */ In my case, both Screen Bold and Screen Medium returned as "normal" so Emacs picked the first one, which happened to be bold. I was able to fix the problem by modifying the font. Apple's TrueType documentation (http://developer.apple.com/textfonts/TTRefMan/RM06/ Chap6head.html) states: "TrueType fonts which have no outline data but consist of bitmaps only should not have a 'head' table. They should use the byte-by-byte identical 'bhed' table instead." But when I had only a 'bhed' table the font was not considered bold. If I copied the 'bhed' table to a 'head' table it worked, even though the font was bitmap-only. I have filed a bug with Apple regarding FMGetFontFamilyInstanceFromFont but it is deprecated - who knows if it will be fixed. I guess Emacs should use a different method (ATS* or CoreText under 10.5) if it wants to avoid this bug - I've not seen any other applications that exhibit this behavior. For future reference, I used TTX (http://www.letterror.com/code/ttx/) to modify the font. Some alternatives did not work - the tool I used originally to generate the font (FontForge) would no longer export a usable font and Apple's ftxdumperfuser would not get past the 'OS/2' table. --Nicholas --~--~---------~--~----~------------~-------~--~----~ Carbon Emacs User Group http://groups.google.com/group/carbon-emacs?hl=en -~----------~----~----~----~------~----~------~--~---