Re: [NTG-context] background color, was: CMYK Color profile

2019-06-02 Thread Benjamin Koppe
When stupidity strikes, no one's safe.

Turns out \setupbackgrounds has an option called backgroundoffset, and
this is the solution. The not colorized part was the bleed part of the
document, so the background command would be:


\setupbackgrounds
[paper]
[
background=color,
backgroundcolor=blue,
backgroundoffset=\measured{bleed}
]

wonder if this would be handy in the DIN lang folder template in the
wiki, as most such brochures will supposingly have a colored
background...?




Am Samstag, den 01.06.2019, 05:48 +0200 schrieb Benjamin Koppe:
> Here's the example. It's basically the code from DIN Lang Folder in
> the
> Wiki plus a setupbackgrounds command. It works with `page` but fails
> to
> work with `paper`:
>
>
>
>
> %% This is a template for a Din lang Folder.
> %% The folded page of such a flyer is shorter (97mm) than the other
> pages (100mm)
>
> %% This measure shows how much shorter the folded page is.
> \definemeasure
> [shortfold]
> [3mm]
>
> %% The bleed measure is necessary if you have colored page
> backgrounds
> %% or images in the bleed.
> %% Different print shops need different bleeds.
> \definemeasure
> [bleed]
> [1mm]
>
> %% This is the pagesize of the final PDF.
> %% The bleed size is added two times to width and height.
> \definepapersize
> [A4-flyer]
> [width=\dimexpr297mm+2\measured{bleed}\relax,
>  height=\dimexpr210mm+2\measured{bleed}\relax]
>
> %% The size of a normal page.
> \definepapersize
> [flyer-page]
> [width=100mm,
>  height=210mm]
>
> %% The size of the folded page.
> \definepapersize
> [flyer-page-small]
> [width=\dimexpr100mm-\measure{shortfold}\relax,
>  height=210mm]
>
> %% Imposition: With the following two commands we arrange the six
> pages
> %% on the final PDF print sheet.
>
> %% The flyerpages are imposed on the printed sheet.
> \setuppapersize
> [flyer-page]
> [A4-flyer]
>
> %% The pages are arranged as a tryptichon.
> \setuparranging
> [TRYPTICHON]
>
> %% Because of the shorter folded page and the bleed the pages has
> %% to be shifted horizontally on the printed sheet.
> %% The values are calculated here.
> \definepageshift
> [flyer]
> [horizontal]
> [\dimexpr\measure{bleed}-\measured{shortfold}\relax,
> \measure{bleed},
>  \measure{bleed},
>  \dimexpr2\measured{shortfold}+\measured{bleed}\relax,
>  \measure{bleed},
> \dimexpr\measure{bleed}-\measured{shortfold}\relax
> ]
>
>
> %% The vertical pageshift is simple.
> \definepageshift
> [flyer]
> [vertical]
> [\measure{bleed}]
>
> \setuppageshift
> [paper]
> [flyer]
>
> %% We define some measures to construct the page layout.
> \definemeasure
> [small]
> [3mm]
>
> \definemeasure
> [big]
> [\measure{small}*2]
>
> %% Each page has a slightly different page layout.
> %% The named layouts (1. bracket) inherit values from other layouts
> %% which are assigned in the second bracket.
> \definelayout
> [first]
> [page]
> [page=flyer-page,
>  topspace=2\measured{big},
>  backspace=2\measured{small},
>  width=\dimexpr\paperwidth-4\measured{small}\relax,
>  height=\dimexpr\paperheight-4\measured{big}\relax]
>
> \definelayout
> [second]
> [first]
> [topspace=2\measured{big},
>  backspace=2\measured{small},
>  width=\dimexpr\paperwidth-2\measured{big}\relax]
>
> \definelayout
> [thirdandfourth]
> [second]
> [backspace=\measure{big},
>  width=\dimexpr\paperwidth-2\measured{big}\relax]
>
> \definelayout
> [fifthandsixth]
> [first]
> [backspace=\measure{big},
>  width=\dimexpr\paperwidth-2\measured{big}\relax]
>
> %% We assign the layouts to the pages.
> \definelayout [1] [first]
> \definelayout [2] [second]
> \definelayout [3] [thirdandfourth]
> \definelayout [4] [thirdandfourth]
> \definelayout [5] [fifthandsixth]
> \definelayout [6] [fifthandsixth]
>
>
> %% Some setups
> \setupmakeup [doublesided=no]
> \setuptolerance [verytolerant]
>
>
> %% We want to see page and layout borders.
> %% COMMENT THIS OUT BEFORE YOU PRINT!
> \showframe
>
> \setupbackgrounds[paper][background=color,backgroundcolor=blue]
>
> \starttext
> \starttitle[title={First page}]
> \input lorem
>   \stoptitle
>   \starttitle[title={Second page}]
> \input lorem
>
>   \stoptitle
>   \starttitle[title={Third page}]
> \input lorem
>
>   \stoptitle
>
>   \starttitle[title={Fourth page}]
> \setuppapersize [flyer-page-small] [A4-flyer]
> \input lorem
>
>   \stoptitle
>   \starttitle[title={Fifth page}]
> \input lorem
>
>   \stoptitle
>
>   \starttitle[title={Sixth page}]
>   \setuppapersize [flyer-page] [A4-flyer]
> \input lorem
>
>   \stoptitle
>
> \stoptext
>
> _
> __
> If your question is of interest to others as well, please add an
> entry to the Wiki!
>
> maillist : ntg-context@ntg.nl /
>

Re: [NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Hans Hagen

On 6/2/2019 3:07 PM, Pablo Rodriguez wrote:


Font expansion (as reported in
https://mailman.ntg.nl/pipermail/ntg-context/2019/095175.html).


font expansion is always slower (but i admit that i never use it)

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
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Pablo Rodriguez
On 6/2/19 2:12 PM, Hans Hagen wrote:
> On 6/2/2019 1:17 PM, Pablo Rodriguez wrote:
>> [...]
>> Compiling exactly the same XML sources (a book on ConTeXt in Spanish),
>> MkIV needs 40s and LMTX more than 52s.
>
> Hm. Is that the first time you compare a MKIV runs with an LMTX run for
> that document? I assume that you time multiple runs.

No, it isn’t the first time I compare and I time multiple runs.

>> This is the first time I get such a difference in compilation times.
>
> On the average LMTX should be faster than MKIV (and definitely not 20%
> slower). I assume it's regular luatex?

Sorry, this was my fault. I thought I was running luatex and it was
luajittex.

MkIV times with luatex are 51.x seconds, which is a tiny bit faster than
LMTX (52.x seconds). But this is perfectly normal.

>> I’m afraid I can’t be sure that output is the same, since different
>> spacing gives different page numbers.
>
> Not sure where that comes from. There are no fundamental changes wrr
> spacing.

Font expansion (as reported in
https://mailman.ntg.nl/pipermail/ntg-context/2019/095175.html).

>> I wonder whether this might be an issue.
> Hard to say without a MWE that exposes the same

Sorry for the noise,

Pablo
--
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Hans Hagen

On 6/2/2019 1:17 PM, Pablo Rodriguez wrote:

Dear list,

I have just installed latest betas for both MkIV and LMTX.

Compiling exactly the same XML sources (a book on ConTeXt in Spanish),
MkIV needs 40s and LMTX more than 52s.


Hm. Is that the first time you compare a MKIV runs with an LMTX run for 
that document? I assume that you time multiple runs.



This is the first time I get such a difference in compilation times.


On the average LMTX should be faster than MKIV (and definitely not 20% 
slower). I assume it's regular luatex?



I’m afraid I can’t be sure that output is the same, since different
spacing gives different page numbers.


Not sure where that comes from. There are no fundamental changes wrr 
spacing.



I wonder whether this might be an issue.

Hard to say without a MWE that exposes the same

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Broken kerning if hz is turned on?

2019-06-02 Thread Hans Hagen

On 6/2/2019 1:07 PM, Mikael P. Sundqvist wrote:
On Sun, Jun 2, 2019 at 12:47 PM Hans Hagen > wrote:


On 6/2/2019 8:36 AM, Mikael P. Sundqvist wrote:

 > I attach the output (latest lmtx). The word "endast" shows up as
"endas t".
that one is too weird indeed, might be a bug


I just tried with latest mkiv, and could not see the problem, so this 
might be some combination of lucida and lmtx. If so, that is good news, 
I guess.


Thanks for looking into it!

It has to do with values of threshold. I adapted the code a bit (next beta)

- a threshold is a pct of the font size (was designsize)
- i now default to 5pct which is .5 pt for a 10 pt font
- i also limit to max 10 pct and issue a warnign when > 5pct
- lucida might come out better with values < 5

I'm still considering to default to just .5pt but that is something I 
need to discuss with Wolfgang. Also a matter of testing.


These thresholds also relate to the size of the pdf file (small values 
means larger files). Now, another thing to keep in mind is that each 
expansion change (in one line there can be different expansion factors 
used) also triggeres a resync.


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
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Broken kerning if hz is turned on?

2019-06-02 Thread Pablo Rodriguez
On 6/2/19 12:47 PM, Hans Hagen wrote:
> On 6/2/2019 8:36 AM, Mikael P. Sundqvist wrote:
>
>> I attach the output (latest lmtx). The word "endast" shows up as "endas t".
> that one is too weird indeed, might be a bug

I get weird results using TeX Gyre Pagella with expansion.

I’m attaching a single page, typeset with LMTX
(http://pdf.ousia.tk/lmtx.pdf) and MkIV (http://pdf.ousia.tk/mkiv.pdf)
with a comparing file: http://pdf.ousia.tk/diff.pdf [I’m afraid the
total size is too much for attachments to the list]).

On the first line from the first paragraph, "pr" (from "proyecto") has
broken kerning, "al" has also broken kerning. At least "el" has wrong
kerning in the second line. On the third line, "de", "manera" (and I
would say "están" have kerning issues.

I think it is worth to print both pages and to check this on paper.

I don’t know what changed, but probably a default that outputs similar
text in LMTX to the one generated by MkIV would be great.

I hope it helps,

Pablo
--
http://www.ousia.tk

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Pablo Rodriguez
Dear list,

I have just installed latest betas for both MkIV and LMTX.

Compiling exactly the same XML sources (a book on ConTeXt in Spanish),
MkIV needs 40s and LMTX more than 52s.

This is the first time I get such a difference in compilation times.

I’m afraid I can’t be sure that output is the same, since different
spacing gives different page numbers.

I wonder whether this might be an issue.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Broken kerning if hz is turned on?

2019-06-02 Thread Hans Hagen

On 6/2/2019 8:36 AM, Mikael P. Sundqvist wrote:


I attach the output (latest lmtx). The word "endast" shows up as "endas t".

that one is too weird indeed, might be a bug

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
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Broken kerning if hz is turned on?

2019-06-02 Thread Hans Hagen

On 6/2/2019 8:36 AM, Mikael P. Sundqvist wrote:
On Mon, May 20, 2019 at 9:55 PM Wolfgang Schuster 
> wrote:


Mikael P. Sundqvist schrieb am 20.05.2019 um 21:41:
 > Hi,
 >
 > attached is the result of running latest lmtx on
 >
 >
\definefontfeature[default][default][protrusion=quality,expansion=quality]
\definefontfeature [default] [default] [threshold=20,expansion=quality]
 > \setupalign[hz]
 > \setupbodyfont[lucidaot]
 >
 > \starttext
 > Gauss öppnade med denna studie ett helt nytt fält inom matematiken,
 > det som
 > handlar om \emph{elliptiska funktioner} och \emph{modulära former}.
 > \stoptext
 >
 > What happens with the space between the characters in "studie", that
 > becomes "s tudie"? The spacing between some other characters are
also
 > off (ma tematiken), but not as much as in studie.
It's a problem with Lucida Opentype which lacks kerning (I reported the
same problem a while ago).

Wolfgang



Hi,

thank you Wolfgang (I just realized I only sent my thank you to you 
privately)!


Your threshold=20 solved that particular case. But look at the following 
example:


\definefontfeature[default][default][threshold=20,protrusion=quality,expansion=quality,lnum=yes,itlc=yes]

\setupalign[hz,hanging,line,height]

\definebodyfontenvironment[9bp][interlinespace=12bp]
\setupbodyfont[lucidaot,9bp]

\starttext
Gränsvärde föreligger i en inre punkt i definitionsmängden om och endast
om höger- och vänstergränsvärde existerar där och är lika.
\stoptext

I attach the output (latest lmtx). The word "endast" shows up as "endas t".

So, what does this threshold do? I can play with the 20. If I change it 
to 5 it looks better here (not perfect), but my document is approx. 250 
pages, so, I fear it will break somewhere else...


I hope that this does not mean that the Lucida font turns out to be 
useless :(
Lucida does without kerning so where in other fonts we have more of less 
tight boundingboxes + kerns, in lucida we have large side bearings and 
in that case widening works out a bit different visually (thicker 
vertical strokes as usual with hz + expanded built in side bearings), 
definitely on screen.


Now, one thing that happens in the backend is that glyphs are output as 
sequences and scaled as whole and occasionally the starting points get 
synchronized .. this is what threshold deals with.


Anyway, I might improve thinsg over time as in context lmtx we have a 
bit more control over matters.


One can argue if intercharacter kerns have to be stretched in other 
cases but in context that is configureable.


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
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___