4

I created a hobby font with metafont. I would like to include some accents in the font, but I am not sure what is the standard way for accomplishing that (gogle was not very helpful), so that the font works with LaTeX (pdflatex, if needs be).

  1. How can I load the font in LaTeX, so that it is used for characters which it defines, and some fallback font (with warning) is used for the rest? (in plain, I do just \font\myFont=myFont \myFont, but characters which are not defined are not typeset at all)

  2. How to define shapes of accents, placed atop glyphs with \', ...? I imagine this has to do with font encodings, such as T1?

  3. I found virtual fonts HOWTO, which only mentions creating virtual font from PS fonts. Can I use metafont-generated fonts as well?

  4. Do I need virtual fonts, or is there an easier alternative?

  5. EDIT: I am considering using approach (and some scripts) from Lilypond: trace metafont with mftrace, then use fontforge scripts to create an OpenType font. (it needs mf log reading hackery, but could work) If I include accents as combining characters in OTF, they will work automatically with XeTeX? It looks like the easiest now, am I just being eluded?

I am sorry if the questions are confused, I am new to fonts. Thanks for any pointers --

PS: I tried loading the font with XeLaTeX+fontspec but I get (ignota.tfm is in the current dir):

fontspec.cfg loaded.
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))
! Undefined control sequence.
\zf@set@font@type ...onttype \zf@basefont \zf@tfm 
                                                  \or \zf@atsuitrue \ifnum \...
l.4 \setmainfont{ignota}

PPS: everybody loves screenshots :-)

lorem ipsum

1
  • 1
    Do you want to use the font with XeLaTeX/LuaLaTeX or even with pdfLaTeX? You may use every OTF font with XeLaTeX/LuaLaTeX using e.g. fontspec. But to use a font with pdfLaTeX you need a fd file and a map file. See fntguide for more information about font definition files and font encodings. Accent combinations would be OT1, but you may add a virtual font to create a T1 font. See fontinstallationguide for information about virtual fonts. Nov 13, 2011 at 10:18

1 Answer 1

1

I found a partial solution meanwhile. Use the T1 (=Cork?) encoding which is 8-bit but sufficiently covers West/Central European languages (all I need now).

  1. Within the Metafont file, define characters as beginchar(##,...), where ## is number in the T1 encoding (e.g. here, pg. 23, or in tex256.enc), so for instance é is 233 and so on.

    Accented letters like ā not directly covered by T1 are composed from accents within the font (positions 0-11)

  2. Then, introduce the font to LaTeX (I used calligra.sty as template) and define a shorthand for activating it:

    % 10.0 is scaling factor; I guess I have something wrong as it is must be that big...
    \DeclareFontShape{T1}{ignota}{m}{n}{<->s*[10.0]ignota}{}
    \DeclareRobustCommand\ignota{
       \fontfamily{ignota}%
       \fontencoding{T1}%
       \selectfont
    }
    

    Generating metrics and bitmap fonts from ignota.mf is handled by kpathsea automatically.

The following text uses \usepackage[T1]{fontenc}, \usepackage[utf8x]{inputenc} and \usepackage{ignota}; the accents were all input as utf8 accented characters; work with both LaTeX and pdfLaTeX. Oh yes, I know it looks horrible typographically: rendered PDF

Still unclear to me: how to convert the font to outline font? Is running mftrace enough? Can I use the font with XeTeX directly, without other conversions?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .