Content deleted Content added
more detail |
MOS:HEADCAPS |
||
(30 intermediate revisions by 23 users not shown) | |||
Line 1:
{{Infobox file format
The '''Glyph Bitmap Distribution Format''' (BDF) by [[Adobe Systems|Adobe]] is a file format for storing [[bitmap font]]s. The content takes the form of a text file intended to be human- and computer-readable. BDF is typically used in [[Unix]] environments. It was eventually replaced by the [[Portable Compiled Format|PCF]] font format which was somewhat more efficient, and later by scalable fonts such as [[Opentype]].▼
| name = Glyph Bitmap Distribution Format
==Overview==▼
| extension = .bdf
| mime = application/x-font-bdf<ref name="P1">[https://mimetype.io/application/x-font-bdf .bdf] [[MIME]] type not [https://www.iana.org/assignments/media-types/media-types.xhtml#image registered] at [[Internet Assigned Numbers Authority|IANA]]</ref>
| owner = [[Adobe Inc.]]
| genre = [[Computer_font#Bitmap_font_formats|Bitmap font format]]
| released = {{start date and age|1987|df=yes}}
| latest_release_version = 2.2
| latest_release_date = {{start date and age|1993|03|22|df=yes}}
| open = yes
| url = [https://www.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5005.BDF_Spec.pdf Adobe Glyph Bitmap Distribution Format (BDF) Specification, version 2.2]
}}
{{Short description|File format for storing bitmap fonts}}
▲The '''Glyph Bitmap Distribution Format''' (BDF) by [[Adobe Systems|Adobe]] is a file format for storing [[bitmap font]]s. 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
▲==Overview==
In 1988, the [[X Window System#The MIT X Consortium and the X Consortium, Inc.|X Consortium]] adopted BDF 2.1 as a standard for X Window screen fonts,<ref>{{cite web|title=X Window System, Version 11, Release 3|url=http://www.x.org/wiki/X11R3/|website=X.Org Foundation|access-date=19 January 2016|date=October 1988}}</ref> but X Windows has largely moved to other font standards such as [[Portable Compiled Format|PCF]], [[OpenType|Opentype]], and [[TrueType|Truetype]].
Version 2.2 added support for non-Western writing.
A BDF font
#a global section that applies to all glyphs in a
#a section with a separate entry for each glyph; and
#the {{code|ENDFONT}} statement.
==Example==
This is an example font containing one glyph, for ASCII capital
{|
|-
STARTFONT 2.1▼
|
▲ <nowiki>STARTFONT 2.1
FONT -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1
SIZE 16 75 75
Line 30 ⟶ 45:
DWIDTH 8 0
BBX 8 16 0 -2
BITMAP
00
00
Line 48 ⟶ 63:
00
ENDCHAR
ENDFONT</nowiki>
|
<br /><br /><br /><br /><br />
{{Col-begin|class=mw-collapsible mw-collapsed}}
|+'''Decoded hexdraw representation of the example'''
|-
{{Col-2}}
{{sxhl|2=hexdump|
In the above example, the global declarations begin with the "STARTFONT" line and end with the "CHARS" line.▼
00 00000000 --------
"STARTFONT 2.1" defines the version of this BDF file as version 2.1.▼
00 00000000 --------
00 00000000 --------
00 00000000 --------
18 00011000 ---██---
24 00100100 --█--█--
24 00100100 --█--█--
42 01000010 -█----█-
42 01000010 -█----█-
7E 01111110 -██████-
42 01000010 -█----█-
42 01000010 -█----█-
42 01000010 -█----█-
42 01000010 -█----█-
00 00000000 --------
00 00000000 --------
.. ........ .248124.
}}
{{Col-end}}
|}
"FONT -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1" defines the font family and face names.▼
▲In the above example, the global declarations begin with the
"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, 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.▼
▲Lines beginning with the word
"ENCODING 65" declares the decimal code point for this glyph in the font.▼
▲Following the above global declarations, the following entries may repeat for each glyph.
▲
{{code|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 Metrics|Adobe Font Metric]] (AFM) file. The number of pixels calculated as {{math|''Pixels'' {{=}} {{sfrac|''Scalable Width''|1000}} * {{sfrac|''Resolution''|72}}}}, where
The
The
==Version 2.2
Version 2.2 of the BDF specification adds support for non-Western fonts.
{{code|METRICSET
{{code|SWIDTH1
{{code|VVECTOR}} defines an X-axis offset and a Y-axis offset to transition from a mode 0 glyph to a mode 1 glyph.
This scheme easily accommodates two writing directions.
In addition to keywords added for international support, version 2.2 adds the
For more detailed information, consult the version 2.2 specification.
==X Window
X Window font utilities support several properties that can be specified in the {{code|STARTPROPERTIES}} section of a BDF file.<ref>{{cite book|
* {{code|CAP_HEIGHT}} (integer)
* {{code|COPYRIGHT}} (string)<ref name="strings">A ISO 8859-
* {{code|DEFAULT_CHAR}}
* {{code|FACE_NAME}} (string<ref
* {{code|FONT}} (string)<ref
* {{code|FONT_ASCENT}} (integer)
* {{code|FONT_DESCENT}} (integer)
* {{code|FONT_VERSION}} (string)<ref
* {{code|FOUNDRY}} (string)<ref name="strings" /> The name of the foundry.
* {{code|FAMILY_NAME}} (string)<ref
* {{code|NOTICE}} (string)<ref
* {{code|POINT_SIZE}} (integer
* {{code|RESOLUTION_X}}
* {{code|RESOLUTION_Y}}
* {{code|SLANT}} (string)<ref
* {{code|WEIGHT_NAME}} (string)<ref
* {{code|X_HEIGHT}} (integer)
==Notes==
Line 135 ⟶ 175:
==References==
{{refbegin}}
* {{cite book|others= The [[Unicode Consortium]] |title= The Unicode Standard, Version 5.0
{{refend}}
==External links==
* [
[[Category:Font formats]]
[[Category:X Window System]]
|