| 1 |
Extensions to Adobe's BDF [#c1]_ for greymap fonts |
| 2 |
================================================== |
| 3 |
|
| 4 |
Adobe has defined a file format for distributing bitmap fonts called BDF. |
| 5 |
MicroSoft extended this format to support greymap (anti-aliased, each pixel |
| 6 |
representing various levels of grey rather than just black/white) fonts. |
| 7 |
Recently others have started using this same format |
| 8 |
(`gbdfed <http://math.nmsu.edu/~mleisher/Software/gbdfed/>`_, |
| 9 |
`freetype <http://freetype.sf.net/>`_ and :doc:`fontforge </index>`). |
| 10 |
|
| 11 |
In Section 3.1 of the format description Adobe defines a "SIZE" keyword. |
| 12 |
MicroSoft has added an optional fourth parameter to this keyword |
| 13 |
|
| 14 |
.. parsed-literal:: |
| 15 |
|
| 16 |
SIZE *PointSize XRes YRes [Bits_Per_Pixel]* |
| 17 |
|
| 18 |
This fourth parameter may take the values 1, 2, 4 and 8. If omitted it is |
| 19 |
assumed to be 1. (FontForge will also read in fonts with values of 16 and 32, |
| 20 |
but it will simply ignore any low order data and only retain the high order |
| 21 |
byte). |
| 22 |
|
| 23 |
FontForge will also include a font property |
| 24 |
|
| 25 |
.. parsed-literal:: |
| 26 |
|
| 27 |
BITS_PER_PIXEL *Value* |
| 28 |
|
| 29 |
in all greymap fonts it generates. |
| 30 |
|
| 31 |
FontForge will also mark all such fonts as version 2.3 of the bdf standard :: |
| 32 |
|
| 33 |
STARTFONT 2.3 |
| 34 |
|
| 35 |
The bitmap data are stored with 8, 4, 2 or 1 pixels packed into a byte depending |
| 36 |
on whether BITS_PER_PIXEL is 1, 2, 4 or 8. As in Adobe's spec all data are |
| 37 |
presented in hex and an even number of nibbles must be present. |
| 38 |
|
| 39 |
**Example:** |
| 40 |
|
| 41 |
:: |
| 42 |
|
| 43 |
BITMAP |
| 44 |
C8 |
| 45 |
ENDCHAR |
| 46 |
|
| 47 |
Would represent the pixel sequences |
| 48 |
|
| 49 |
.. list-table:: |
| 50 |
:header-rows: 1 |
| 51 |
:stub-columns: 1 |
| 52 |
|
| 53 |
* - Bits/Pixel |
| 54 |
- Pixels |
| 55 |
* - 1 |
| 56 |
- 1,1,0,0,1,0,0,0 |
| 57 |
* - 2 |
| 58 |
- 3,0,2,0 |
| 59 |
* - 4 |
| 60 |
- C,8 |
| 61 |
* - 8 |
| 62 |
- C8 |
| 63 |
|
| 64 |
.. rubric:: Footnotes |
| 65 |
|
| 66 |
.. [#c1] http://partners.adobe.com/asn/developer/PDFS/TN/5005.BDF_Spec.pdf |