Knowledge

Glyph Bitmap Distribution Format

Source 📝

541:
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.
463:
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
495:
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
230:
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
446:
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
369:
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
464:
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.
450:
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.
356:
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.
502:
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
422:
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
457:
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.
538:
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.
695:(string) “R” is roman, “I” is italic, “O” is oblique, “RI” is reverse italic, “RO” is reverse oblique, “OT” is other, and a number indicates polymorphic slant capability. 284:. 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. 264:
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.
348:
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
324:
declares that one character will follow. Although Adobe now refers to this file format as the Glyph BDF, they have retained the keyword
778: 175: 856: 739: 178:
adopted BDF 2.1 as a standard for X Window screen fonts, but X Windows has largely moved to other font standards such as
270:
defines a bounding box for the font of 16 pixels wide by 16 pixels high, with the lower left-hand corner starting at
147:. The content takes the form of a text file intended to be human- and computer-readable. BDF is typically used in 887: 124: 74: 197:
in a BDF 2.2 font definition can specify rendering from top-to-bottom rather than simply left-to-right.
872: 735: 701:(string) The weight of this font (“Bold” and “Normal” are typical, though there is no set enumeration). 255: 822: 907: 179: 155: 223:
This is an example font containing one glyph, for ASCII capital “A”. This glyph is taken from the
101: 557:
declaration. This keyword is followed by an integer to indicate the version number of the font.
902: 622: 342:
Following the above global declarations, the following entries may repeat for each glyph.
8: 487:
appears as the last line in the file, after all glyphs in the font have been enumerated.
784: 866: 844: 666: 371: 22: 852: 603:(unsigned integer) The default character (glyph) to display for an undefined glyph. 109: 674: 670: 568:
X Window font utilities support several properties that can be specified in the
848: 577: 447:
offset on the X-axis to move the current point to the start of the next glyph.
302:
to show the height above and below the baseline, respectively, for all glyphs.
553:
In addition to keywords added for international support, version 2.2 adds the
896: 728: 140: 158:
font format which is somewhat more efficient, and by scalable fonts such as
224: 144: 888:
Adobe Glyph Bitmap Distribution Format (BDF) Specification, version 2.2
588: 125:
Adobe Glyph Bitmap Distribution Format (BDF) Specification, version 2.2
49: 34: 560:
For more detailed information, consult the version 2.2 specification.
783:(Version 1.5 ed.). X Consortium, Inc. p. 13. Archived from 632: 294:
is optional in the BDF specification. X Window allows the properties
580:
encoding, which is an extension of ASCII. These properties include:
306:
declares that 14 of the 16 pixels in height are above the baseline.
708: 310:
declares that 2 of the 16 pixels in height are below the baseline.
187: 183: 163: 159: 151: 707:(integer) The height above the baseline of a lower-case “x” (See 587:(integer) The height above the baseline of a capital letter (See 353: 193:
Version 2.2 added support for non-Western writing. For example,
252:
FONT -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1
677:= round(POINT_SIZE/20), and THINspace = round(POINT_SIZE/30). 573: 234:
In the above example, the global declarations begin with the
194: 363:
declares the decimal code point for this glyph in the font.
731: 148: 751: 335:
can be inserted within a BDF file. Anything following the
440:, or in other words the width of this glyph is 8 pixels. 542:
Such multi-directional writing requires creative use of
204:
a global section that applies to all glyphs in a font;
248:
defines the version of this BDF file as version 2.1.
207:
a section with a separate entry for each glyph; and
576:encoding. X Window properties are specified using 290:declares that two special properties will follow. 154:environments. It has largely been replaced by the 635:below the baseline, for line spacing calculation. 894: 572:section of a BDF file. A generic BDF file is in 532:glyph. Its offsets can be positive or negative. 374:(AFM) file. The number of pixels calculated as 777:Flowers, Jim (1994) . "3.2 Font Properties". 254:defines the font family and face names as an 609:(string) The name of the face for this font. 328:in the final version of the specification. 817: 815: 813: 811: 809: 807: 805: 803: 801: 490: 200:A BDF font file contains three sections: 752:"X Window System, Version 11, Release 3" 776: 615:(string) The X Window name of the font. 481:are repeated for each glyph in a font. 895: 798: 780:X Logical Font Description Conventions 563: 669:. If it is not separately specified, 496:provide multinational-font support: 132:File format for storing bitmap fonts 370:character—the same unit used in an 13: 14: 919: 881: 841:The Unicode Standard, Version 5.0 722: 647:(string) The name of the foundry. 641:(string) The version of the font. 137:Glyph Bitmap Distribution Format 17:Glyph Bitmap Distribution Format 704: 698: 692: 686: 680: 662: 656: 650: 644: 638: 628: 625:, for line spacing calculation. 621:(integer) The height above the 618: 612: 606: 600: 597:(string) A copyright statement. 594: 584: 569: 554: 547: 543: 535: 529: 525: 521: 517: 513: 509: 503: 499: 484: 478: 474: 467: 460: 454: 443: 366: 360: 349: 345: 336: 332: 325: 321: 315: 311: 307: 303: 299: 295: 291: 287: 267: 261: 251: 245: 239: 235: 211: 770: 744: 653:(string) The font family name. 339:keyword on a line is ignored. 331:Lines beginning with the word 1: 832: 143:is a file format for storing 516:have the same parameters as 231:42 42 00 00 ENDCHAR ENDFONT 7: 659:(string) A general comment. 169: 61:; 37 years ago 10: 924: 314:appears at the end of the 268:FONTBOUNDINGBOX 16 16 0 -2 256:X logical font description 218: 120: 107: 97: 73: 55: 45: 33: 21: 715: 673:= round(POINT_SIZE/10), 470:ends the current glyph. 35:Internet media type 871:: CS1 maint: others ( 528:must be present for a 491:Version 2.2 Extensions 238:line and end with the 84:; 31 years ago 40:application/x-font-bdf 352:, expressing in the 564:X Window Properties 18: 845:Unicode Consortium 689:(unsigned integer) 683:(unsigned integer) 667:Point (typography) 102:Bitmap font format 82:22 March 1993 23:Filename extension 16: 858:978-0-321-48091-0 473:The declarations 372:Adobe Font Metric 288:STARTPROPERTIES 2 130: 129: 46:Developed by 915: 876: 870: 862: 851:. October 2006. 847:(5th ed.). 826: 823:character string 819: 796: 795: 793: 792: 774: 768: 767: 765: 763: 756:X.Org Foundation 748: 742: 726: 706: 700: 694: 688: 682: 664: 658: 652: 646: 640: 630: 620: 614: 608: 602: 596: 586: 571: 556: 550:for each glyph. 549: 545: 537: 531: 527: 524:, respectively. 523: 519: 515: 511: 505: 501: 486: 480: 476: 469: 462: 456: 445: 439: 438: 436: 435: 432: 429: 421: 415: 414: 412: 411: 408: 405: 396: 394: 393: 390: 387: 368: 362: 351: 347: 346:STARTCHAR U+0041 338: 334: 327: 323: 317: 313: 309: 305: 301: 297: 293: 289: 283: 276: 269: 263: 253: 247: 241: 237: 213: 113: 92: 90: 85: 69: 67: 62: 19: 15: 923: 922: 918: 917: 916: 914: 913: 912: 908:X Window System 893: 892: 884: 879: 864: 863: 859: 839: 835: 830: 829: 820: 799: 790: 788: 775: 771: 761: 759: 750: 749: 745: 727: 723: 718: 570:STARTPROPERTIES 566: 493: 433: 430: 427: 426: 424: 423: 417: 409: 406: 401: 400: 398: 391: 388: 383: 382: 380: 375: 316:STARTPROPERTIES 292:STARTPROPERTIES 278: 271: 232: 221: 172: 133: 108: 93: 88: 86: 83: 81: 65: 63: 60: 56:Initial release 41: 29: 12: 11: 5: 921: 911: 910: 905: 891: 890: 883: 882:External links 880: 878: 877: 857: 849:Addison-Wesley 836: 834: 831: 828: 827: 797: 769: 758:. October 1988 743: 720: 719: 717: 714: 713: 712: 702: 696: 690: 684: 678: 665:(integer) See 660: 654: 648: 642: 636: 631:(integer) The 626: 616: 610: 604: 598: 592: 565: 562: 555:CONTENTVERSION 492: 489: 419:Scalable Width 385:Scalable Width 308:FONT_DESCENT 2 304:FONT_ASCENT 14 229: 220: 217: 216: 215: 208: 205: 171: 168: 131: 128: 127: 122: 118: 117: 114: 105: 104: 99: 98:Type of format 95: 94: 79: 77: 75:Latest release 71: 70: 57: 53: 52: 47: 43: 42: 39: 37: 31: 30: 27: 25: 9: 6: 4: 3: 2: 920: 909: 906: 904: 901: 900: 898: 889: 886: 885: 874: 868: 860: 854: 850: 846: 842: 838: 837: 824: 821:A ISO 8859-1 818: 816: 814: 812: 810: 808: 806: 804: 802: 787:on 2013-03-31 786: 782: 781: 773: 757: 753: 747: 741: 737: 733: 730: 725: 721: 710: 703: 697: 691: 685: 679: 676: 672: 668: 661: 655: 649: 643: 637: 634: 627: 624: 617: 611: 605: 599: 593: 590: 583: 582: 581: 579: 575: 561: 558: 551: 539: 533: 507: 497: 488: 482: 471: 465: 458: 455:BBX 8 16 0 -2 452: 448: 441: 420: 404: 386: 378: 373: 364: 358: 355: 343: 340: 329: 319: 312:ENDPROPERTIES 285: 281: 274: 265: 262:SIZE 16 75 75 259: 257: 249: 246:STARTFONT 2.1 243: 228: 226: 209: 206: 203: 202: 201: 198: 196: 191: 189: 185: 181: 177: 174:In 1988, the 167: 165: 161: 157: 153: 150: 146: 142: 138: 126: 123: 119: 115: 111: 106: 103: 100: 96: 78: 76: 72: 58: 54: 51: 48: 44: 38: 36: 32: 26: 24: 20: 903:Font formats 840: 789:. Retrieved 785:the original 779: 772: 760:. Retrieved 755: 746: 724: 687:RESOLUTION_Y 681:RESOLUTION_X 639:FONT_VERSION 629:FONT_DESCENT 601:DEFAULT_CHAR 567: 559: 552: 540: 534: 508: 498: 494: 483: 472: 466: 459: 453: 449: 442: 418: 402: 384: 376: 367:SWIDTH 500 0 365: 359: 344: 341: 330: 320: 300:FONT_DESCENT 286: 279: 272: 266: 260: 250: 244: 233: 222: 199: 192: 176:X Consortium 173: 145:bitmap fonts 136: 134: 699:WEIGHT_NAME 651:FAMILY_NAME 619:FONT_ASCENT 530:METRICSET 1 504:METRICSET 0 361:ENCODING 65 296:FONT_ASCENT 225:GNU Unifont 110:Open format 897:Categories 833:References 791:2009-01-08 762:19 January 736:registered 663:POINT_SIZE 589:Cap height 585:CAP_HEIGHT 578:ISO 8859-1 444:DWIDTH 8 0 403:Resolution 214:statement. 89:1993-03-22 50:Adobe Inc. 867:cite book 734:type not 633:descender 607:FACE_NAME 595:COPYRIGHT 500:METRICSET 475:STARTCHAR 318:section. 236:STARTFONT 139:(BDF) by 709:x-height 705:X_HEIGHT 623:baseline 477:through 416:, where 188:Truetype 184:Opentype 170:Overview 164:TrueType 160:OpenType 152:X Window 675:ENspace 671:EMspace 645:FOUNDRY 548:SWIDTH1 544:DWIDTH1 536:VVECTOR 526:DWIDTH1 514:DWIDTH1 510:SWIDTH1 485:ENDFONT 479:ENDCHAR 468:ENDCHAR 437:⁠ 425:⁠ 413:⁠ 399:⁠ 395:⁠ 381:⁠ 354:Unicode 337:COMMENT 333:COMMENT 322:CHARS 1 219:Example 212:ENDFONT 166:fonts. 121:Website 87: ( 64: ( 855:  843:. The 657:NOTICE 522:DWIDTH 518:SWIDTH 461:BITMAP 377:Pixels 350:U+0041 242:line. 195:glyphs 186:, and 716:Notes 693:SLANT 574:ASCII 326:CHARS 240:CHARS 141:Adobe 873:link 853:ISBN 764:2016 740:IANA 732:MIME 729:.bdf 613:FONT 546:and 520:and 512:and 434:1000 392:1000 298:and 282:= -2 277:and 210:the 162:and 149:Unix 135:The 66:1987 59:1987 28:.bdf 738:at 428:500 275:= 0 180:PCF 156:PCF 116:yes 80:2.2 899:: 869:}} 865:{{ 800:^ 754:. 711:). 591:). 506:. 410:72 397:* 379:= 258:. 227:. 190:. 182:, 875:) 861:. 825:. 794:. 766:. 431:/ 407:/ 389:/ 280:y 273:x 112:? 91:) 68:)

Index

Filename extension
Internet media type
Adobe Inc.
Latest release
Bitmap font format
Open format
Adobe Glyph Bitmap Distribution Format (BDF) Specification, version 2.2
Adobe
bitmap fonts
Unix
X Window
PCF
OpenType
TrueType
X Consortium
PCF
Opentype
Truetype
glyphs
GNU Unifont
X logical font description
Unicode
Adobe Font Metric
ASCII
ISO 8859-1
Cap height
baseline
descender
Point (typography)
EMspace

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.