ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Ulrike Fischer <news3@nililand.de>
To: ntg-context@ntg.nl
Subject: Side effect of virtual fonts
Date: Mon, 4 Apr 2011 17:50:27 +0200	[thread overview]
Message-ID: <1cbrkhhzb5t7j.dlg@nililand.de> (raw)

I made two copies of luatex-fonts-demo-vf-1.lua named
vf-a.lua  and vf-b.lua 

(The original file can be found in
\context-minimals\context\tex\texmf-context\tex\generic\context).


In both copies I changed the three fonts the virtual font uses as
basis to "Arial".

In vf-b.lua I added after the for-loop which manipulates the
caracters this code: 

        f1.characters[98].width=3000000
        f2.characters[98].width=3000000
        f3.characters[98].width=3000000

        f1.characters[97]= nil
        f2.characters[97]= nil
        f3.characters[97]= nil

It has the expected effect when I use vf-b: It enlarges the width of
the "b" and removes the "a" from the font.

But it not only affect the vf-b-font, it also affects vf-a: If I
load vf-a *after* vf-b, it also loose the "a" and the width of "b"
is changed.

In a older version of context, where the lua used
"fonts.tfm.readanddefine" instead of the new
"fonts.constructors.readanddefine" I got an side effect too, but
only on the "a".


My questions are

1. Why do I get the side effect only when f1, f2 and f3 call the
same font? Chance (because of the math random) or something else?

2. How can I make a virtual lua-font which is free of such side
effects? 

3. I got errors when I tried to use the old version of the virtual
font with the newest context. Is "fonts.tfm.readanddefine" now
deprecated?

-- 
Ulrike Fischer 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


                 reply	other threads:[~2011-04-04 15:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1cbrkhhzb5t7j.dlg@nililand.de \
    --to=news3@nililand.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).