groff
[Top][All Lists]
Advanced

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

[Groff] new requests fschar, schar, and rfschar


From: Werner LEMBERG
Subject: [Groff] new requests fschar, schar, and rfschar
Date: Tue, 12 Nov 2002 09:38:50 +0100 (CET)

I've added the `fschar' and `schar' requests to fine-tune glyph
searching.  `rfschar' removes a glyph defined with fschar.

Reason for adding them is the new SC special font (cmtex10) for DVI
output, providing some fixed-width symbol glyphs.  To make it special
for CW and CWI I've added

  .fspecial CW SC
  .fspecial CWI SC

to dvi.tmac.  Now consider glyph \[va] (an up-down arrow).  It is
available in the normal special font S but not in SC.  It can easily
be simulated with an up and a down arrow as \o'\[ua]\[da]'.  Saying

  .fschar CW \[va] \o'\[ua]\[da]'
  .fschar CWI \[va] \o'\[ua]\[da]'

I get the desired effect: The simulated \[va] glyph is used for fonts
CW and CWI, and the real \[va] glyph from S otherwise.


    Werner

======================================================================

>From groff.texinfo:

   Here the exact rules how `gtroff' searches a given symbol:

   * If the symbol has been defined with the `char' request, use it.
     This hides a symbol with the same name in the current font.

   * Check the current font.

   * If the symbol has been defined with the `fchar' request, use it.

   * Check whether the current font has a font-specific list of special
     fonts; test all fonts in the order of appearance in the last
     `fspecial' call if appropriate.

   * If the symbol has been defined with the `fschar' request for the
     current font, use it.

   * Check all fonts in the order of appearance in the last `special'
     call.

   * If the symbol has been defined with the `schar' request, use it.

   * As a last resort, consult all fonts loaded up to now for special
     fonts and check them, starting with the lowest font number.  Note
     that this can sometimes lead to surprising results since the
     `fonts' line in the `DESC' file often contains empty positions
     which are filled later on.  For example, consider the following:


          fonts 3 0 0 FOO

     This mounts font `foo' at font position 3.  We assume that `FOO'
     is a special font, containing glyph `foo', and that no font has
     been loaded yet.  The line


          .fspecial BAR BAZ

     makes font `BAZ' special only if font `BAR' is active.  We further
     assume that `BAZ' is really a special font, i.e., the font
     description file contains the `special' keyword, and that it also
     contains glyph `foo' with a special shape fitting to font `BAR'.
     After executing `fspecial', font `BAR' is loaded at font
     position 1, and `BAZ' at position 2.

     We now switch to a new font `XXX', trying to access glyph `foo'
     which is assumed to be missing.  There are neither font-specific
     special fonts for `XXX' nor any other fonts made special with the
     `special' request, so `gtroff' starts the search for special fonts
     in the list of already mounted fonts, with increasing font
     positions.  Consequently, it finds `BAZ' before `FOO' even for
     `XXX' which is not the intended behaviour.

reply via email to

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