Hi, it seems there go something wrong with layers. \definelayer[test-layer][width=\paperwidth,height=\paperheight] \setlayer[test-layer][preset=middle]{why is this text not visible?} \setlayerframed [test-layer] % [preset=topright] [width=5cm,height=3cm,background=color,backgroundcolor=red] {why is this text not visible?} \defineoverlay[test-overlay][\framed{test-overlay}] \setupbackgrounds[page][background={test-layer,test-overlay}] \starttext \page[empty] \stoptext Greeting Andreas
Am 01.02.2011 um 11:43 schrieb Andreas Harder:
Hi,
it seems there go something wrong with layers.
With the last beta context postpones font loading till \starttext. As there is no font loaded the layer content is not visible, move \starttext at the begin of the file and you can see the layer text. Wolfgang
Am 01.02.2011 um 12:11 schrieb Wolfgang Schuster:
Am 01.02.2011 um 11:43 schrieb Andreas Harder:
Hi,
it seems there go something wrong with layers.
With the last beta context postpones font loading till \starttext.
As there is no font loaded the layer content is not visible, move \starttext at the begin of the file and you can see the layer text.
Thanks Wolfgang, I forgot about that. Andreas
Am 01.02.2011 um 13:33 schrieb Andreas Harder:
Am 01.02.2011 um 12:11 schrieb Wolfgang Schuster:
Am 01.02.2011 um 11:43 schrieb Andreas Harder:
Hi,
it seems there go something wrong with layers.
With the last beta context postpones font loading till \starttext.
As there is no font loaded the layer content is not visible, move \starttext at the begin of the file and you can see the layer text.
Thanks Wolfgang, I forgot about that.
Even though it’s not so obvious because other commands like \setupheadertexts don’t have this problem, for all the curious people here is a small example where you can see the problem in another context. \starttext \tt\setbox0=\hbox{boxed text}\ss unboxed text \box0 \stoptext You would now expect both texts are printed sans serif but the first was saved in a box and use not the font which was active when you stored it in the box, the same happens with \setlayer because the commands stores the content too in a \hbox and since there was no font available when you put it in the box nothing is shown. Besides moving \setlayer after \starttext you can just load a font before the \setlayer settings, e.g. \setupbodyfont[modern] \definelayer[…] \setlayer[…]{…} \starttext … \stoptext or you use \startproduct which is normally always written as first line and acts \starttext which preloads then the Latin Modern fonts, e.g. \startproduct \definelayer[…] \setlayer[…]{…} \startbodymatter … \stopbodymatter \stopproduct The bodymatter enviroment isn’t necessary here because it’s always enabled when you other sectionblockenvironment is used but it’s useful to have something which separates the preamble from the text. Wolfgang
On Wed, 2 Feb 2011, Wolfgang Schuster wrote:
Besides moving \setlayer after \starttext you can just load a font before the \setlayer settings, e.g.
\setupbodyfont[modern] \definelayer[…] \setlayer[…]{…} \starttext … \stoptext
Perhaps a redirection like \setlayer[...]{\setups{layersetup}} might also work (untested).
or you use \startproduct which is normally always written as first line and acts \starttext which preloads then the Latin Modern fonts, e.g.
There is no point in not loading the fonts in the begining if one would then have to come up with clever ways to force loading of a font. I hope that there is a more robust solution so that \setuplayer[...]{...} \starttext ... \stoptext just works.
The bodymatter enviroment isn’t necessary here because it’s always enabled when you other sectionblockenvironment is used but it’s useful to have something which separates the preamble from the text.
One could also use \starttext ... \stoptext here. Aditya
On 2-2-2011 4:07, Aditya Mahajan wrote:
There is no point in not loading the fonts in the begining if one would then have to come up with clever ways to force loading of a font. I hope that there is a more robust solution so that
well, it depends ... how many use lm for documents? as Wolfgang mentioned, setting a layer will use the current font which might not be the same as one sets later; btw, setting the size of style will trigger a load ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, 2 Feb 2011, Hans Hagen wrote:
On 2-2-2011 4:07, Aditya Mahajan wrote:
There is no point in not loading the fonts in the begining if one would then have to come up with clever ways to force loading of a font. I hope that there is a more robust solution so that
well, it depends ... how many use lm for documents?
Don't know, but I am pretty sure that layers are used all over the place. In most of my documents, I set the layers in an evironment file, which is often loaded before \starttext.
as Wolfgang mentioned, setting a layer will use the current font which might not be the same as one sets later;
Oh, that is a bigger problem. That means that the first thing in a style should be font loading... if nothing else then just \setupbodyfont[11pt]. Perhaps \setlayer (or even \hbox!!) should issue a warning if the fonts have not been loaded yet. Aditya
On 2-2-2011 5:46, Aditya Mahajan wrote:
Perhaps \setlayer (or even \hbox!!) should issue a warning if the fonts have not been loaded yet.
hm, that should be doable maybe we can hook that into everyhbox / everyvbox in general, setlayer is not so much preamble as content code .. we could think of some extra wrappers, like \startstyledefinitions \stopstyledefinitions \startcontentdefinitions \stopcontentdefinitions \starttext \stoptext although fonts are not yet loaded, ex and em do work because nullfont gets the 12pt lm values (one can add \setupbodyfont[modern] to a cont-sys.mkiv of course) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2-2-2011 5:46, Aditya Mahajan wrote:
On Wed, 2 Feb 2011, Hans Hagen wrote:
On 2-2-2011 4:07, Aditya Mahajan wrote:
There is no point in not loading the fonts in the begining if one would then have to come up with clever ways to force loading of a font. I hope that there is a more robust solution so that
well, it depends ... how many use lm for documents?
Don't know, but I am pretty sure that layers are used all over the place. In most of my documents, I set the layers in an evironment file, which is often loaded before \starttext.
as Wolfgang mentioned, setting a layer will use the current font which might not be the same as one sets later;
Oh, that is a bigger problem. That means that the first thing in a style should be font loading... if nothing else then just \setupbodyfont[11pt].
Perhaps \setlayer (or even \hbox!!) should issue a warning if the fonts have not been loaded yet.
How about: \unprotect \def\dozerostagepreloadfonts {\definedfont[\s!file:lmmono10-regular sa 1]} \def\zerostagepreloadfonts {\writestatus\m!fonts{beware: no fonts are loaded yet so content will not show up}% \glet\zerostagepreloadfonts\dozerostagepreloadfonts \zerostagepreloadfonts} \everyhbox{\zerostagepreloadfonts} \everyvbox{\zerostagepreloadfonts} \def\resetpreloadfonts {\global\let\zerostagepreloadfonts \relax \global\let\firststagepreloadfonts \relax \global\let\secondstagepreloadfonts\relax \global\let\thirdstagepreloadfonts \relax \global\let\fourthstagepreloadfonts\relax \global\everyhbox\emptytoks \global\everyvbox\emptytoks \resetnullfont} \protect \setbox0\hbox{xxx} \starttext test \box0 \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 02.02.2011 um 16:07 schrieb Aditya Mahajan:
The bodymatter enviroment isn’t necessary here because it’s always enabled when you other sectionblockenvironment is used but it’s useful to have something which separates the preamble from the text.
One could also use \starttext ... \stoptext here.
I don’t think \starttext after \startproduct is good style. Wolfgang
participants (4)
-
Aditya Mahajan
-
Andreas Harder
-
Hans Hagen
-
Wolfgang Schuster