View Single Post
Old 03-29-2008, 07:16 PM   #1
IceHand
Linux User
IceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavens
 
IceHand's Avatar
 
Posts: 323
Karma: 13682
Join Date: Aug 2007
Location: Germany
Device: Kindle 3
How to change the line spacing of a font

The line spacing on the Cybook is determined by the currently used font's metrics. The following how-to was made by trial-and-error, as I don't have much knowledge about font metrics.
In the examples I'm going to show, I used the free font Bitstream Vera Sans (Vera.ttf).

First download and install FontForge.
Start FontForge and open the font you want to edit. You should see something that looks like this:


Click on "Element" then "Font Info..." or press Ctrl+Shift+F.
Now select "OS/2" on the left side of the Font Information and then the "Metrics" tab on the right side.

Set all numbers to zero in the metrics fields, but don't uncheck the "Is Offset" boxes.

Now comes the tricky part: Depending on the font you'll need to experiment a little to get the line spacing right.
"HHead Ascent Offset" should be a negative number in most cases around -100 to -200 (the lower the value the smaller the line spacing).
"HHead Descent Offset" should be a positive number in most cases around 100 to 200 (the higher the value the smaller the line spacing).
You can make an educated guess by looking at the character size, Vera Sans for example is very large and needs some line spacing. I think HHead Ascent Offset -100 and HHead Descent Offset 100 look nice:

Most Serif fonts have smaller characters and would probably need something like -200 and 200.

Now click OK and select "File" -> "Generate Fonts...". The font type should be TrueType or OpenType (CFF), both formats will work fine on the Cybook.
Click "Save" and ignore any error messages or uncheck "Validate Before Saving" before saving.


Copy the saved font to the Cybook and check if the line spacing looks right now. If not, try other values for "HHead Ascent Offset" and/or "HHead Descent Offset".
When the line spacing is looking good, remember the values for "HHead Ascent Offset" and "HHead Descent Offset" and repeat the procedure described above with the Italic, Bold and Bold-Italic version of the font.
IceHand is offline   Reply With Quote