/src/freetype/src/bdf/README

https://bitbucket.org/cabalistic/ogredeps/ · #! · 148 lines · 103 code · 45 blank · 0 comment · 0 complexity · 974e7263a97f094a0f56cdda8f576390 MD5 · raw file

  1. FreeType font driver for BDF fonts
  2. Francesco Zappa Nardelli
  3. <francesco.zappa.nardelli@ens.fr>
  4. Introduction
  5. ************
  6. BDF (Bitmap Distribution Format) is a bitmap font format defined by Adobe,
  7. which is intended to be easily understood by both humans and computers.
  8. This code implements a BDF driver for the FreeType library, following the
  9. Adobe Specification V 2.2. The specification of the BDF font format is
  10. available from Adobe's web site:
  11. http://partners.adobe.com/public/developer/en/font/5005.BDF_Spec.pdf
  12. Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
  13. They do not define vertical metrics, because the X Consortium BDF
  14. specification has removed them.
  15. Encodings
  16. *********
  17. The variety of encodings that accompanies bdf fonts appears to encompass the
  18. small set defined in freetype.h. On the other hand, two properties that
  19. specify encoding and registry are usually defined in bdf fonts.
  20. I decided to make these two properties directly accessible, leaving to the
  21. client application the work of interpreting them. For instance:
  22. #include FT_INTERNAL_BDF_TYPES_H
  23. FT_Face face;
  24. BDF_Public_Face bdfface;
  25. FT_New_Face( library, ..., &face );
  26. bdfface = (BDF_Public_Face)face;
  27. if ( ( bdfface->charset_registry == "ISO10646" ) &&
  28. ( bdfface->charset_encoding == "1" ) )
  29. [..]
  30. Thus the driver always exports `ft_encoding_none' as face->charmap.encoding.
  31. FT_Get_Char_Index's behavior is unmodified, that is, it converts the ULong
  32. value given as argument into the corresponding glyph number.
  33. If the two properties are not available, Adobe Standard Encoding should be
  34. assumed.
  35. Anti-Aliased Bitmaps
  36. ********************
  37. The driver supports an extension to the BDF format as used in Mark Leisher's
  38. xmbdfed bitmap font editor. Microsoft's SBIT tool expects bitmap fonts in
  39. that format for adding anti-aliased them to TrueType fonts. It introduces a
  40. fourth field to the `SIZE' keyword which gives the bpp value (bits per
  41. pixel) of the glyph data in the font. Possible values are 1 (the default),
  42. 2 (four gray levels), 4 (16 gray levels), and 8 (256 gray levels). The
  43. driver returns either a bitmap with 1 bit per pixel or a pixmap with 8bits
  44. per pixel (using 4, 16, and 256 gray levels, respectively).
  45. Known problems
  46. **************
  47. - A font is entirely loaded into memory. Obviously, this is not the Right
  48. Thing(TM). If you have big fonts I suggest you convert them into PCF
  49. format (using the bdftopcf utility): the PCF font drive of FreeType can
  50. perform incremental glyph loading.
  51. When I have some time, I will implement on-demand glyph parsing.
  52. - Except for encodings properties, client applications have no visibility of
  53. the PCF_Face object. This means that applications cannot directly access
  54. font tables and must trust FreeType.
  55. - Currently, glyph names are ignored.
  56. I plan to give full visibility of the BDF_Face object in an upcoming
  57. revision of the driver, thus implementing also glyph names.
  58. - As I have never seen a BDF font that defines vertical metrics, vertical
  59. metrics are (parsed and) discarded. If you own a BDF font that defines
  60. vertical metrics, please let me know (I will implement them in 5-10
  61. minutes).
  62. License
  63. *******
  64. Copyright (C) 2001-2002 by Francesco Zappa Nardelli
  65. Permission is hereby granted, free of charge, to any person obtaining
  66. a copy of this software and associated documentation files (the
  67. "Software"), to deal in the Software without restriction, including
  68. without limitation the rights to use, copy, modify, merge, publish,
  69. distribute, sublicense, and/or sell copies of the Software, and to
  70. permit persons to whom the Software is furnished to do so, subject to
  71. the following conditions:
  72. The above copyright notice and this permission notice shall be
  73. included in all copies or substantial portions of the Software.
  74. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  75. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  76. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  77. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  78. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  79. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  80. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  81. *** Portions of the driver (that is, bdflib.c and bdf.h):
  82. Copyright 2000 Computing Research Labs, New Mexico State University
  83. Copyright 2001-2002, 2011 Francesco Zappa Nardelli
  84. Permission is hereby granted, free of charge, to any person obtaining a
  85. copy of this software and associated documentation files (the "Software"),
  86. to deal in the Software without restriction, including without limitation
  87. the rights to use, copy, modify, merge, publish, distribute, sublicense,
  88. and/or sell copies of the Software, and to permit persons to whom the
  89. Software is furnished to do so, subject to the following conditions:
  90. The above copyright notice and this permission notice shall be included in
  91. all copies or substantial portions of the Software.
  92. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  93. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  94. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  95. THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
  96. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
  97. OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
  98. THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  99. Credits
  100. *******
  101. This driver is based on excellent Mark Leisher's bdf library. If you
  102. find something good in this driver you should probably thank him, not
  103. me.