Bitmap Distribution Format (BDF) is an Adobe -created file format for storing bitmap fonts. The contents of the file are presented in text form, readable for both a person and a computer. Typically, BDF is used in UNIX environments.
Content
- 1 Introduction
- 2 Keywords
- 3 Example
- 4 Literature
- 5 Links
Introduction
The latest version of the format is 2.2. No new versions are expected.
The X Windows Consortium has adopted BDF 2.1 as the font standard for the X Windows system , but is now moving toward other standards.
The BDF file contains 3 sections:
- Global section applied to all font glyphs
- Glyph Section
- ENDFONT instruction
Keywords
| Keywords and options | Description |
|---|---|
| STARTFONT number | Specifies the version of the BDF file. number - version (for example 2.1 ). |
| COMMENT string | Comment line More than one comment is allowed. Such lines will be ignored by the file handler. |
| CONTENTVERSION integer | Optional keyword, sets the font version. |
| Font string | Specifies the font name |
| SIZE PointSize Xres Yres | |
| FONTBOUNDINGBOX FBBx FBBy Xoff Yoff | FBBx , FBBy - font width and height, respectively. Xoff , Yoff - offset of the lower left corner of the font along the X and Y axis, respectively, relative to the origin. |
| METRICSSET integer | |
| STARTPROPERTIES n | The optional keyword sets the top of the property list. Each property has a row. Total n lines. |
| ENDPROPERTIES | The optional keyword sets the end of the property list. Used in conjunction with STARTPROPERTIES. |
| Char nglyphs | nglyphs - number of glyphs in the glyph section |
| STARTCHAR string | string - glyph name |
| ENCODING integer (integer) | Code and alternate glyph code (in brackets) |
| SWIDTH swx0 swy0 | |
| DWIDTH dwx0 dwy0 | |
| SWIDTH1 swx1 swy1 | |
| DWIDTH1 dwx1 dwy1 | |
| VVECTOR xoff yoff | |
| BBX BBw BBh BBxoff0x BByoff0y | Pixel size and glyph position BBw - Glyph Width BBh - glyph height BBxoff0x and BByoff0y - offset of the lower left corner of the glyph along the X and Y axis, respectively, from the origin |
| BITMAP <hex data> | Bitmap |
| Endchar | End glyph description |
| Endfont | Font Description End |
Example
This sample font contains one glyph - the ASCII capital letter "A". Symbol taken from GNU Unifont .
STARTFONT 2.1 FONT -gnu-unifont-medium-r-normal - 16-160-75-75-c-80-iso10646-1 SIZE 16 75 75 FONTBOUNDINGBOX 16 16 0 -2 STARTPROPERTIES 2 FONT_ASCENT 14 FONT_DESCENT 2 ENDPROPERTIES CHARS 1 STARTCHAR U + 0041 ENCODING 65 SWIDTH 500 0 DWIDTH 8 0 BBX 8 16 0 -2 Bitmap 00 00 00 00 eighteen 24 24 42 42 7E 42 42 42 42 00 00 Endchar Endfont
Literature
- Haralambous, Y. and Horne, PS Fonts & Encodings. - O'Reilly Media, 2007 .-- P. 606-609. - 1016 p. - ISBN 9780596102425 .
- Murray, JD and VanRyper, W. Encyclopedia of graphics file formats. - O'Reilly & Associates, 1996 .-- P. 310-1314. - 1116 p. - ISBN 9781565921610 .