Hi Hans, I run with my simplefonts module in two problems when I try to set the bodyfont, the regard math and fallback fonts and I was only to solve them by redefining of a few values. 1. I have to set the bodyfont at the same time when I set a individual font for serif, sans or mono. This works fine for the the three text style but not when I try to switch to a different math font, which is frozen with the first \setupbodyfont command and can only be changed when I the main fontclass (created with \registerfontclass in \definetypeface) and the style value for rm (I need the 'rm' style to allow e.g. ss as document style). Here is a example to illustrate the problem: \definetypeface[mainface][rm][serif][times][default] \setupbodyfont[mainface,ss,12pt] \definetypeface[mainface][ss][sans][helvetica][default] \definetypeface[mainface][tt][mono][courier][default] \definetypeface[mainface][mm][math][palatino][default] % comment/uncomment the following two lines to see how % the math font changes with/without these redefinitions \letvalueempty{@@tfmainfacedefault}% \undefinevalue{@f@st@rm}% \setupbodyfont[mainface,ss,12pt] %\definetypeface[mainface][mm][math][cambria][default] %\letvalueempty{@@tfmainfacedefault}% %\undefinevalue{@f@st@rm}% %\setupbodyfont[mainface,ss,12pt] \starttext text \rmtf regular \it italic \bf bold \bi bolditalic \sstf regular \it italic \bf bold \bi bolditalic \tttf regular \it italic \bf bold \bi bolditalic $$ c^2 = a^2 + b^2 $$ \stoptext 2. The fallback for the main style (i.e. \rmtf) is frozen too with the first \setupbodyfont line in the document with can be only reset when I undefine \newfontidentifier, a example for this is: \starttypescript [serif] [mainfont] \setups[font:fallback:serif] \definefontsynonym [Serif] [name:texgyrepagellaregular] [fallbacks=mainfont,features=default] \stoptypescript \definetypeface [mainfont] [rm] [serif] [mainfont] [default] \setupbodyfont[mainfont,rm] \definefontfallback [mainfont] [name:texgyretermesregular] [0x0065-0x0070] [force=yes] % The following line is necessary to enable the fallback font for the main % style after the bodyfont is set, if this isn't done the complete text % below is typeset in Pagella whereas e-p should be in Times \undefinevalue\newfontidentifier \setupbodyfont[mainfont,rm] \starttext abcdefghijkmnopqrstuvwxyz \stoptext I would prefer something documented (e.g. \setupbodyfont[reload,...]) which can be used to get the same effect as I did with my hacks because I like now my new font module, it's lot easier than direct method to set fallback fonts. TIA Wolfgang
Am 09.06.2009 um 09:13 schrieb Wolfgang Schuster:
Hi Hans,
I run with my simplefonts module in two problems when I try to set the bodyfont, the regard math and fallback fonts and I was only to solve them by redefining of a few values.
1. I have to set the bodyfont at the same time when I set a individual font for serif, sans or mono. This works fine for the the three text style but not when I try to switch to a different math font, which is frozen with the first \setupbodyfont command and can only be changed when I the main fontclass (created with \registerfontclass in \definetypeface) and the style value for rm (I need the 'rm' style to allow e.g. ss as document style).
Small correction, I have to undefine the currently used style, i.e. in my example below I have to reset the sans serif style, not the serif one.
Here is a example to illustrate the problem:
\definetypeface[mainface][rm][serif][times][default]
\setupbodyfont[mainface,ss,12pt]
\definetypeface[mainface][ss][sans][helvetica][default] \definetypeface[mainface][tt][mono][courier][default]
\definetypeface[mainface][mm][math][palatino][default]
% comment/uncomment the following two lines to see how % the math font changes with/without these redefinitions
\letvalueempty{@@tfmainfacedefault}% \undefinevalue{@f@st@rm}%
\undefinevalue{@f@st@ss}%
\setupbodyfont[mainface,ss,12pt]
%\definetypeface[mainface][mm][math][cambria][default]
%\letvalueempty{@@tfmainfacedefault}% %\undefinevalue{@f@st@rm}% %\setupbodyfont[mainface,ss,12pt]
\starttext
text
\rmtf regular \it italic \bf bold \bi bolditalic
\sstf regular \it italic \bf bold \bi bolditalic
\tttf regular \it italic \bf bold \bi bolditalic
$$ c^2 = a^2 + b^2 $$
\stoptext
2. The fallback for the main style (i.e. \rmtf) is frozen too with the first \setupbodyfont line in the document with can be only reset when I undefine \newfontidentifier, a example for this is:
\starttypescript [serif] [mainfont] \setups[font:fallback:serif] \definefontsynonym [Serif] [name:texgyrepagellaregular] [fallbacks=mainfont,features=default] \stoptypescript
\definetypeface [mainfont] [rm] [serif] [mainfont] [default]
\setupbodyfont[mainfont,rm]
\definefontfallback [mainfont] [name:texgyretermesregular] [0x0065-0x0070] [force=yes]
% The following line is necessary to enable the fallback font for the main % style after the bodyfont is set, if this isn't done the complete text % below is typeset in Pagella whereas e-p should be in Times
\undefinevalue\newfontidentifier \setupbodyfont[mainfont,rm]
\starttext
abcdefghijkmnopqrstuvwxyz
\stoptext
I would prefer something documented (e.g. \setupbodyfont[reload,...]) which can be used to get the same effect as I did with my hacks because I like now my new font module, it's lot easier than direct method to set fallback fonts.
TIA Wolfgang
Am 09.06.2009 um 09:13 schrieb Wolfgang Schuster:
1. I have to set the bodyfont at the same time when I set a individual font for serif, sans or mono. This works fine for the the three text style but not when I try to switch to a different math font, which is frozen with the first \setupbodyfont command and can only be changed when I the main fontclass (created with \registerfontclass in \definetypeface) and the style value for rm (I need the 'rm' style to allow e.g. ss as document style).
This point is trickier than I thought, my two hacks work only when I use 'rm' for the main bodyfont style but it do no longer work when I try to set 'ss' as main style because with \undefinevalue{@f@st@rm}% I'm able to use the sans style as main font but the math setting is now ignored and with \undefinevalue{@f@st@ss}% I get the right math font and it's no longer possible to use a different style for the main font. Wolfgang
Wolfgang Schuster wrote:
Hi Hans,
I run with my simplefonts module in two problems when I try to set the bodyfont, the regard math and fallback fonts and I was only to solve them by redefining of a few values.
1. I have to set the bodyfont at the same time when I set a individual font for serif, sans or mono. This works fine for the the three text style but not when I try to switch to a different math font, which is frozen with the first \setupbodyfont command and can only be changed when I the main fontclass (created with \registerfontclass in \definetypeface) and the style value for rm (I need the 'rm' style to allow e.g. ss as document style).
typefaces are global in order to make them fast; so, multiple typefaces should have a different namespace ; once the bodyfont is chosen, font definitions take place and are remembered (per class); there is no way to reset them unless we store the definitions (which slows down font handling) the fact that you can do it with math is actually a bug (i fixed that) because there the mathsize (extra property) was not part of the check of already being defined
2. The fallback for the main style (i.e. \rmtf) is frozen too with the first \setupbodyfont line in the document with can be only reset when I undefine \newfontidentifier, a example for this is:
the same
I would prefer something documented (e.g. \setupbodyfont[reload,...]) which can be used to get the same effect as I did with my hacks because I like now my new font module, it's lot easier than direct method to set fallback fonts.
well, docu is easy: \setupbodyfont[someclass] starts freezing the (font file related) definitions related to someclass and there is currently no way to reset that normally a style will define several classes then and switching between them is quite fast as only the namespace changes ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 09.06.2009 um 11:33 schrieb Hans Hagen:
I would prefer something documented (e.g. \setupbodyfont[reload,...]) which can be used to get the same effect as I did with my hacks because I like now my new font module, it's lot easier than direct method to set fallback fonts.
well, docu is easy:
\setupbodyfont[someclass]
starts freezing the (font file related) definitions related to someclass and there is currently no way to reset that
normally a style will define several classes then and switching between them is quite fast as only the namespace changes
I have now a different way to solve my problem without changing values but math has a problem with this. Example: \definetypeface[mine:1][rm][serif][cambria][default] \definetypeface[mine:1][mm][math] [modern] [default] \setupbodyfont[mine:1,14pt] \definetypeface[mine:2][rm][serif][cambria][default] \definetypeface[mine:2][mm][math] [cambria][default] \setupbodyfont[mine:2,14pt] \starttext \startformula c^2 = a^2 + b^2 \stopformula \stoptext Error: ! \textfont0 is undefined (character 99). \stopdisplaymath ->\stopinnermath $$ \ifgridsnapping \egroup \afterdisplayspa... \dostopformula ...eter \c!alternative \v!formula } \resetlastlinewidth \nonoi... l.15 \stopformula Wolfgang
Wolfgang Schuster wrote:
Am 09.06.2009 um 11:33 schrieb Hans Hagen:
I would prefer something documented (e.g. \setupbodyfont[reload,...]) which can be used to get the same effect as I did with my hacks because I like now my new font module, it's lot easier than direct method to set fallback fonts.
well, docu is easy:
\setupbodyfont[someclass]
starts freezing the (font file related) definitions related to someclass and there is currently no way to reset that
normally a style will define several classes then and switching between them is quite fast as only the namespace changes
I have now a different way to solve my problem without changing values but math has a problem with this.
Example:
\definetypeface[mine:1][rm][serif][cambria][default] \definetypeface[mine:1][mm][math] [modern] [default]
\setupbodyfont[mine:1,14pt]
\definetypeface[mine:2][rm][serif][cambria][default] \definetypeface[mine:2][mm][math] [cambria][default]
\setupbodyfont[mine:2,14pt]
\starttext
\startformula c^2 = a^2 + b^2 \stopformula
\stoptext
for the moment add \definebodyfontenvironment[14pt] (remind me in a few weeks to look into it) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Wolfgang Schuster