Skip navigation.
 
mlQuestion on bitmap fonts
FROM : Tobia Conforto
DATE : Mon Mar 31 18:23:40 2008

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

Related mailsAuthorDate
mlQuestion on bitmap fonts Tobia Conforto Mar 31, 18:23
mlRe: Question on bitmap fonts Aki Inoue Mar 31, 20:18
mlRe: Question on bitmap fonts Tobia Conforto Apr 1, 11:24
mlRe: Question on bitmap fonts Tobia Conforto Apr 1, 18:48
mlRe: Question on bitmap fonts John Stiles Apr 1, 18:52
mlRe: Question on bitmap fonts Aki Inoue Apr 1, 18:53