Re: [NTG-context] [dev-context] palatino at 10.5pt bold not found when using project structure w/ MkIV
Am 06.07.2013 um 00:36 schrieb Sanjoy Mahajan
From what I can tell, the bold font is not found if all of the following are true:
1. using the Palatino typescript 2. setting the body font to 10.5pt (but 11pt or 12pt works fine) 3. using MkIV 4. using components (project structure)
Here's the minimal example (mytest.tex):
============================================================ \startmode[ascomponent] \startcomponent mytest \stopmode
\usetypescript[palatino][ec] \setupbodyfont[palatino,10.5pt]
\startmode[standalone] \starttext \stopmode
{\bold hello}
\startmode[standalone] \stoptext \stopmode
\startmode[ascomponent] \stopcomponent \stopmode ============================================================
Compile the two variants with:
context --mode=ascomponent --result=mytest-ascomponent.pdf mytest.tex context --mode=standalone --result=mytest-standalone.pdf mytest.tex
mytest-standalone.pdf is fine (the "hello" is in bold), but mytest-ascomponent.pdf has the "hello" in roman.
The particular roman font in mytest-ascomponent.pdf is also funny:
$ pdffonts mytest-ascomponent.pdf name type emb sub uni object ID ------------------------------------ ----------------- --- --- --- --------- TZNKGE+TeXGyrePagellaMath-Regular CID Type 0C yes yes yes 18 0
Why is it the math font?
(A slightly more complex example, using \project to include a project file, which includes an environment file that asks for palatino, produced the same problem. But the version above needs just one file, mytest.tex, so for simplicity I am describing the problem using it.)
What I think is happening is that, when running as a component, the typescript loading happens too late (after the equivalent of "\starttext"), and not everything gets set up properly. In support of that idea, if I shift the two environment lines ("\usetypescript ...") to just before the "{\bold hello}"---thus, after the "\starttext"---then the standalone version gets the same problem ("hello" in roman).
What puzzles me is that this problem shows up only with 10.5pt and using palatino. If I just use 10.5pt (i.e. w/ modern), then there's no problem. Or 11pt in Palatino is fine. There's also no problem using MkII.
I tested with the context in vanilla TL2013 and in Norbert's latest Debian packages--the problem happens in both.
1. Use the normal and not the developer list for such a question. 2. You can omit the \usetypescript line. 3. Move the \setupbodyfont setting *before* \startcomponent. 4. Add \definebodyfontenvironment[10.5pt] to your document. Wolfgang
Wolfgang, Thank you for all your solutions!
2. You can omit the \usetypescript line.
Good to know. Does the "palatino" keyword in \setupbodyfont automatically do that now (in Mark IV)? Should I wikify that bit of information (as MkIV-only)? (Since I don't really understand how the fonts work, I am hesitant to wikify much about it and put up incorrect information.)
3. Move the \setupbodyfont setting *before* \startcomponent.
Right, I found that by experiment. But how should you do that with projects? The \setupbodyfont is usually part of an environment file, which is loaded by the project file. Should the "\project project_file" line be placed before the "\startcomponent"? Like this: \project project_file \startcomponent component_name If that's the recommended way, I can update http://wiki.contextgarden.net/Project_structure
4. Add \definebodyfontenvironment[10.5pt] to your document.
Thanks, that fixes everything. On the theory of teaching a man to fish, how did you learn so much about making ConTeXt do just the right thing?
1. Use the normal and not the developer list for such a question.
I thought it was a bug (and it might be, though your definebodyfontenvironment solution makes me wonder if it is just my not knowing enough). In general, should bug reports go to the regular list? Best, -Sanjoy
Am 06.07.2013 um 12:33 schrieb Sanjoy Mahajan
Wolfgang,
Thank you for all your solutions!
2. You can omit the \usetypescript line.
Good to know. Does the "palatino" keyword in \setupbodyfont automatically do that now (in Mark IV)?
Should I wikify that bit of information (as MkIV-only)? (Since I don't really understand how the fonts work, I am hesitant to wikify much about it and put up incorrect information.)
The normal way to load a new font from a external typescript is \usetypescriptfile[<name>] \usetypescript[<name>] \setupbofyfont[<name>] In MkII you don’t need \usetypescriptfile to load the default fonts (times, palatino etc.) because context loads them when it generates the format but MkIV loads them the fonts are used to save memory. Because in many cases the name of the file is the same (with a “type-” prefix) as the font context tries to load the file itself when you enable the font with \setupbodyfont, even the \usetypescript call (the second argument isn’t needed because we aren’t restricted to 256 anymore with LuaTeX) isn’t necessary because this is also done by \setupbodyfont.
3. Move the \setupbodyfont setting *before* \startcomponent.
Right, I found that by experiment. But how should you do that with projects? The \setupbodyfont is usually part of an environment file, which is loaded by the project file. Should the "\project project_file" line be placed before the "\startcomponent"? Like this:
\project project_file \startcomponent component_name
If that's the recommended way, I can update http://wiki.contextgarden.net/Project_structure
You can do this. It’s always better to make the setup of the document before \starttext, startcomponent etc. because some values are set/reset with \starttext.
4. Add \definebodyfontenvironment[10.5pt] to your document.
Thanks, that fixes everything. On the theory of teaching a man to fish, how did you learn so much about making ConTeXt do just the right thing?
1. Use the normal and not the developer list for such a question.
I thought it was a bug (and it might be, though your definebodyfontenvironment solution makes me wonder if it is just my not knowing enough). In general, should bug reports go to the regular list?
The only things which are posted on the developer list nowadays are bug reports with possible fixes or extensions to the context programing language. Wolfgang
The only things which are posted on the developer list nowadays are bug reports with possible fixes or extensions to the context programing language.
Thanks. I am removing dev-context from the CC.
Should the "\project project_file" line be placed before the "\startcomponent"? Like this:
\project project_file \startcomponent component_name
If that's the recommended way, I can update http://wiki.contextgarden.net/Project_structure
You can do this. It’s always better to make the setup of the document before \starttext, startcomponent etc. because some values are set/reset with \starttext.
Alas, this order seems to trigger bug, which is that if the \project line comes first, then the component file is not compiled. Minimal example (mytest2.tex): \project testproject \startcomponent mytest2 \input knuth \stopcomponent testproject.tex is \startproject testproject \stopproject Then "context mytest2" doesn't ship any pdf pages. Below is the log file. (It works fine with the first two lines in mytest2.tex reversed.) (/usr/share/texmf/tex/context/base/cont-yes.mkiv ConTeXt ver: 2013.05.28 00:36 MKIV current fmt: 2013.7.4 int: english/english system > 'cont-new.mkiv' loaded (/usr/share/texmf/tex/context/base/cont-new.mkiv) system > files > jobname 'mytest2', input './mytest2', result 'mytest2' fonts > latin modern fonts are not preloaded languages > language 'en' is active (/home/sanjoy/sfse/test/mytest2.tex (testproject.tex{/usr/share/texmf/fonts/map/pdftex/context/mkiv-base.map} fonts > preloading latin modern fonts (second stage) fonts > typescripts > unknown library 'loc' {/usr/share/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/share/texmf/fonts/map/dvips/lm/lm-rm.map} fonts > 'fallback modern rm 12pt' is loaded ) ) ) system > files > start used files used files > 1: filename=cont-yes.mkiv filetype=tex foundname=/usr/share/texmf/tex/context/base/cont-yes.mkiv usedmethod=otherwise used files > 2: filename=cont-new.mkiv filetype=tex foundname=/usr/share/texmf/tex/context/base/cont-new.mkiv usedmethod=otherwise used files > 3: filename=lang-us.lua filetype=lua foundname=/usr/share/texmf/tex/context/patterns/lang-us.lua usedmethod=otherwise used files > 4: filename=/home/sanjoy/sfse/test/mytest2 foundname=/home/sanjoy/sfse/test/mytest2.tex usedmethod=qualified used files > 5: filename=testproject.tex foundname=testproject.tex usedmethod=direct used files > 6: filename=mkiv-base.map filetype=map format=map foundname=/usr/share/texmf/fonts/map/pdftex/context/mkiv-base.map usedmethod=database used files > 7: filename=lm.lfg filetype=tex foundname=/usr/share/texmf/tex/context/fonts/lm.lfg usedmethod=otherwise used files > 8: filename=lm-math.lfg filetype=tex foundname=/usr/share/texmf/tex/context/fonts/lm-math.lfg usedmethod=otherwise used files > 9: filename=lm-math.map filetype=map format=map foundname=/usr/share/texmf/fonts/map/dvips/lm/lm-math.map usedmethod=database used files > 10: filename=lm-rm.map filetype=map format=map foundname=/usr/share/texmf/fonts/map/dvips/lm/lm-rm.map usedmethod=database used files > 11: filename=lmroman12-regular filetype=otf format=otf foundname=/usr/share/texmf/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=database used files > 12: filename=latinmodern-math.otf filetype=opentypefonts foundname=/usr/share/texlive/texmf-dist/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database used files > 13: filename=latinmodern-math.otf filetype=otf format=otf foundname=/usr/share/texlive/texmf-dist/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database system > files > stop used files system > structure > start used structure used structure > text: mytest2 used structure > project: testproject system > structure > stop used structure system > files > start used files used file > 1: filename=cont-yes.mkiv filetype=tex foundname=/usr/share/texmf/tex/context/base/cont-yes.mkiv usedmethod=otherwise used file > 2: filename=cont-new.mkiv filetype=tex foundname=/usr/share/texmf/tex/context/base/cont-new.mkiv usedmethod=otherwise used file > 3: filename=lang-us.lua filetype=lua foundname=/usr/share/texmf/tex/context/patterns/lang-us.lua usedmethod=otherwise used file > 4: filename=/home/sanjoy/sfse/test/mytest2 foundname=/home/sanjoy/sfse/test/mytest2.tex usedmethod=qualified used file > 5: filename=testproject.tex foundname=testproject.tex usedmethod=direct used file > 6: filename=mkiv-base.map filetype=map format=map foundname=/usr/share/texmf/fonts/map/pdftex/context/mkiv-base.map usedmethod=database used file > 7: filename=lm.lfg filetype=tex foundname=/usr/share/texmf/tex/context/fonts/lm.lfg usedmethod=otherwise used file > 8: filename=lm-math.lfg filetype=tex foundname=/usr/share/texmf/tex/context/fonts/lm-math.lfg usedmethod=otherwise used file > 9: filename=lm-math.map filetype=map format=map foundname=/usr/share/texmf/fonts/map/dvips/lm/lm-math.map usedmethod=database used file > 10: filename=lm-rm.map filetype=map format=map foundname=/usr/share/texmf/fonts/map/dvips/lm/lm-rm.map usedmethod=database used file > 11: filename=lmroman12-regular filetype=otf format=otf foundname=/usr/share/texmf/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=database used file > 12: filename=latinmodern-math.otf filetype=opentypefonts foundname=/usr/share/texlive/texmf-dist/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database used file > 13: filename=latinmodern-math.otf filetype=otf format=otf foundname=/usr/share/texlive/texmf-dist/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database system > files > stop used files system > options > start commandline options used option > currentrun="1" used option > fulljobname="./mytest2" used option > input="./mytest2" used option > kindofrun="1" used option > maxnofruns="8" used option > no-parse-first-line="true" system > options > stop commandline options system > options > start commandline files used file > 1: ./mytest2 system > options > stop commandline files mkiv lua stats > used config file: selfautodir:/share/texmf/web2c/texmfcnf.lua mkiv lua stats > used cache path: readable: '/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b' | readable+writable: '/home/sanjoy/.texmf-var/luatex-cache/context/f919750633122078d706dd10f1cfd39b' mkiv lua stats > resource resolver: loadtime 0.112 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 13 found files, scanned paths: <none> mkiv lua stats > stored bytecode data: 329 modules (0.410 sec), 69 tables (0.000 sec), 398 chunks (0.410 sec) mkiv lua stats > cleaned up reserved nodes: 38 nodes, 9 lists of 441 mkiv lua stats > node memory usage: 2 glue, 2 penalty, 6 attribute, 19 glue_spec, 2 attribute_list mkiv lua stats > node list callback tasks: 6 unique task lists, 2 instances (re)created, 3 calls mkiv lua stats > used backend: pdf (backend for directly generating pdf output) mkiv lua stats > loaded patterns: en::2, load time: 0.000 mkiv lua stats > jobdata time: 0.002 seconds saving, 0.001 seconds loading mkiv lua stats > callbacks: 48 direct, 181 indirect, 229 total mkiv lua stats > randomizer: resumed with value 0.99888474028506 mkiv lua stats > result saved in file: mytest2.pdf, compresslevel 3, objectcompreslevel 3 mkiv lua stats > loaded fonts: 2 files: latinmodern-math.otf (experimental), lmroman12-regular.otf mkiv lua stats > fonts load time: 0.313 seconds mkiv lua stats > luatex banner: this is luatex, version beta-0.76.0-2013070107 (tex live 2013/debian) (rev 4627) mkiv lua stats > control sequences: 37353 of 65536 + 100000 mkiv lua stats > current memory usage: 28 MB (ctx: 28 MB) mkiv lua stats > runtime: 0.838 seconds
participants (2)
-
Sanjoy Mahajan
-
Wolfgang Schuster