Re: [luatex] Font expansion and virtual fonts

2018-02-09 Thread Hans Hagen

On 2/9/2018 3:34 PM, Patrick Gundlach wrote:



there is a test for the type being virtual .. can you omit that flag? just 
pretend it's a real font .. works here (i need to check why that test is there, 
it might not be needed in luatex any more)

so no type="virtual"



that was the culprit! Without that type="virtual" everything is fine.
ok, but we need to keep in mind that only glyphs get scaled, so not 
other virtual operators, but one can set the expansion factor to 0 for 
such shapes (instead of the default 1000);


i might remove the check (but need to test that for a while)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-


Re: [luatex] Font expansion and virtual fonts

2018-02-09 Thread Hans Hagen

On 2/9/2018 2:17 PM, Patrick Gundlach wrote:

some more details (before I make a test case)

the glyphs of the real font have an expansion_factor of -1 (post_linebreak) 
and the virtual fonts have an expansion_factor of 0 (so the question is: why).

The PDF also shows the expected differences:

real:

BT
/F11 9.9 Tf 0.99 0 0 1 28.346 804.543 Tm 
[<006d032503710371038e>-252<03fe038e03be037103190848>-252<07e707e807e907ea07eb07ec07ed07ee07ef07e6>]TJ
ET

virtual:

BT
/F13 9.9 Tf 1 0 0 1 28.346 804.543 Tm 
[<006d032503710371038e>-194<03fe038e03be037103190848>-195<07e707e807e907ea07eb07ec07ed07ee07ef07e6>]TJ
ET

(see the difference in the first argument to the Tm and the different kerning)

So I will investigate further where I messed up.
there is a test for the type being virtual .. can you omit that flag? 
just pretend it's a real font .. works here (i need to check why that 
test is there, it might not be needed in luatex any more)


so no type="virtual"

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-


Re: [luatex] Font expansion and virtual fonts

2018-02-09 Thread Patrick Gundlach

> Font expansion looks at a glyph and its properties. It actually is not 
> interested in what that glyph is and only the expansion factors and width 
> matters.

ok, then I will reduce my Lua files to a minimal variant. I will probably find 
my problem then.

Thank you!

   Patrick




Re: [luatex] Font expansion and virtual fonts

2018-02-09 Thread Hans Hagen

On 2/9/2018 10:34 AM, Patrick Gundlach wrote:

Hello all,

I always come up with vague question, so here is another one.

I use a virtual font to re-encode a real font and it seems that font expansion 
is not used anymore. Is this a well known thing? Both fonts (the real font and 
the virtual font) have the same parameters stretch/shrink/step, auto_expand and 
expansion_factor for each glyph.

(If no, then I will try to sort out and try to make a small test case)
Font expansion looks at a glyph and its properties. It actually is not 
interested in what that glyph is and only the expansion factors and 
width matters. So, you need to make sure that these properties are set. 
The multiplication factor travels with the glyphs after the paragraph 
has been calculated. In the (back)end what gets injected are just kerns 
based on these factors.


Hans

ps. The implementation is not the same as in pdftex in the sense that no 
extra pseudo fonts are generated, not are expansion factors calcualted 
on the fly each time (they are glyph property).



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-