Cocoa, spacing issues

Frode Bo Helland's picture

[Couldn’t add images for some reason, so they are attached to the post]

I got these screenshots from a developer using my one of my fonts developing an application in Cocoa. This is a TrueType font, hinted in the y-direction. (Prob not hinting related, since this is on a Mac). The kerning is class based. I wonder if it should be flattened for a TT file, but in any case missing kerning is clearly not the issue. The strange spacing gaps are not in the font file, and I haven’t seen them in any other application. The gaps kick in and out until 17 pt size, when everything goes back to normal. They also differ in intensity with various alignments (left, right or centered text). I’m generating the font from Fontlab.

Any idea what might cause this?

AttachmentSize
test.png7.89 KB
test2.png6.53 KB
test3.png7.09 KB
Frode Bo Helland's picture

Some more details: This is in Xcode, on a Mac, in a “UILabel”. I’m sorry -- not accustomed to this software myself.

kingofcapearcona's picture

Hi Frank,

I have the same problem on OS X and it seems it’s not related to a special typeface. I found this bug(?) some month ago, during writing a text in an App, where the System is "responsible" for kerning/spacing.

Try out the preinstalled GillSans at 15 or 16 Point and 17 Point in TextEdit with the word "Total" for example, and you will see, that the "To" in 15 or 16 Point isn’t kerned correctly (to much space between).

I think the problem is present in Snow Leopard and Lion (10.7.5.). Not sure how it is in Mountain Lion.
Anyone?

-Thomas

Frode Bo Helland's picture

Some fonts seem to tackle it perfectly, so it’d be nice to figure out what they do different. Or, in any case, narrow it down to what causes the problem. My font works just fine in Textedit.

Grzegorz Rolek's picture

I’ve encountered this problem with a custom TrueType font having a state machine kerning table exclusively, so it’s not about kerning data format, apparently. In my particular case, no kerning gets applied at all until 17 points, system-wide.

oldnick's picture

Prob not hinting related, since this is on a Mac

Why would you assume this? Apple has managed to screw up its font handling at least twice since the release of OS X, if I am not mistaken. Apple’s core mission (pun intended) now appears to be the production of boutique consumer electronics; Macs are no longer effective professional design tools, IMHO…

http://www.typophile.com/node/96562

Karl Stange's picture

Something in this Cocoa Text Architecture guide might help. It looks like there are a lot of variables that could lead to strange behaviour in basic font structures.

Have you tried creating a native Mac TrueType version to test?

DTY's picture

Is this just within the XCode environment itself, or does the problem still exist when the program is compiled for use? Assuming the latter, UILabel doesn't use Core Text for layout, for the sake of speed, so I don't think it uses any kerning at all (regardless of whether flat or OT), but as you say, this doesn't explain the odd spacing. The UILabel class defaults to 17pt system font, so this may be one clue. But I don't have any clever ideas about why your font is working differently from the system fonts in this situation.

Frode Bo Helland's picture

How do I create a native Mac TrueType file?

Frode Bo Helland's picture

The issue is still apparent when the program is compiled.

Karl Stange's picture

How do I create a native Mac TrueType file?

FontForge has the most robust interface in terms of options for generating Mac TrueType formatted fonts. I do not have a great deal of experience in doing this and no experience with AAT, but I have managed to resolve system level complications (in the deep, distant past) by converting a font to the Mac .dfont TrueType format. If you do not have FontForge up and running I would be happy to run the basic conversion for you but note that it would be just that, with no AAT bells and whistles.

oldnick's picture

Fontographer 4.1x for Mac can also create a native Mac TrueType file. Since I no longer own a Mac, I would be happy to sell you my copy, complete with box and instructions, for a nominal fee…

Karl Stange's picture

FontLab can output them as well, but with (in my experience) less control over options and no support for AAT.

oldnick's picture

@sellyjasi smells suspiciously of spam…

Syndicate content Syndicate content