Tobia,

It appears that this is the intended behavior.

The font contains glyphs that extend beyond the ascender line (the accented glyphs) and Cocoa automatically adjusts the default line height accordingly to avoid baseline shifts.

So, basically the system, tools you're using to convert the font, and the font itself are all working as designed.

Aki

On 2008/03/31, at 9:23, Tobia Conforto wrote:

Hello

After 1000 messages to this list and no reply, I'm resubmitting my question about bitmap fonts, hoping to get any bit of help or any pointer at all (docs, other mailing lists, etc.)

Basically, I would like to know what are the best practices and recommended programs for preparing bitmap fonts for use in Cocoa applications. I'm also reporting what is probably a bug in either OS X or the available font editors.

If there is a list better suited to this question, please point me to it.


I'm trying to convert the well known X11 fixed unicode fonts to a format usable in Cocoa text editors and terminal programs. These fonts are available under a free license on Markus Kuhn's website: http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html and are provided in source BDF format.

I tried using the free editor Fontforge to convert 9x18.bdf into a so-called (by Fontforge) "Apple bitmap-only .dfont" format. Mostly it works, but I've run into a problem that Fontforge's programmers can't solve. See this thread on their list:
http://www.nabble.com/BDF-to-Apple-bitmap-only-dfont,-wrong-line-height-td15155775.html

The problem is that the generated dfont is rendered by OS X with 4px of additional ascent (or line-height) and we can't figure out where it comes from. If I convert only the ASCII subset of the original Unicode font, the line-height is correct. As soon as I add more than a couple of non-ASCII characters, the 4px bug comes out.

I tried doing the same conversion using a trial version of the commercial BitFonter 3.0 editor ($500) and I got the same results as with Fontforge.

I looked into the .dfont file with a hex editor, using this manual as a reference http://developer.apple.com/textfonts/TTRefMan/ but I couldn't find anything out of place.

Here is a zip http://gruppo4.com/~tobia/osx-font-problem.zip where I've put two OS X dfont files I created from 9x18.bdf, using Fontforge, plus a text file with the font tables I extracted using the hex editor. In "test3" I converted the full Latin 1 charset (Unicode points < 256) and it shows the 4px bug; in "test7" I deleted all glyphs other than ASCII and a couple of Latin 1 accented letters, and it displays correctly in all Cocoa apps.

What am I doing wrong? What's different in the two files? Can you replicate this bug? Is this a bug in OS X, a weird setting in the original BDF, or a bug shared between Fontforge and BitFonter?

Can you think of any workaround or alternative program I could try?


Tobia
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to