ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Side effect of virtual fonts
@ 2011-04-04 15:50 Ulrike Fischer
  0 siblings, 0 replies; only message in thread
From: Ulrike Fischer @ 2011-04-04 15:50 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-04 15:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-04 15:50 Side effect of virtual fonts Ulrike Fischer

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).