TTF2UFM_CONVERT(1)

πŸ“¦
version 3.4.4~r2+gbp Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

ttf2ufm_convert β€” the convenience font conversion script. yes bestie, she's the whole vibe. this page lives in section 1 of the TTF2UFM Font Converter manual. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

ttf2ufm_convert [config-file]

🌸 DESCRIPTION 🌸

okay so Convert is the master conversion script that ships with ttf2ufm β€” main character energy, fr. when it gets installed into a public directory it goes by the name ttf2ufm_convert instead, purely so it doesn't collide with the names of the other programs. πŸ’…

if you don't hand it a configuration file as an argument, then it just uses the file convert.cfg sitting in the current directory. that file is where all the configuration variables live. the distribution gives you a sample called convert.cfg.sample β€” please copy it over to convert.cfg, actually look inside it, and change the configuration variables to match your setup. the more stable config variables, like the path names of the scripts and the encoding files, live in convert itself, and they get updated automatically when you install ttf2ufm. ✨

drop all the TTF fonts you want to convert into some directory. (this can literally just be the directory that already holds all your Windows fonts on a mounted FAT filesystem, no biggie.) but if you've got fonts in different source encodings, then you need to put the fonts for each encoding into its own separate directory. up to 10 source directories are supported. and if β€” in a rather unlikely case β€” you have more source directories than that, just do two separate runs of the converter, converting up to 10 directories at a time. πŸŽ€

the variables in the configuration file are:

  • SRCDIRS β€” the list of directories (with absolute paths) that hold your TTF fonts. each line contains at least 3 fields: the name of the directory, the language of the fonts inside it (if you have fonts for different languages you have to put them into separate directories), and the encoding of the fonts. again, if you have some of the TTF typefaces in one encoding and some in another (say, CP-1251 and KOI-8), you have to put them into separate source directories. some lines may contain 4 fields β€” then the fourth field is the name of the external map used to convert the Unicode fonts into the encoding you want. that map gets used instead of the built-in map for that specified language.
    • *8* an interesting thing (iykyk): some languages have more than one widely used character encoding. for example, the widely used encodings for Russian are IBM CP-866 (MS-DOS and Unix), KOI-8 (Unix and VAX, also the standard Internet encoding), and IBM CP-1251 (MS Windows). that's why the means are provided to generate the converted fonts in more than one encoding. see the file encodings/README for the details about the encoding tables. actually, if you plan to use these fonts with Netscape Navigator, better use the aliases cp-866 instead of ibm-866, and windows-1251 instead of ibm-1251, because that's what Netscape wants. πŸ’€
  • DSTDIR β€” the directory for the resulting Type1 fonts. be careful! ⚠️ this directory gets completely wiped out before conversion, so do not use any already existing directory for this purpose. like, don't. seriously.
  • DSTENC{language} β€” the list of encodings in which the destination fonts will be generated for each language. every font of that language will be generated in each of the specified encodings. if you don't want any translation at all, just specify both SRCENC and DSTENC as iso8859-1 (or, if you want any other encoding that's specified in the fonts.dir, copy the description of 8859-1 under a new name and use that new name for SRCENC and DSTENC).
  • FOUNDRY β€” the foundry name to be used in the fonts.dir file. it's set to fromttf so it avoids name conflicts with any existing font, for sure. but heads up: this foundry name is not registered in the X11 standards, and if you want full standard compliance, or you have a font server that enforces such compliance, use misc instead. πŸ‘‘

the next few parameters control the general behavior of the converter. their default values are set to something reasonable, so don't stress. 🧚

  • CORRECTWIDTH β€” if the value is set to YES then use the converter option -w; otherwise don't use it. see the description of this option in the README file.
  • REMOVET1A β€” if the value is set to YES then, after conversion, remove the un-encoded .t1a font files and the intermediate .xpfa font metric files.
  • INSTALLFONTMAP β€” a Ghostscript parameter. if the value is set to YES then install the entries for the new fonts right into the main Fontmap file. otherwise just leave the file Fontmap.ttf sitting in the Ghostscript configuration directory.
  • HINTSUBST β€” if the value is set to YES use the option -H; otherwise don't use it. this option enables the hint substitution technique. if you have not installed the X11 patch described above, use this option with great caution. 😭 see the further description of this option in the README file.
  • ENFORCEISO β€” if the value is set to YES then disguise the resulting fonts as fonts in the ISOLatin1 encoding. historically this was necessary because of the way the installer scripts created the X11 font configuration files. it is not necessary any more for this purpose. but if you plan to use these fonts with some other application that expects ISOLatin1 encoding, then you'd better enable this option. 🌈
  • ALLGLYPHS β€” if the value is set to YES then include all the glyphs from the source fonts in the resulting fonts, even if those glyphs are inaccessible. if it's set to NO then include only the glyphs that have codes assigned to them. glyphs without codes can't be used directly. but some clever programs β€” such as the Type 1 library from XFree86 3.9 and higher β€” can change the encoding on the fly and use another set of glyphs. if you have not installed the X11 patch described above, use this option with great caution. see the further description of the option -a in the README file.
  • GENUID β€” if the value is set to YES then use the option -uA of the converter to generate UniqueIDs for the converted fonts. the standard X11 Type 1 library does not use this ID, so it may only be necessary for other applications. the script is clever enough to generate a different UniqueID for the same font converted to multiple encodings. also, after conversion it checks all the fonts generated during the session for duplicated UniqueIDs and shows you those. still, this does not guarantee that these UniqueIDs won't overlap with some other fonts. the UniqueIDs are generated as hash values from the font names, so it is guaranteed that if the convert script runs multiple times it'll generate the same UniqueIDs during each run. see the further description of this option in the README file. πŸ”₯
  • GENUID β€” πŸ’€ ok bestie yes it really is written as GENUID a second time in here, i don't make the rules. if the value is set to YES then create the .pfb files, otherwise the .pfa files. the .pfb files are more compact but they contain binary data, so you may run into some troubles when transferring them through the network.

the following parameters are used to locate the other scripts and configuration files. by default the scripts do a little bit of guessing for them: they search in the ttf2ufm installation directory if ttf2ufm was installed, or otherwise they suppose that you're running convert with scripts as a subdirectory of the current directory. πŸ™ˆ

  • ENCDIR β€” directory containing the descriptions of encodings
  • MAPDIR β€” directory containing the external map files

besides that, a few parameters are built into the convert script itself. you probably won't need to change them:

  • T1ASM, TTF2UFM, TRANS, T1FDIR, FORCEISO β€” paths to the other script

there are also a few parameters controlling the installation of fonts for Ghostscript. please look at their description in the Ghostscript section of the documentation, or in the ttf2ufm_x2gs(1) manual page, before running convert. if these parameters are set, convert will call the x2gs script automatically to install the newly converted fonts in Ghostscript. 🫢

after you've created the configuration file, run the convert script. look at the result and at the log file in DSTDIR.

then add the directory with the newly converted fonts to the configuration of the X server or the font server. for most systems this step is super straightforward. for HP-UX it's rather tricky and poorly documented, so the file FONTS.hpux gives a short description.

if you don't have root user privileges, you can still configure your own private font server β€” just use some non-standard port number. (see FONTS.hpux for an example, except that you won't need all the HP-related stuff on any other system.) ⭐


πŸŽ€ FILES πŸŽ€

  • TTF2UFM_SHAREDIR/scripts/convert.cfg.sample
  • TTF2UFM_SHAREDIR/scripts/*
  • TTF2UFM_SHAREDIR/README
  • TTF2UFM_SHAREDIR/FONTS
  • TTF2UFM_SHAREDIR/*
  • TTF2UFM_BINDIR/ttf2ufm

πŸ’œ SEE ALSO πŸ’œ

πŸ’€ BUGS πŸ’€

Known problems 😭

  • okay so first catch, bestie: the X11 Type 1 font library has a rather low limit on font size. That means fonts with more complicated outlines and enabled hint substitution might not fit into that limit. Same vibe for fonts with very complicated outlines or very many glyphs (especially fonts with over 256 glyphs). So if you're planning to use these fonts with X11, you'll need to excercise caution with these options. Some vendors, like HP, ship the Type 1 implementation licensed from Adobe, and that one should have no such problem.

But bestie, there's a solution even for generic X11. A patch in the subdirectory app/X11 fixes this problem plus some other minor problems. The description lives in app/X11/README.

Fixing the X11 font library means you've gotta get the X11 sources. I can recommend the ftp sites of the XFree86 project ftp://ftp.xfree86.org or of the Open Group ftp://ftp.x.org. This patch was made on the sources of XFree86, so applying it to the XFree86 distribution may go better. After you get the sources, make sure you can compile them. Then apply the patch as described. Make sure it was applied properly. Compile the sources again (actually, you only need the fonts library, the fonts server, and possibly the X server). It would be prudent now to save your old font library, font server and, possibly, X server. Then install the new recently compiled versions of these files. Of course, if you know someone who already compiled these files for the same OS as yours, you can just copy the binary fles from him.

Alas, building the X11 system from the source code is not the easiest thing in the world, and if you have no experience it can be quite difficult. In this case just avoid the aforementioned features or check each converted font to make sure it works properly.

  • HP-UX tea, no cap: The Type1 font library from the standard X11 distribution does not work on HP-UX (at least, up to 10.01). The font server supplied with HP-UX up to 10.01 is also broken. Starting from HP-UX 10.20 (I don't know about 10.10) they supply a proprietary font library, and the converted fonts work fine with it, provided that they are configured properly (see the file FONTS.hpux).
  • the fonts.scale drama: The fonts.scale files created by the older versions of the ttf2ufm installation program (up to release 3.1) have conflicted with the language definitions of the Xfsft font server and parts of it included into XFree86. To overcome this incompatibility the never versions creats (typo and all, bestie) the fonts.scale file describing all the fonts as belonging to the adobe-fontspecific encoding and the fonts.alias file with the proper names. The drawback of this solution is that xlsfonts gives the list of twice more fonts. But as a side effect the option ENFORCEISO in convert.cfg is not required for X11 any more.
  • Eastern multi-plane fonts? The conversion script has no support for Eastern multi-plane fonts. Contribution of such a support would be welcome.

And that's the whole tea, bestie. This page is from version 3.4.4, dated December 31, 2003, and it's the TTF2UFM_CONVERT(1) man page. slay πŸ’…βœ¨

πŸ“¦ where this page comes from