| Microsoft Typography | Developer information | Tools | Making TrueType bitmap fonts | |||
|
This document outlines the steps required to make a TrueType font that only includes bitmap data.
The advance widths of the glyphs, that the bitmaps will reside in, should scale to ~ the same advance width as the bitmaps. The reason this is a requirement is that text engines use outline metrics to do page layout. Once the bitmap is laid down, the text engine needs to redraw the window when changes are made and uses these metrics to calculate where to put the bits. If these numbers are off then the cursor will be in illogical positions and odd displays happen. I created an outline font with one glyph (a bullet) and made glyphs for all my bitmaps in the .ttf. I made composites of the bullet to the glyphs. I did not have an outline font for this bitmap. So I had to calculate the metrics for the 2048 units per em Advance widths. To do this you divide 2048 by the ppem size then multiple by the bitmaps advance width. Example if at 13ppem the lower case 'a' is 7pixels width then 2048/13=157.53 157.53*7=1102.7 so an advance width of 1103 would be 7pixels wide at 13ppem. For multiple sizes if the font scales logically and linearly there should be no problem with finding an advance width that creates the correct pixel widths at the sizes. If the bitmaps don't scale linearly then you need to do an average and find the best width. After all the glyphs are on advance widths that will match the bitmaps:
With embedded bitmaps, the vertical metrics are also obtained from the .tff. In a .ttf the values in the 'OS/2' table WinAscent and WinDescent control the vertical font heights. If the metrics are not set properly (as they were with my test font output through Mac fog) then the newest TrueEdit (Mac) can edit these values. They should be calculated from the tallest and lowest characters of the set in either the outlines or the bitmaps. In my case I have only bitmaps so I need to use the largest bitmap size and use the same calculation as doing horizontal escapements. If the metrics are short the bitmaps get clipped. This was the case when I used a bullet as my outline glyph in all characters.
This font should appear without fail in the menus of all apps and show bullets when a bitmaps is not present or bitmaps at sizes that there are images for. It will print bullets.
|
|||
| Microsoft Typography | Developer information | Tools | Making TrueType bitmap fonts | |||