Glyph Bitmap Distribution Format

Last updated
Glyph Bitmap Distribution Format
Filename extension
.bdf
Internet media type
application/x-font-bdf [1]
Developed by Adobe Inc.
Initial release1987;36 years ago (1987)
Latest release
2.2
22 March 1993;30 years ago (1993-03-22)
Type of format Bitmap font format
Open format?yes
Website Adobe Glyph Bitmap Distribution Format (BDF) Specification, version 2.2

The Glyph Bitmap Distribution Format (BDF) by Adobe is a file format for storing bitmap fonts. The content takes the form of a text file intended to be human- and computer-readable. BDF is typically used in Unix X Window environments. It has largely been replaced by the PCF font format which is somewhat more efficient, and by scalable fonts such as OpenType and TrueType fonts.

Contents

Overview

In 1988, the X Consortium adopted BDF 2.1 as a standard for X Window screen fonts, [2] but X Windows has largely moved to other font standards such as PCF, Opentype, and Truetype.

Version 2.2 added support for non-Western writing. For example, glyphs in a BDF 2.2 font definition can specify rendering from top-to-bottom rather than simply left-to-right.

A BDF font file contains three sections:

  1. a global section that applies to all glyphs in a font;
  2. a section with a separate entry for each glyph; and
  3. the ENDFONT statement.

Example

This is an example font containing one glyph, for ASCII capital “A”. This glyph is taken from the 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 18 24 24 42 42 7E 42 42 42 42 00 00 ENDCHAR ENDFONT

In the above example, the global declarations begin with the STARTFONT line and end with the CHARS line.

STARTFONT 2.1 defines the version of this BDF file as version 2.1.

FONT -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1 defines the font family and face names as an X logical font description.

SIZE 16 75 75 defines this to be a 16 point font, with an X-axis resolution of 75 dots per inch (dpi) and a Y-axis resolution of 75 dpi. This is the norm under X Window.

FONTBOUNDINGBOX 16 16 0 -2 defines a bounding box for the font of 16 pixels wide by 16 pixels high, with the lower left-hand corner starting at x = 0 and y = -2. Note that although the bounding box is defined to be a 16 by 16 cell, this can be overridden for individual glyphs. The “A” glyph, for example, is only 8 pixels wide.

STARTPROPERTIES 2 declares that two special properties will follow. STARTPROPERTIES is optional in the BDF specification. X Window allows the properties FONT_ASCENT and FONT_DESCENT to show the height above and below the baseline, respectively, for all glyphs. FONT_ASCENT 14 declares that 14 of the 16 pixels in height are above the baseline. FONT_DESCENT 2 declares that 2 of the 16 pixels in height are below the baseline. ENDPROPERTIES appears at the end of the STARTPROPERTIES section.

CHARS 1 declares that one character will follow. Although Adobe now refers to this file format as the Glyph BDF, they have retained the keyword CHARS in the final version of the specification.

Lines beginning with the word COMMENT can be inserted within a BDF file. Anything following the COMMENT keyword on a line is ignored.

Following the above global declarations, the following entries may repeat for each glyph.

STARTCHAR U+0041 specifies the start of a character in version 2.1 and earlier, or of a glyph in version 2.2. The string name of this particular character is U+0041, expressing in the Unicode convention the code point hexadecimal 41 (decimal 65, the ASCII character “A”). In version 2.1 and earlier, the character name string was limited to 14 characters. In version 2.2, the glyph name string can contain up to 65,535 characters.

ENCODING 65 declares the decimal code point for this glyph in the font.

SWIDTH 500 0 declares the scalable width of 500 on the X-axis and 0 (by default) on the Y-axis. This will result in an X-axis offset to the next glyph, but no Y-axis offset to the next glyph (i.e., the glyphs appear straight across in a line). The scalable width is 1000 times the actual point size of the character—the same unit used in an Adobe Font Metric (AFM) file. The number of pixels calculated as Pixels = Scalable Width/1000 * Resolution/72, where Scalable Width is 500 in this example, and resolution is 75 dpi for this font. Because 75 is approximately equal to 72, the number of pixels is the full width of a glyph (defined globally as 16 pixels) times 500/1000, or in other words the width of this glyph is 8 pixels.

DWIDTH 8 0 declares the device width of a glyph. In this case, after the glyph is rendered, the start of the next glyph is offset 8 pixels on the X-axis and 0 pixels on the Y-axis from the current glyph origin. Note that the device width is not necessarily equal to the width of the glyph. It is simply the offset on the X-axis to move the current point to the start of the next glyph.

The scalable width is used to calculate the width of a high-resolution glyph on a printer, whereas the device width is used to calculate the width of a glyph on a display device. Thus the scalable width is specified to greater precision than the device width.

BBX 8 16 0 -2 declares a bounding box that is 8 pixels wide and 16 pixels tall. The lower left-hand corner of the character is offset by 0 pixels on the X-axis and -2 pixels on the Y-axis.

BITMAP begins the bitmap for the current glyph. This line must be followed by one line per pixel on the Y-axis. In this example the glyph is 16 pixels tall, so 16 lines follow. Each line contains the hexadecimal representation of pixels in a row. A “1” bit indicates a rendered pixel. Each line is rounded to an 8 bit (one byte) boundary, padded with zeroes on the right. In this example, the glyph is exactly 8 pixels wide, and so occupies exactly 8 bits (one byte) per line so that there is no padding. The most significant bit of a line of raster data represents the leftmost pixel.

ENDCHAR ends the current glyph.

The declarations STARTCHAR through ENDCHAR are repeated for each glyph in a font.

ENDFONT appears as the last line in the file, after all glyphs in the font have been enumerated.

Version 2.2 Extensions

Version 2.2 of the BDF specification adds support for non-Western fonts. These additions allow moving the origin by a positive or negative movement on the X and Y axes. This not only accommodates right-to-left writing direction, but even top-to-bottom (for example, for Chinese). The following values provide multinational-font support:

METRICSET is set to 0 for writing direction 0, 1 for writing direction 1, or 2 (in the initial global area) for both writing directions within the same font. Traditional Western left-to-right scripts use METRICSET 0.

SWIDTH1 and DWIDTH1 have the same parameters as SWIDTH and DWIDTH, respectively. DWIDTH1 must be present for a METRICSET 1 glyph. Its offsets can be positive or negative.

VVECTOR defines an X-axis offset and a Y-axis offset to transition from a mode 0 glyph to a mode 1 glyph. An opposite offset is applied during a mode 1 to mode 0 glyph transition.

This scheme easily accommodates two writing directions. Historically, fonts had 128 or 256 code points. Today, Unicode allows for over one million code points. Fonts can conceivably contain thousands of glyphs, some of which should be written left-to-right, some right-to-left, and some top-to-bottom. Such multi-directional writing requires creative use of DWIDTH1 and SWIDTH1 for each glyph.

In addition to keywords added for international support, version 2.2 adds the CONTENTVERSION declaration. This keyword is followed by an integer to indicate the version number of the font.

For more detailed information, consult the version 2.2 specification.

X Window Properties

X Window font utilities support several properties that can be specified in the STARTPROPERTIES section of a BDF file. [3] A generic BDF file is in ASCII encoding. X Window properties are specified using ISO 8859-1 encoding, which is an extension of ASCII. These properties include:

Notes

  1. .bdf MIME type not registered at IANA
  2. "X Window System, Version 11, Release 3". X.Org Foundation. October 1988. Retrieved 19 January 2016.
  3. Flowers, Jim (1994) [1988]. "3.2 Font Properties". X Logical Font Description Conventions (Version 1.5 ed.). X Consortium, Inc. p. 13. Archived from the original on 2013-03-31. Retrieved 2009-01-08.
  4. 1 2 3 4 5 6 7 8 9 A ISO 8859-1 character string.

Related Research Articles

TrueType is an outline font standard developed by Apple in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript. It has become the most common format for fonts on the classic Mac OS, macOS, and Microsoft Windows operating systems.

Metafont is a description language used to define raster fonts. It is also the name of the interpreter that executes Metafont code, generating the bitmap fonts that can be embedded into e.g. PostScript. Metafont was devised by Donald Knuth as a companion to his TeX typesetting system.

<span class="mw-page-title-main">Typeface</span> Set of characters that share common design features

A typeface is a design of letters, numbers and other symbols, to be used in printing or for electronic display. Most typefaces include variations in size, weight, slope, width, and so on. Each of these variations of the typeface is a font.

OpenType is a format for scalable computer fonts. Derived from TrueType, it retains TrueType's basic structure but adds many intricate data structures for describing typographic behavior. OpenType is a registered trademark of Microsoft Corporation.

<span class="mw-page-title-main">Arial</span> Neo-grotesque sans-serif typeface

Arial is a sans-serif typeface and set of computer fonts in the neo-grotesque style. Fonts from the Arial family are included with all versions of Microsoft Windows after Windows 3.1, as well as in other Microsoft programs, Apple's macOS, and many PostScript 3 printers.

The BMP file format or bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device, especially on Microsoft Windows and OS/2 operating systems.

<span class="mw-page-title-main">Dots per inch</span> Measure of dot density

Dots per inch is a measure of spatial printing, video or image scanner dot density, in particular the number of individual dots that can be placed in a line within the span of 1 inch (2.54 cm). Similarly, dots per centimetre refers to the number of individual dots that can be placed within a line of 1 centimetre (0.394 in).

A computer font is implemented as a digital data file containing a set of graphically related glyphs. A computer font is designed and created using a font editor. A computer font specifically designed for the computer screen, and not for printing, is a screen font.

<span class="mw-page-title-main">Open-source Unicode typefaces</span>

There are Unicode typefaces which are open-source and designed to contain glyphs of all Unicode characters, or at least a broad selection of Unicode scripts. There are also numerous projects aimed at providing only a certain script, such as the Arabeyes Arabic font. The advantage of targeting only some scripts with a font was that certain Unicode characters should be rendered differently depending on which language they are used in, and that a font that only includes the characters a certain user needs will be much smaller in file size compared to one with many glyphs. Unicode fonts in modern formats such as OpenType can in theory cover multiple languages by including multiple glyphs per character, though very few actually cover more than one language's forms of the unified Han characters.

TeX font metric (TFM) is a font file format used by the TeX typesetting system. It is a font metric format, not an outline font format like TrueType, because it provides only the information necessary to typeset the font such as each character's width, height and depth. The actual glyphs are stored elsewhere. This is not unique to TeX; Adobe's AFM files and Windows' PFM files use the same technique.

<span class="mw-page-title-main">Fixed (typeface)</span> Typeface

misc-fixed is a collection of monospace bitmap fonts that is distributed with the X Window System. It is a set of independent bitmap fonts which—apart from all being sans-serif fonts—cannot be described as belonging to a single font family. The misc-fixed fonts were the first fonts available for the X Window System. Their individual origin is not attributed, but it is likely that many of them were created in the early or mid 1980s as part of MIT's Project Athena, or at its industrial partner, DEC. The misc-fixed fonts are in the public domain.

Windows Presentation Foundation (WPF) is a free and open-source graphical subsystem originally developed by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX and attempts to provide a consistent programming model for building applications. It separates the user interface from business logic, and resembles similar XML-oriented object models, such as those implemented in XUL and SVG.

A fallback font is a reserve typeface containing symbols for as many Unicode characters as possible. When a display system encounters a character that is not part of the repertoire of any of the other available fonts, a symbol from a fallback font is used instead. Typically, a fallback font will contain symbols representative of the various types of Unicode characters.

Meiryo is a Japanese sans-serif gothic typeface. Microsoft bundled Meiryo with Office Mac 2008 as part of the standard install, and it replaces MS Gothic as the default system font on Japanese systems beginning with Windows Vista.

Block Elements is a Unicode block containing square block symbols of various fill and shading. Used along with block elements are box-drawing characters, shade characters, and terminal graphic characters. These can be used for filling regions of the screen and portraying drop shadows. Its block name in Unicode 1.0 was Blocks.

Apple's Macintosh computer supports a wide variety of fonts. This support was one of the features that initially distinguished it from other systems.

Kochi (東風フォント) was a font development project to build free replacements of proprietary fonts such as MS Gothic or MS Mincho, developed by Yasuyuki Furukawa. The project consisted of the Kochi Gothic and Kochi Mincho fonts. It was released in the public domain.

<span class="mw-page-title-main">Panorama (typesetting software)</span>

Panorama is a line layout and text composition engine to render text in various worldwide languages made by Bitstream Inc. Panorama uses Font Fusion as the base to support rendering of the text. The engine allows the user to manage different text formatting aspects like spacing, alignment, style effects.

<span class="mw-page-title-main">GNU Unifont</span> Duospaced bitmap font

GNU Unifont is a free Unicode bitmap font created by Roman Czyborra. The main Unifont covers all of the Basic Multilingual Plane (BMP). The "upper" companion covers significant parts of the Supplementary Multilingual Plane (SMP). The "Unifont JP" companion contains Japanese kanji present in the JIS X 0213 character set.

<span class="mw-page-title-main">WenQuanYi</span>

WenQuanYi is an open-source project of Chinese computer fonts licensed under GNU General Public License.

References