[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MS-DOS line drawing font in Lout?

From: Valeriy E. Ushakov
Subject: Re: MS-DOS line drawing font in Lout?
Date: Fri, 15 Aug 1997 13:35:51 +0400

On Tue, Aug 12, 1997 at 03:01:30PM -0500, Frank Sergeant wrote:

>      Is there a font for Lout that matches the DOS extended
> character set (or whatever it is called)?  For example, the
> decimal code 201 represents the upper left corner for a
> double line box.  (I could easily translate the particular
> codes to any other values if that would help.)
>      Any ideas on how I might print out these DOS
> screen images with Lout?

Lout can use virtually any PostScript font.  So you have to find a
(monospaced) PostScript font with pseudographics and let Lout knows
about it.  You can grab some Windows font editor/converter and make a
Type1 font out of TTF font.

Making font known to Lout involves the following steps.

1.  AFM

    Lout needs an Adobe Font Metrics (AFM) file, to learn sizes of
    glyphs in the font.  This file usually accompanies the font.  If
    you are in the Windows world, metrics are strored in PFM format.
    There're two programs afm2pfm and pfm2afm that converts each
    format into the other.  Search for afm2pfm.zip (dos exe included,
    compiles on unix).

    Put the AFM file for the font in a directory where Lout can find
    it.  You can also supply -F flag to tell Lout where to look for
    AFM files in addition to standard directory.

2.  LCM

    Then you have to write an LCM file, Lout Character Map.  This
    file tells Lout what encoding you are using in your input file.
    In effect, conetents of this file is used to construct Encoding
    vector for the font.

    Each non-comment line in LCM file has an octal number, the same
    decimal number [NB: Jeff, why in the world do we have to duplicate
    this; computers can convert from ocatal to decimal and vice versa,
    let *them* do that] and a glyph name or "-none-" (w/out quotes of
    course). (This is oversimplification, you can tell many other
    things about encoding in LCM file, in your case the encoding
    vector is enough).

    Note, that to write this file you have to know how font glyphs are
    named.  For example, the glyph for capital latin letter A is named
    /A (I use PostScript convention here, slash introduces the literal
    name, it's not part of the name thou, the name is `A'); the glyph
    for open curly brace is /braceleft;  the glyph for russian small
    letter yu is /afii10096 (according to Adobe TR5013) etc...

    I don't know if there is any standard for names for line drawing
    character glyphs.  You can decode the Type1 font with t1utils
    (again, search with archie or one of web search engines) and see
    what glyph procedures are defined in the closed part of the font.

    You can also run prfont.ps from ghostscript distribution to see
    how glyphs are named.  It will print you three pages: first with
    0-127, second with 128-255, third (optional) with unecnoded glyphs
    if any.

    If the font already has the encoding you need, just get the
    /Encoding vector (it's in an open part of Type1 font) and turn it
    into an LCM.

    Put this file in the standard maps directory or add -C flag to tell
    Lout where your LCM file is.

3.  fontdef

    Now everything is ready to define a new font.  In mydefs.lt file
    (it's the most convenient place), write a `fontdef' statement.
    Suppose you font is named `Console', your AFM file is `CNS', your
    LCM file is `cp866'.  Then write

        fontdef Console Base { Console CNS cp866.LCM Recode }

4.  In your document:

        { Console Base 12p } @ Font { ... }

SY, Uwe
address@hidden                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]