OTF2BDF(1)

✨ OTF2BDF β€” the OpenType to BDF glow-up πŸ’…

ok so bestie, this is a General Commands Manual page, section 1, and the whole vibe is: you have a cute lil OpenType font and you want it to be a BDF font instead. Say less. πŸ¦‹


🌸 NAME 🌸

otf2bdf β€” OpenType to BDF font converter. that's it, that's the whole job description. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

otf2bdf [options] font.{ttf,otf}

yeah so it's otf2bdf, then some options if you're feeling spicy, then the actual font file which is either a .ttf or an .otf. iconic behaviour honestly. πŸ’–


πŸ‘‘ DESCRIPTION πŸ‘‘

otf2bdf will convert an OpenType font to a BDF font using the Freetype2 renderer (http://www.freetype.org).

like... it takes your fancy-schmancy OpenType file and turns it into a good old-fashioned bitmap distribution format font. the Freetype2 renderer is the one doing the heavy lifting here, we're just the messenger. 🧚


✨ OPTIONS ✨

so otf2bdf accepts the following command line arguments, and there are a lot of them, so buckle up bestie:

  • -v β€” print warning messages when the font is converted. like, it'll actually tell you when stuff is giving weird.
  • -n β€” disable glyph hinting. bye bye hinting πŸ’€
  • -p n β€” set the desired point size. (peep the default value by running the program with the -h option, iykyk.)
  • -et β€” display a list of the platforms and encodings available in the font. the default values, compiled into the program, are a platform of 3 (Microsoft) and encoding of 1 (ISO10646). if the font does not contain the default platform and encoding, the fallback will be the Apple ISO10646 encoding. so like, plan B but make it Apple πŸ“
  • -r n β€” set both the horizontal and the vertical resolution (again, see the default by running the program with the -h option). the minimum is 10dpi and the maximum is 1200dpi. don't try to go outside that range, it's not gonna slay.
  • -rh n β€” set the horizontal resolution (default value? you guessed it, -h option). minimum 10dpi, maximum 1200dpi.
  • -rv n β€” set the vertical resolution (same deal, -h option for the default). minimum 10dpi, maximum 1200dpi.
  • -o outfile β€” sets the output filename. and ngl, the default output is to stdout, so if you forget this, the font is just gonna... appear in your terminal. main character energy but messy. πŸ™ˆ
  • -pid id β€” set the platform id for selecting the character map (default value: run the program with the -h option).
  • -eid id β€” set the encoding id for selecting the character map (default value: run the program with the -h option).
  • -c c β€” set the character spacing. this should be one of P for proportional, M for monospace, or C for character cell. by default, the spacing of a font will be automatically determined to be either M or P according to values provided in the font. so it'll vibe-check itself first.
  • -f name β€” set the foundry name used in the XLFD name. the default value is Freetype.
  • -t name β€” set the typeface name used in the XLFD name. by default, otf2bdf will attempt to get a name from the font first and then it will use the name supplied with this command line option, and if all else fails, it will use the name Unknown. so it's font first, your input second, Unknown as the last resort. it's giving backup plan, backup plan, backup plan. πŸ’…
  • -w name β€” set the weight name used in the XLFD name. if this value is not supplied, the default value is assumed to be Medium. some common values for this are Thin, Delicate, ExtraLight, Light, Normal, Medium, SemiCondensed, Condensed, SemiBold, Bold, Heavy, ExtraBold, and ExtraHeavy. pick your fighter. πŸ”₯
  • -s name β€” set the slant name used in the XLFD name. if this value is not supplied, the default value is assumed to be R, for Roman. some common values for this are R for Roman, I for Italic, O for Oblique, RI for Reverse Italic, and RO for Reverse Oblique. slay, slant, same thing.
  • -k name β€” set the width name used in the XLFD name. the default is Normal.
  • -d name β€” set the additional style name used in the XLFD name. the default is an empty string. so like... nothing. silence. 🀫
  • -u char β€” set the character used to replace the dashes/spaces in a font name. the default is the space character.
  • -l subset β€” define a list of character codes which will be used to select a subset of glyphs from the font. the syntax of the subset string is the same as the syntax for selecting subsets in X11 XLFD font names. example time:
% otf2bdf -l '60 70 80_90' font.ttf -o font.bdf

the command above will only generate the glyphs for codes 60, 70, and 80 through 90 inclusive. glyphs that are not in the subset are not generated. we're being selective, periodt. βœ‚οΈ

  • -m mapfile β€” specifies a mapping file which will reencode the BDF font when it is generated. any glyphs with codes that do not have a mapping will not be generated. brutal but fair.

the remapping file should begin with two lines, one which starts with REGISTRY followed by the character set registry and one which starts with ENCODING followed by the encoding. an example from the iso8859.2 file:

REGISTRY ISO8859
ENCODING 2

the remapping data should be two columns of hexadecimal numbers, separated by spaces or tabs. the first column should have the code which should be used in the BDF font. the second column should be the hexadecimal code of the glyph in the "cmap" table otf2bdf is using. an example mapping file is provided which will map fonts from Unicode (the default "cmap" table) to ISO8859-2.

Unicode is not the only option. if you choose another platform and encoding ID on the command line, then the remapping is assumed to map from the chosen platform and encoding to some other character set. so many possibilities, we love options. 🌈

ok real talk bestie β€” when a glyph doesn't have a mapping in your mapfile, or isn't in your subset, it is simply not generated. no glyph, no drama, no fallback. plan accordingly. πŸ’–

🫢 SEE ALSO 🫢

  • gbdfed(1), xfed(1), bdftopcf(1), bdftosnf(1), bdfresize(1)
  • Glyph Bitmap Distribution Format (BDF) Specification, Application Note 5005, Adobe System Inc, 1993
  • X Logical Font Description Conventions, X Consortium

go read the lore, it's giving required reading. πŸ“š


πŸ’œ ACKNOWLEDGMENTS πŸ’œ

shoutout to the whole squad, fr fr:

  • The FreeType project for providing the renderer!
  • Robert Wilhelm <robert@physiol.med.tu-muenchen.de> for pointing out a crucial problem with the pre-1.0 code.
  • Lho Li-Da <ollie@ms1.hinet.net> for problem reports.
  • Adrian Havill <havill@threeweb.ad.jp> for unintentionally pointing out a missing feature.
  • Richard Verhoeven <rcb5@win.tue.nl> for problem reports and patches.
  • Choi Jun Ho <junker@jazz.snu.ac.kr> whose implementation provided some nice new features.
  • Pavel Kankovsky <peak@kerberos.troja.mff.cuni.cz> for providing some critical metrics fixes and other improvements.
  • Matti Koskinen <mjkoskin@sci.fi> for pointing out a problem.
  • Eugene Bobin <gene@ftim.ustu.ru> for mapping tables.
  • Oleg N. Yakovlev <yashka@optima.dnepropetrovsk.ua> for pointing out a problem.
  • Bertrand Petit <elrond@phoe.frmug.org> for additional functionality.
  • Roman Czyborra <czyborra@cs.tu-berlin.de> for pointing out some problems.
  • Mike Blazer <blazer@mail.nevalink.ru> for some Window's compilation advice.
  • Solofo Ramangalahy <solofo@mpi-sb.mpg.de> for contributing some mapping tables.
  • Antoine Leca <Antoine.Leca@renault.fr> for mapping table suggestions.
  • Patrick Hagglund <patrik.hagglund@bredband.net> for Freetype2 patches.
  • Christos Tountas <cvt@sprynet.com> for finding problems.
  • Nelson Beebe <beebe@math.utah.edu> for finding problems.
  • "Prophet of the Way" <afu@wta.att.ne.jp> for finding a problem.

every single one of y'all ate. no crumbs left. πŸ‘‘


🌟 AUTHOR 🌟

Mark Leisher Computing Research Lab New Mexico State University Email: mleisher@crl.nmsu.edu


this page is Freetype Version 2, dated 22 May 2008, and it lives in section 1 of the manual as OTF2BDF(1). that's the whole vibe check. now go convert some fonts bestie, you got this πŸ¦‹πŸ’–βœ¨