# How to create own TeX Font?

I know that a lot of questions have been asked on this subject, but none of the answers worked for me. For couple of months I tried to create TeX Font, and found a way to generate some of files.

Using FontForge from `X.sfd` I've created `X.pfb`, `X.enc` and `X.amf` (I've deleted `X.tfm`, because its machine code didn't look like the ones which was already installed). After I run following commands

``````#!/bin/bash

afm2tfm X -T X.enc -v X >>X.map
afm2tfm X-bd -T X.enc -v X-bd >>X.map
afm2tfm X-bi -T X.enc -v X-bi >>X.map
afm2tfm X-it -T X.enc -v X-it >>X.map

vptovf X
vptovf X-bd
vptovf X-bi
vptovf X-it

rm *.vpl
``````

Here `-bd`, `-bi` and `-it`, just mean bold, bold italic and italic types, and they were generated same way. As a result we get `.enc`, `.map`, `.afm`, `.tfm`, `.pfb` and `.vf` files.

But I don't know how to continue, I still get errors and there are more files `.fb`, `.def`, `.dfu`.

• Unless it is a symbol font, you need the encoding you end up with for the TFMs to be a known encoding (unless you are going to create a new one, I suppose) e.g. OT1 or T1 or whatever. It isn't clear which errors you get or from what. Do you mean the above script generates errors? Which? Or do you mean you get errors when you try to compile some unspecified code? – cfr Jun 12 '16 at 13:21
• You don't want `-T`. You want `-p` and `-t`, I think. But note that I wouldn't use `afm2tfm` to do this at all, so I'm not very familiar with its use. (I think I used it once years ago to install Times following line-by-line instructions when I had to provide output which 'looked like' Word's.) – cfr Jun 12 '16 at 13:23
• For Georgian see tex.tsu.ge ...Contact author (me) by Email :) – Levan Shoshiashvili Jun 12 '16 at 20:42
• For georgian in 'Classic TeX/LaTeX' two new font encodings are introduced: T8M and T8K. Encoding schemes follow latex font enconding guide. See ctan.org/pkg/georgian and tex.tsu,ge/files for documentation and examples. How to make new font package usable with this encoding contact to me – Levan Shoshiashvili Jun 12 '16 at 20:52
• @barbarabeeton I sent article descriebed font encodings for georgian and gergian package in 2013, but new editions of practex didnot come out – Levan Shoshiashvili Jun 12 '16 at 21:09

## 1 Answer

In order to use a font with (pdf)TeX, it is necessary to choose a suitable output encoding. Examples include OT1 (the default 128-slot text encoding), T1 (the most popular 256-slot text encoding for Western European languages), OML (a standard 128-slot mathematical encoding) and U (an unknown or 'raw' encoding typically used for symbol fonts).

For text encodings other than OT1 (which is the default encoding), output encodings are typically enabled by loading `fontenc` the relevant encoding(s) passed as options. For example,

``````\usepackage[T4,T5,T1]{fontenc}
``````

would enable the use of T4 (African Latin), T5 (Vietnamese) and T1 (the 'Cork' encoding for Western European scripts described above), in addition to OT1.

In theory, the designator 'T` indicates a 256-slot text encoding which satisfies certain conditions. In practice, not all 'T' encodings are fully compliant and some non-'T' encodings are.

Other designators for text and text symbol encodings include:

• 'TS' which indicates a text symbol encoding such as TS1.

• `L' which is theoretically for local encodings designed for use at a specific site. Again, however, reality does not always conform to the theory and some 'L' encodings are generally available without having acquired appropriate names. LY1 is one such example.

• 'X' which is used for text extended encodings such as the X2 encoding used to support T2A, T2B and T2C for Cyrillic.

• 'C' which is used for CJK encodings.

• 'E' which is intended for experimental encodings.

• 'U' which is used for unknown encodings, typically for 'one-off' cases such as Zapf Dingbats, where no other font is likely to use the same encoding.

An output encoding (except U) specifies which characters belong in which slots and, if relevant, how the characters in different slots are related. For example, that slot x contains a character which should replace a sequence consisting of the character in slot y followed by the character in slot z i.e. a ligature such as 'fi' in the T1 encoding which replaces 'f' directly followed by 'i'.

As explained in the manual for `fontenc`, for TeXnical reasons, any text encoding must satisfy certain formal requirements and support certain transformation patterns (e.g. mapping upper to lower case according to a standard table, using particular slots in certain ways, supporting certain ligatures and so on). That is, a text encoding cannot be created arbitrarily because TeX assumes that certain things will be true of any text encoding.

In addition, text encodings typically provide encoding-specific definitions of various macros, such as those to create accented characters.

The problem in this case is that `X.enc` is almost certainly not a defined text encoding so you cannot write `\usepackage[X]{fontenc}` and have things work.

Normally, the raw font encoding and the TeX output encodings differ and you would have something like

``````afm2tfm -p X.enc -t ec.enc ...
``````

to make a font usable with the T1 encoding.

To use your font with TeX, you therefore need either to create a suitable output encoding or to use an existing one. I hope that the author of georgian will write an answer saying something about the use of the proposed encodings provided by that package.

• Perhaps add that the key reason for all of this is hyphenation. I suspect there are only UTF-8 patterns for Georgian. – Joseph Wright Jun 12 '16 at 16:37
• @JosephWright I'm not sure I understand the connection with hyphenation patterns well in order to explain it, to be honest. You need an output encoding of some kind even without hyphenation, don't you? For symbol fonts, that encoding is trivial, but it still has to be specified. For text fonts, you need the encoding to conform to certain requirements. Without an output encoding, how do you get anything regardless of hyphenation? – cfr Jun 12 '16 at 18:42
• I'm author of ctan.org/pkg/georgian hyphenation also works by hyph-utf8 package out of box since TL2013 and with minor modification of 'lanuages.ini' file in miktex (works with pdflatex and lualatex xelatex.. input text needs to be utf-8) – Levan Shoshiashvili Jun 12 '16 at 20:47
• @LevanShoshiashvili Interesting. So this is presumably possible. Your package is not in TeX Live. (At least, not according to CTAN.) Do you know why? – cfr Jun 12 '16 at 21:18
• I know, but don't know why. It is optional for miktex, but miktex misses georgian for hyph-utf8 . So nearly every month i get email 'ho to install georgian in debian,suse..ect' :). and 'how to' which works for one linux distro does not for another. I myself use slackware – Levan Shoshiashvili Jun 12 '16 at 21:22