[comp.text.tex] questions about creating virtual font files

S.P.Q.Rahtz@ecs.soton.ac.uk (Sebastian Rahtz) (10/12/90)

Is there anyone out there who actually uses virtual font files,
other than, for instance, the automatic ones created by Rokicki's
afm2tfm? I am trying to write a .vpl file to make up the new suggested
256 char TeX font layout from a PostScript font, but my inexperience
is showing up. some questions:

 1) If we copy an example from Knuth's  article on virtual fonts, the
    following code seems reasonable:

    (CHARACTER O 337 (comment just an S)
     ( MAP
       (SETCHAR O 123)))
    which just sets a 123 if I ask for a 337, taking over the
    dimensions of 123. But this:
 (CHARACTER O 337 (comment Germandbls)
 ( MAP
    (SETCHAR O 123)
    (SETCHAR O 123)))
  which should set a double S when 337 is used, duly does that but the
  SS has no width. yes, maybe this is reasonable, but can someone tell
  me when metrics are taken from the base TFM and when they are set to
  nothing (as apparently in this case)?

2) OK, so I want a Z with a dot over it for position 273. so something
   like this answers the needs:
  (CHARACTER O 273 (comment zdotover)
    (CHARWD R 444)
    (CHARHT R 448)
    (MAP
      (SETCHAR O 172)
      (MOVERIGHT R -222)
      (MOVEUP R 20)
      (SETCHAR O 012)
      )
    )

  BUT, is there an easy way, other than visual testing, to determine
  the amount to step backwards and up? how can I derive it
  automatically from the metric for `z'? am I being either naive about
  typography, or missing something everyone else knows already?

3) can one of you character gurus tell me about the `ij' ligature? do
   the letters actually join up? 

Sebastian Rahtz

marcel@cs.caltech.edu (Marcel van der Goot) (10/16/90)

In <22927.9010121655@manutius.ecs.soton.ac.uk> Sebastian Rahtz
(S.P.Q.Rahtz@ecs.soton.ac.uk) asks (among other, more complicated things):

> 3) can one of you character gurus tell me about the `ij' ligature? do
>    the letters actually join up?

Now, I don't pretend to be a character guru, and I'm not quite sure
if this is what you refer to:

In Dutch the combination `ij' is probably best considered a single letter.
(proof: Unlike other combinations of letters with a single sound, such
as `ch' and `oe', it is always capitalized as `IJ', never as `Ij'.)
For TeX purposes it should indeed be considered a ligature. In a roman
font it is printed as just the combination `i' `j', but in some
other, italic, fonts, there is a single symbol. When written by hand
it looks like (in comp. modern) {\it\"y} (I have never seen anyone
write `ij' by hand). However, it never looks like {\sl\"y}; i.e.,
the tail of the y is one with a curve, not a slanted one. I have
indeed seen books where the `ij' was a single letter. I'm afraid
you'll have to find a Dutch book that contains italic text for this.

(I have here
  Robert Byron, William Shetter:
  Een goed begin ---: a contemporary Dutch reader
  The Hague, Martinus Nijhoff (1978)
from the Caltech library --- if they have it {\sl there} they might
have it in your local library as well. It has an `ij' like {\it\"y} and
a `y' like {\sl y}.)

I'd say that for non-Dutch text, you would not want to turn `ij' into
this ligature since there it probably just stands for an `i' followed
by a `j'.

Aside: On mechanical Dutch typewriters they often had a single key
with the ligature `ij' to improve the spacing of those two narrow characters
in a fixed-width font.

Another aside: They used to build dot matrix printers where they had
saved memory by lowering the `j' so that the dot was at x-height instead
of above the line. The `i' however had the dot in the normal place. As
a result you could not print Dutch on those printers.


Now, to add more to Sebastian's questions: I would like to print a
document containing both English and Dutch paragraphs. For the Dutch
parts I would like to make the `ij' into a ligature, to make input {``}
produce a lowered {''}, and to add a ligature for `fj' (you mean,
Knuth's dictionary doesn't contain ``fjord''?!?). Is there a way to
do that without having to load a whole separate set of fonts for
the Dutch text? Are virtual fonts the way to do this, or is there
something simpler, just with macros? Does one need to understand
MetaFont to use virtual fonts, or are the two unrelated?


					Marcel van der Goot
					marcel@cs.caltech.edu

jaap@mtxinu.COM (Jaap Akkerhuis) (10/17/90)

In article <1990Oct15.235715.17666@nntp-server.caltech.edu> marcel@cs.caltech.edu writes:
 > In <22927.9010121655@manutius.ecs.soton.ac.uk> Sebastian Rahtz
 > (S.P.Q.Rahtz@ecs.soton.ac.uk) asks (among other, more complicated things):
 > 
 > > 3) can one of you character gurus tell me about the `ij' ligature? do
 > >    the letters actually join up?
 > 
 > Now, I don't pretend to be a character guru, and I'm not quite sure
 > if this is what you refer to:
 > 
 > In Dutch the combination `ij' is probably best considered a single letter.
 > (proof: Unlike other combinations of letters with a single sound, such
 > as `ch' and `oe', it is always capitalized as `IJ', never as `Ij'.)
 > For TeX purposes it should indeed be considered a ligature. ...

But not in all cases. For sorting dutch words you have the option
not to  threat it as a special character. Depending on the publisher
it is considered to be sorted under i or under y. According some
people there are actually three different possibilities for a Dutch
character set.

	jaap

tml@tik.vtt.fi (Tor Lillqvist) (10/17/90)

Sebastian Rahtz writes:

   Is there anyone out there who actually uses virtual font files,
   other than, for instance, the automatic ones created by Rokicki's
   afm2tfm? 

I don't use them yet... but soon.

     can someone tell me when metrics are taken from the base TFM and
     when they are set to nothing (as apparently in this case)?

As far as know, the vptovf program does not read the tfm files of the
mapped-to fonts.  It thus cannot copy any default metrics.  You have
to copy all the nonzero charwd, charht and chardp values yourself...

   2) OK, so I want a Z with a dot over it for position 273.  BUT, is
     there an easy way, other than visual testing, to determine the
     amount to step backwards and up? how can I derive it
     automatically from the metric for `z'?

Use the same algorithm as TeX does, see make_accent etc.  However, I
have read that some people find the default placng of accents ugly for
languages that use ``accented'' letters a lot, like Swedish and
Finnish.  I don't know...
--
Tor Lillqvist,
working, but not speaking, for the Technical Research Centre of Finland

spqr@ecs.soton.ac.uk (Sebastian Rahtz) (10/20/90)

In article <1990Oct15.235715.17666@nntp-server.caltech.edu> marcel@cs.caltech.edu (Marcel van der Goot) writes:

   In Dutch the combination `ij' is probably best considered a single
   letter.
thanks for the thoughts. I think i see what to do

   parts I would like to make the `ij' into a ligature, to make input {``}
   produce a lowered {''}, and to add a ligature for `fj' (you mean,
   Knuth's dictionary doesn't contain ``fjord''?!?). Is there a way to
   do that without having to load a whole separate set of fonts for
   the Dutch text? Are virtual fonts the way to do this, or is there
   something simpler, just with macros? Does one need to understand
   MetaFont to use virtual fonts, or are the two unrelated?
virtual fonts *will* do what you want, and no, you dont need to know
Metafont. Take your chosen font's TFM file, run TFtoPL, called it
<newfont>.vpl and start with that as the basis of your hacking.
Knuth's article in Tugboat at the start of this year contains
sufficient examples, I have found

Sebastian



--
Sebastian Rahtz                        S.Rahtz@uk.ac.soton.ecs (JANET)
Computer Science                       S.Rahtz@ecs.soton.ac.uk (Bitnet)
Southampton S09 5NH, UK                S.Rahtz@sot-ecs.uucp    (uucp)

spqr@ecs.soton.ac.uk (Sebastian Rahtz) (10/20/90)

In article <TML.90Oct16205707@hemuli.tik.vtt.fi> tml@tik.vtt.fi (Tor Lillqvist) writes:

   As far as know, the vptovf program does not read the tfm files of the
   mapped-to fonts.  It thus cannot copy any default metrics.  You have
   to copy all the nonzero charwd, charht and chardp values
well, in that case Knuth's example in Tugboat is misleading. I'm prepared
to believe it is, but wanted confirmation


      2) OK, so I want a Z with a dot over it for position 273.  BUT, is
	there an easy way, other than visual testing, to determine the
	amount to step backwards and up? how can I derive it
	automatically from the metric for `z'?

   Use the same algorithm as TeX does, see make_accent etc.  However, I
   have read that some people find the default placng of accents ugly for
   languages that use ``accented'' letters a lot, like Swedish and
   Finnish.  I don't know...

I solved my own problem by observing that Adobe metric files always
use the same amount (in a given font) to move back and up to place an
accent over a letter. By using solely their rules and composite
characters, at least it shifts the blame from TeX to Adobe!

sebastian

--
Sebastian Rahtz                        S.Rahtz@uk.ac.soton.ecs (JANET)
Computer Science                       S.Rahtz@ecs.soton.ac.uk (Bitnet)
Southampton S09 5NH, UK                S.Rahtz@sot-ecs.uucp    (uucp)