1

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.

Giorgi
  • 1,069
  • 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
  • This is ordinary font, for georgian letters, with some symbols. The errors are about those extra files, which are located in tex folder. I can easily use this font as ttf with xelatex, but I want to know how to make Tex font. Isn't there any normal manual for this? – Giorgi Jun 12 '16 at 14:39
  • You've not said what the errors are. You need to give the exact text of an error message. If the errors occur when you try to use the font, you need to give a minimal document which demonstrates how you are trying to use it. And you need to use an appropriate encoding for the output of afm2tfm such that you can use the encoding with LaTeX. – cfr Jun 12 '16 at 15:21
  • Actually, I just realised what you said. Is there a suitable encoding for Georgian? If not then, short of creating one from scratch, this can't be done. – cfr Jun 12 '16 at 15:29
  • Georgian letters are in utf-8 and utf-16 encodings. 'normal' is just an expression, which just mean that it is useful. I didn't write errors because they are not 'specific type', you will get same errors if you just put those files in the given directoris and try to run the new font, it will say 'cannot find X.def file' and so on. – Giorgi Jun 12 '16 at 15:57
  • There's no encoding for Georgian as I explain below. Unless you write a new one, you just can't typeset Georgian TeX with traditional engines. It works for XeTeX, so I'd stick with that. – cfr Jun 12 '16 at 16:31
  • there was an article on georgian fonts in tugboat that may interest you. there also seem to be a couple of packages on ctan; one of them, mxedruli, is also on tex live. since there is a babel-georgian option, that may help identify an encoding (or whether there is one). – barbara beeton Jun 12 '16 at 17:12
  • @barbarabeeton The Babel file, apart from the unicode encodings, mentions T8M, but I'm not sure what that is or whether it exists. There's a t8m.dat etc. as part of the hyph-utf8 stuff, but nothing which I recognise as an output encoding. (That I don't recognise it doesn't mean much, though.) – cfr Jun 12 '16 at 19:20
  • I know about it, but it doesn't tell me how to make font. Your answer is interesting and informational. I agree that this is not practical, but I am interested how it is done. – Giorgi Jun 12 '16 at 19:36
  • 1
    For Georgian see http://tex.tsu.ge ...Contact author (me) by Email :) – Levan Shoshiashvili Jun 12 '16 at 20:42
  • 1
    For georgian in 'Classic TeX/LaTeX' two new font encodings are introduced: T8M and T8K. Encoding schemes follow latex font enconding guide. See https://www.ctan.org/pkg/georgian and http://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
  • 1
    @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
  • @LevanShoshiashvili -- if practex is not going to publish your article, you might consider tugboat. – barbara beeton Jun 12 '16 at 21:30
  • @barbarabeeton Thanks, i thought tugboat is more TeXnical(it is about internals of tex engines), then for articles describing some package. I'll try :) – Levan Shoshiashvili Jun 12 '16 at 22:02
  • @Giorgi you should see the discussion below my answer. Parts of it are addressed to you but I'm not sure whether pinging you there works. – cfr Jun 12 '16 at 22:05
  • @LevanShoshiashvili -- all of tugboat (except for the last year) is open to everyone. go to http://www.tug.org/TUGboat/ and click on the link to contents by topic. browse. you'll find lots of articles on topics such as fonts, question and answer sessions with knuth, interviews, book reviews, anything even quite remotely related to typography or printing. even cartoons. and we keep hoping someone will take our challenge to write some really good elementary pieces. not just for experts! – barbara beeton Jun 12 '16 at 23:47

1 Answers1

6

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.

cfr
  • 198,882
  • 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 https://www.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
  • @LevanShoshiashvili I think you should write an answer. I'm not sure whether to delete this or not. I'm inclined not as it does explain why the OP's attempts don't work. But I'm not sure. If you could write an answer the OP could accept, I'm inclined to leave this as supplementary information. Otherwise, I don't like it being the only answer. – cfr Jun 12 '16 at 21:33
  • @Giorgi As i mentioned there are two font encodings T8M, T8K since all georgian glyphs dont fit in one encoding (>256). after opening unicode font in fontforge, you need to reencode it in T8m or T8K. Or you can use unicode fonts and reencode them on fly, using reencodefont command in fonts map file, but you need metrics (tfm) files reencoded in T8M, T8K anyway. So just reencode font in fontforge. Ater that do steps you did, just use t8n.enc and t8k.enc files(included in package). next step is to write md files for new font. – Levan Shoshiashvili Jun 12 '16 at 21:39
  • Finally write .sty file where you redefine cmr cmt and cms standard fonts with your own fonts. See all font and fd,.sty files in appropriate directories in texmf tree. See georgian package how it is done. – Levan Shoshiashvili Jun 12 '16 at 21:39
  • Have you asked on the TL list about inclusion? I looked at your package and it is somewhat confusing in places. I don't know why you have so many copies of the .map file or why they are in the sub-directories they are. You can't have separate files for pdftex and pdflatex, for example, because they are the same engine. LaTeX is just a specific format. pdfLaTeX is just pdfTeX with the LaTeX format. And none of your .map files should be under updmap period. Probably you just need one .map under dvips/georgian/. Including updmap.cfg is a big red flag, too. – cfr Jun 12 '16 at 21:39
  • yes, I need to clean up some extra things in package. When i was looking for how to do and where to place some years ago there was different info in different 'how to's. 'updmap.cfg' is just an example since i suggest everething needs to go in local texmf. If language, font encoding files and font will be included in distros no need to updmap.cfg – Levan Shoshiashvili Jun 12 '16 at 21:44
  • @LevanShoshiashvili Yes, but it is a red flag if you are packaging stuff for TL because it is an obvious conflict with an existing file name. In general, a package which includes a file with a conflicting name (i.e. the same name as an existing file in TL) is going to be rejected pretty much automatically. Unless somebody looks really carefully and creates a dedicated script to redo your package into suitable form. Something which the bog-standard script can install for TL is more likely to get into TL since it needs much less attention. – cfr Jun 12 '16 at 21:47
  • @LevanShoshiashvili Giorgi ought not need to redefine cmr etc. You should provide a fallback font for the encodings. Font packages should then just define new font families and provide the tools required to use them. Otherwise every font package on CTAN would be redefining cmr etc. for each encoding they used. The fallback font s is the guarantee. – cfr Jun 12 '16 at 21:50
  • Ups.... you are right.. i meant ' \renewcommand\rmdefault{giogris_font_rm}', ' \renewcommand\ttdefault{giorgis_font_tt}' and ' \renewcommand*\sfdefault{giorgis_font_sf}' ....I'll add some chages in package to make it compatible with TL tree – Levan Shoshiashvili Jun 12 '16 at 21:54
  • for updmap.cfg i followed this https://www.tug.org/fonts/fontinstall-personal.html 3. and 4. – Levan Shoshiashvili Jun 12 '16 at 22:13
  • @LevanShoshiashvili Don't ;). – cfr Jun 12 '16 at 22:16
  • you say in comments 'The --enable stuff is no longer the recommended method for TL. I think it is now second choice as a method, at least, since it has some disadvantages. Creating (if necessary) and/or editing the relevant .cfg is preferable.' In this discussion http://tex.stackexchange.com/questions/88423/manual-font-installation . So how to tell TL about new font? I need to create cfg files for fonts? – Levan Shoshiashvili Jun 12 '16 at 22:20
  • @LevanShoshiashvili That's what egreg told me, despite the header of the default updmap.cfg. The preferred method is to list the font maps in $(kpsewhich -var TEXMFLOCAL)/web2c/updmap.cfg and then run updmap-sys without options. This has various advantages. One is that your fonts will almost certainly work out-of-the-box with a new edition of TL (e.g. I just installed 2016 and didn't need to do anything, except that I checked). – cfr Jun 12 '16 at 22:59
  • So user need o add new fotn map entry in updmap.cfg by hand. Right? and then run updmap-sys . i noticed another problem in SUSE. In suse i need to run updmap-sys --syncwithtrees otherwise new font map is not detected. – Levan Shoshiashvili Jun 12 '16 at 23:05
  • @LevanShoshiashvili Yes. Or create the file if this is the first font they are installing. Did you run mktexlsr or texhash before updmap-sys? – cfr Jun 12 '16 at 23:13
  • yes,but updmap-sys was not enough. Maybe it is suse's TL package. It seems there are font map entries, but not fontmaps and fonts itself..."Or create the file.." what file? p.s. I try to avoid editing system wide files. – Levan Shoshiashvili Jun 12 '16 at 23:31
  • @LevanShoshiashvili You need to create $(kpsewhich -var TEXMFLOCAL)/web2c/updmap.cfg if it does not exist. I don't know what Suse does. With upstream, updating the filename database and running updmap-sys is enough. But Suse's TL may be older or may have been adapted by the packagers in various ways. – cfr Jun 13 '16 at 00:15
  • What does "128 slot" and "256 slot" mean? – user12711 Jul 09 '20 at 22:57