Re: [NTG-context] [dev-context] palatino at 10.5pt bold not found when using project structure w/ MkIV

2013-07-05 Thread Wolfgang Schuster

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-RegularCID 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
___
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
___


Re: [NTG-context] [dev-context] palatino at 10.5pt bold not found when using project structure w/ MkIV

2013-07-06 Thread 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.)

> 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


> 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
___
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
___


Re: [NTG-context] [dev-context] palatino at 10.5pt bold not found when using project structure w/ MkIV

2013-07-07 Thread Wolfgang Schuster

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[]
\usetypescript[]
\setupbofyfont[]

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
> 

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
___
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
___


Re: [NTG-context] [dev-context] palatino at 10.5pt bold not found when using project structure w/ MkIV

2013-07-08 Thread Sanjoy Mahajan
> 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
>> 
>

> 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/con