| 1 |
# |
| 2 |
# Copyright 2008 Department of Mathematical Sciences, New Mexico State University |
| 3 |
# |
| 4 |
# Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
# copy of this software and associated documentation files (the "Software"), |
| 6 |
# to deal in the Software without restriction, including without limitation |
| 7 |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
# and/or sell copies of the Software, and to permit persons to whom the |
| 9 |
# Software is furnished to do so, subject to the following conditions: |
| 10 |
# |
| 11 |
# The above copyright notice and this permission notice shall be included in |
| 12 |
# all copies or substantial portions of the Software. |
| 13 |
# |
| 14 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
# DEPARTMENT OF MATHEMATICAL SCIENCES OR NEW MEXICO STATE UNIVERSITY BE |
| 18 |
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 19 |
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 20 |
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
# |
| 22 |
|
| 23 |
This is version 3.1 of a program to convert OpenType fonts to BDF fonts using |
| 24 |
the FreeType 2 renderer (http://www.freetype.org). |
| 25 |
|
| 26 |
BDF fonts can be edited using "gbdfed" which is available from: |
| 27 |
|
| 28 |
http://www.math.nmsu.edu/~mleisher/Software/gbdfed.html |
| 29 |
|
| 30 |
COMPILING otf2bdf |
| 31 |
----------------- |
| 32 |
|
| 33 |
If your system does not come with Freetype 2.1.5 or greater, pick up a |
| 34 |
Freetype2 distribution (>= 2.1.5) from http://www.freetype.org build and |
| 35 |
install it. |
| 36 |
|
| 37 |
Then compile otf2bdf by doing the following: |
| 38 |
|
| 39 |
% ./configure |
| 40 |
% make install |
| 41 |
|
| 42 |
Compilation hints: |
| 43 |
|
| 44 |
o The "configure" script expects the "freetype-config" script to be in the |
| 45 |
executable path. The "freetype-config" script is installed when Freetype2 |
| 46 |
is installed. |
| 47 |
|
| 48 |
o The installation directory can be specified by the --prefix=<some dir> |
| 49 |
command line parameter to the configure script. |
| 50 |
|
| 51 |
o A statically linked version can be created (on Linux/Unix) by compiling |
| 52 |
like this: |
| 53 |
|
| 54 |
% make STATIC=-static install |
| 55 |
|
| 56 |
RUNNING otf2bdf |
| 57 |
--------------- |
| 58 |
|
| 59 |
Type the following to get a list of command line options: |
| 60 |
|
| 61 |
% otf2bdf -h |
| 62 |
|
| 63 |
ACKNOWLEDGEMENTS |
| 64 |
---------------- |
| 65 |
|
| 66 |
Thanks go to the following people: |
| 67 |
|
| 68 |
Robert Wilhelm <[email protected]> for pointing out a |
| 69 |
crucial problem with the pre-1.0 code. |
| 70 |
|
| 71 |
Lho Li-Da <[email protected]> for pointing out a problem with Big5 and |
| 72 |
GB2312 encoding ids being documented incorrectly in the TT docs and a |
| 73 |
problem with glyphs that are height 1 or width 1, and a font name problem. |
| 74 |
|
| 75 |
Adrian Havill <[email protected]> for unintentionally pointing out a |
| 76 |
missing feature. |
| 77 |
|
| 78 |
Richard Verhoeven <[email protected]> for pointing out a font names problem, |
| 79 |
problem with bitmaps missing their last byte in each row, and an invalid |
| 80 |
FONT_DESCENT property value. |
| 81 |
|
| 82 |
Choi Jun Ho <[email protected]> for his inspiration from his |
| 83 |
implementation that changed some character set names, and added a |
| 84 |
number of new command line parameters. |
| 85 |
|
| 86 |
Pavel Kankovsky <[email protected]> for providing some |
| 87 |
critical grid fitting and metrics fixes when generating the bitmaps, |
| 88 |
adding the code to "auto-detect" bold and italic fonts, removing the |
| 89 |
dependency on ttobjs.h, finding some remapping bugs, and other fixes. |
| 90 |
|
| 91 |
Matti Koskinen <[email protected]> for pointing out a problem with using |
| 92 |
the code 0xffff. |
| 93 |
|
| 94 |
Eugene Bobin <[email protected]> for contributing the Cyrillic mapping |
| 95 |
tables (iso8859.5, koi8.r, windows.1251) and the sample shell scripts for |
| 96 |
generating sets of BDF fonts. |
| 97 |
|
| 98 |
Oleg N. Yakovlev <[email protected]> for alerting me to the |
| 99 |
problem of certain codes not being loaded correctly in the mapping tables. |
| 100 |
|
| 101 |
Bertrand Petit <[email protected]> for providing additional command line |
| 102 |
parameters to allow more control over the XLFD name generated. |
| 103 |
|
| 104 |
Roman Czyborra <[email protected]> for pointing out the need for a |
| 105 |
change from UNICODE-2.0 to ISO10646-1 in the font XLFD name. |
| 106 |
|
| 107 |
Mike Blazer <[email protected]> for pointing out the include changes |
| 108 |
needed to compile on Windows. |
| 109 |
|
| 110 |
Solofo Ramangalahy <[email protected]> for contributing the ISO8859.1 and |
| 111 |
ISO8859.3 mapping tables. |
| 112 |
|
| 113 |
Antoine Leca <[email protected]> for suggesting the exchange of |
| 114 |
columns in the mapping table to better fit the mapping table format used by |
| 115 |
many. |
| 116 |
|
| 117 |
Robert Brady <[email protected]> for pointing out a problem with the |
| 118 |
length of _XFREE86_GLYPH_RANGES properties and an Exceed font compiler. |
| 119 |
|
| 120 |
Patrick Hagglund <[email protected]> for providing the patches to |
| 121 |
use FreeType2 (taken from xmbdfed). |
| 122 |
|
| 123 |
Christos Tountas <[email protected]> for finding a buffer overflow problem. |
| 124 |
|
| 125 |
Nelson Beebe <[email protected]> for finding problems with the FreeType |
| 126 |
includes, the configure setup, and a compilation warning. |
| 127 |
|
| 128 |
"Prophet of the Way" <[email protected]> for pointing out a glyph bitmap |
| 129 |
undergeneration problem. |
| 130 |
|
| 131 |
CHANGES |
| 132 |
------- |
| 133 |
Version 3.1 |
| 134 |
=========== |
| 135 |
1. Fixes for Freetype includes. |
| 136 |
|
| 137 |
2. Check for Windows TEMP environment variable. |
| 138 |
|
| 139 |
3. Fixed some sign promotion problems that came up with gcc 4.2.3. |
| 140 |
|
| 141 |
4. Fixed a glyph bitmap undergeneration problem that occurs with some TTF |
| 142 |
fonts. |
| 143 |
|
| 144 |
Version 3.0 |
| 145 |
=========== |
| 146 |
1. Converted to use Freetype2. |
| 147 |
|
| 148 |
2. Changed name to otf2bdf. |
| 149 |
|
| 150 |
3. Changed all _TTF_* BDF font properties to _OTF_*. |
| 151 |
|
| 152 |
4. Fixed a buffer overflow problem found by Christos Tountas |
| 153 |
<[email protected]>. |
| 154 |
|
| 155 |
5. Changed to usage message to print to stdout. |
| 156 |
|
| 157 |
6. Added the -et command line parameter to print a list of all the encoding |
| 158 |
tables available in the font. |
| 159 |
|
| 160 |
7. Fixed an encoding name problem with XLFD font names. |
| 161 |
|
| 162 |
Version 2.7 |
| 163 |
=========== |
| 164 |
1. Swapped all the columns in the mapping files. |
| 165 |
|
| 166 |
2. Changed the mapping table loader to index on the second column instead of |
| 167 |
the first. |
| 168 |
|
| 169 |
3. Reduced the line length of _XFREE86_GLYPH_RANGES properties to 256 |
| 170 |
instead of 512. |
| 171 |
|
| 172 |
Version 2.6 |
| 173 |
=========== |
| 174 |
1. Changed the includes to deal with compilation on Windows. |
| 175 |
|
| 176 |
2. Added some new mapping tables. |
| 177 |
|
| 178 |
Version 2.5 |
| 179 |
=========== |
| 180 |
1. Updated the copyright dates. |
| 181 |
|
| 182 |
2. Fixed an incorrect parameter for Traditional C compilers. |
| 183 |
|
| 184 |
3. Added generation of the _XFREE86_GLYPH_RANGES properties. |
| 185 |
|
| 186 |
Version 2.4 |
| 187 |
=========== |
| 188 |
1. Change all CRLF's, CR's, or LF's in copyright strings to double spaces. |
| 189 |
|
| 190 |
2. Changed it so gcc 2.8.1 likes the return type of main() again. |
| 191 |
|
| 192 |
Version 2.3 |
| 193 |
=========== |
| 194 |
1. Changed Makefile.in a bit to make installation more consistent. |
| 195 |
|
| 196 |
2. Changed the lower limit for the vertical and horizontal resolutions to be |
| 197 |
10dpi instead of 50dpi. |
| 198 |
|
| 199 |
Version 2.2 |
| 200 |
=========== |
| 201 |
1. Added missing documentation in the manual page. |
| 202 |
|
| 203 |
2. Added the `-u' parameter to allow setting the character used to replace |
| 204 |
dashes or spaces in the font name. |
| 205 |
|
| 206 |
3. Changed the CHARSET_REGISTRY and CHARSET_ENCODING to be "ISO10646-1" |
| 207 |
instead of "Unicode-2.0". |
| 208 |
|
| 209 |
4. The numGlyphs property comes back incorrect for some fonts, so the loop |
| 210 |
cycles through all 65536 possibilities every time now. |
| 211 |
|
| 212 |
Version 2.1 |
| 213 |
=========== |
| 214 |
1. Added patches provided by Bertrand Petit. |
| 215 |
|
| 216 |
2. Insured compatibility with FreeType 1.1. |
| 217 |
|
| 218 |
Version 2.0 |
| 219 |
=========== |
| 220 |
1. Created two new subdirectories. One for mapping tables and one for any |
| 221 |
other contributed code, scripts, or data. |
| 222 |
|
| 223 |
2. Updated Cyrillic mapping files sent by Eugene Bobin. |
| 224 |
|
| 225 |
3. Minor fixes to make compatible with the latest version of FreeType. |
| 226 |
|
| 227 |
Version 1.9 |
| 228 |
=========== |
| 229 |
1. Fixed a problem with the first code of a mapping table being lost. |
| 230 |
|
| 231 |
Version 1.8 |
| 232 |
=========== |
| 233 |
1. Added the Unicode->Cyrillic mapping tables provided by Eugene Bobin. |
| 234 |
|
| 235 |
2. Created a shell script based on Eugene Bobin's scripts to generate sets |
| 236 |
of BDF fonts at one time. |
| 237 |
|
| 238 |
Version 1.7 |
| 239 |
=========== |
| 240 |
1. If a remapping table is provided, code ranges are now expected to be |
| 241 |
specified in terms of the codes in the mapping table. |
| 242 |
|
| 243 |
2. The glyph generation loop is improved a bit. |
| 244 |
|
| 245 |
Version 1.6 |
| 246 |
=========== |
| 247 |
1. Added two expected keywords REGISTRY and ENCODING in the remap files. |
| 248 |
These values are used when the font's XLFD name is generated. |
| 249 |
|
| 250 |
2. Added TTF2BDF_VERSION macro used for adding the "Converted by" comment. |
| 251 |
|
| 252 |
3. Handle the case of no glyphs being generated. No BDF font is produced. |
| 253 |
|
| 254 |
4. Updated for new API with TT_Engine. |
| 255 |
|
| 256 |
Version 1.5 |
| 257 |
=========== |
| 258 |
1. Fixed a problem with updating the average width field of the XLFD |
| 259 |
font name. |
| 260 |
|
| 261 |
2. Changed things so bitmaps are generated to a temporay file so an |
| 262 |
accurate count and metrics can be calculated. |
| 263 |
|
| 264 |
3. Changed things so the font header is not generated until the bitmaps |
| 265 |
have been generated. This allows accurate calculations of the various |
| 266 |
fields needed. |
| 267 |
|
| 268 |
4. Added the '-l' command line parameter that allows specification of a |
| 269 |
subrange of glyphs to generate. The syntax is the same as that used in |
| 270 |
X11 for subranges. See the X11 XLFD documentation, page 9 for more |
| 271 |
detail. |
| 272 |
|
| 273 |
Example: |
| 274 |
|
| 275 |
% ttf2bdf -l '60 70 80_90' font.ttf -o font.bdf |
| 276 |
|
| 277 |
The command above will only generate the glyphs for codes 60, 70, |
| 278 |
and 80 through 90 inclusive. |
| 279 |
|
| 280 |
5. Added the ability to load a mapping table that will remap a font to |
| 281 |
another character set. The mapping table should have two columns. |
| 282 |
|
| 283 |
The first column should be the hexadecimal code of the glyph in the |
| 284 |
"cmap" table ttf2bdf is using. The second column should have the |
| 285 |
code which should be used in the BDF font. An example mapping file |
| 286 |
is provided which will map fonts from Unicode (default cmap table) to |
| 287 |
ISO8859-2. |
| 288 |
|
| 289 |
6. Fixed grid fitting to avoid dropout in some cases. |
| 290 |
|
| 291 |
7. Removed dependency on ttobjs.h by using the new API function for |
| 292 |
retrieving strings. |
| 293 |
|
| 294 |
8. Removed warning about getpid() on Solaris. |
| 295 |
|
| 296 |
9. Rearranged the man page a bit to be more useful. Minor |
| 297 |
improvements also done. |
| 298 |
|
| 299 |
10. Changed the loop so it does not include 0xffff as a code because |
| 300 |
it causes crashes when converting some fonts. |
| 301 |
|
| 302 |
Version 1.4 [Never released as binaries] |
| 303 |
=========== |
| 304 |
1. Changed the names of two MS encodings (Wansung and Johab) to |
| 305 |
KSC5601.1987 and KSC5601.1992. |
| 306 |
|
| 307 |
2. Added the '-n' command line flag to turn hinting off. |
| 308 |
|
| 309 |
3. Added the '-c' command line flag to set the font spacing. |
| 310 |
|
| 311 |
4. Added the '-t', '-w', and '-s' command line options to override the |
| 312 |
default typeface, weight and slant names. |
| 313 |
|
| 314 |
Version 1.3 |
| 315 |
=========== |
| 316 |
1. Converted to use the new FreeType API. |
| 317 |
|
| 318 |
2. Added the '-rh' and '-rv' command line parameters to allow both the |
| 319 |
horizontal and vertical resolutions to be set individually. |
| 320 |
|
| 321 |
3. Fixed a problem with ignoring undefined glyphs. All undefined were |
| 322 |
being rendered which caused missing glyphs on the end. |
| 323 |
|
| 324 |
4. Fixed a problem with offset calculations needed to render glyph |
| 325 |
bitmaps. |
| 326 |
|
| 327 |
Version 1.2 |
| 328 |
=========== |
| 329 |
1. Fixed a problem with dashes that appear in the font family name causing |
| 330 |
parse problems with the XLFD font names. |
| 331 |
|
| 332 |
2. Fixed a problem with certain bitmaps missing their final byte on each |
| 333 |
row. |
| 334 |
|
| 335 |
3. Fixed an incorrect FONT_DESCENT value. |
| 336 |
|
| 337 |
4. Changed things around so names can be retrieved in a more general way. |
| 338 |
|
| 339 |
5. Fixed a problem with bitmaps not being generated after a certain point. |
| 340 |
|
| 341 |
Version 1.1 |
| 342 |
=========== |
| 343 |
1. Fixed the actual glyph count for the CHARS line. |
| 344 |
|
| 345 |
2. Swapped the Big5 and GB2312 XLFD encoding strings because of incorrect TT |
| 346 |
specifications. |
| 347 |
|
| 348 |
3. Fixed a problem with bitmap generation for glyphs that are width 1 or |
| 349 |
height 1. |
| 350 |
|
| 351 |
4. Added command line parameters to set the font and render pool memory |
| 352 |
sizes in Kilobytes from the command line. |
| 353 |
|
| 354 |
Version 1.0 |
| 355 |
=========== |
| 356 |
1. Initial release. |
| 357 |
|
| 358 |
[email protected] (Mark Leisher) |
| 359 |
22 May 2008 |