At 07:25 AM 2/11/2003 +0300, you wrote:
Hello, Hans!
It seems that font size switching mechanizm in ConTeXt has a bug.
Here are simple test and its results (as comments):
---------------------------------------------------------------------------- \setupoutput[pdftex] \setuplayout[middle] \noheaderandfooterlines
\title{Font sizes test} % Shown using CMR12 font at 20.6 pt
\rm \subject{Serif font} % Shown using CMR12 font at 14.3 pt \tfx Serif --- size tfx\par % Shown using CMR10 font at 9.96 pt \tfxx Serif --- size tfxx\par % Shown using CMR8 font at 7.97 pt \tfa Serif --- size tfa\par % Shown using CMR8 font at 9.96 pt % (swithing to CMR 12 is missing?) \tfb Serif --- size tfb\par % Shown using CMR8 font at 11.4 pt \tfc Serif --- size tfc\par % Shown using CMR8 font at 13.7 pt \tfx Serif --- size tfx\par % Shown using CMR10 font at 17.2 pt % (font scale switch is missing???) \tfxx Serif --- size tfxx\par % Shown using CMR8 font at 13.7 pt
\ss \subject{SansSerif font} % Shown using CMSS8 font at 9.56 pt \tfx SansSerif --- size tfx\par % Shown using CMSS10 font at 17.2 pt \tfxx SansSerif --- size tfxx\par % Shown using CMSS8 font at 13.7 pt \tfa SansSerif --- size tfa\par % Shown using CMSS8 font at 9.56 pt \tfb SansSerif --- size tfb\par % Shown using CMSS8 font at 11.4 pt \tfc SansSerif --- size tfc\par % Shown using CMSS8 font at 13.7 pt \tfx SansSerif --- size tfx\par % Shown using CMSS10 font at 17.2 pt \tfxx SansSerif --- size tfxx\par % Shown using CMSS8 font at 13.7 pt
\tt \subject{Typewriter font} % Shown using CMTT8 font at 9.56 pt \tfx Typewriter --- size tfx\par % Shown using CMTT10 font at 17.2 pt \tfxx Typewriter --- size tfxx\par % Shown using CMTT8 font at 13.7 pt \tfa Typewriter --- size tfa\par % Shown using CMTT8 font at 9.56 pt \tfb Typewriter --- size tfb\par % Shown using CMTT8 font at 11.4 pt \tfc Typewriter --- size tfc\par % Shown using CMTT8 font at 13.7 pt \tfx Typewriter --- size tfx\par % Shown using CMTT10 font at 17.2 pt \tfxx Typewriter --- size tfxx\par % Shown using CMTT8 font at 13.7 pt
\stoptext ----------------------------------------------------------------------------
So it is hard to predict the results of consecutive font size swithing commands. :-(
(Yes I know that grouping like {\tf... } cures the problem)
Took me a while to figure out what was going on, but the problem with ungrouped usage is that you reach a state where context cannot longer keep track of what the intention is (unless i extend the font handler with some sort of group-insensitive stack which would slow down things quite a lot); think of x inside c inside x inside xx inside d and so on. When used as intended, i.e. grouped, x/xx scaling works ok. I made a couple of test tables to demo this effect. A small patch is possible that at least prevents the funny big scale, but it's still sub optimal. Hans ===================================================== \let\normaltx \tx \let\normaltxx\txx \def\checknestedxfontsize {\ifcase\currentxfontsize\else\ifx\fontsize\empty\else \chardef\currentxfontsize\zeropoint \let\fontsize\empty \let\tx\normaltx \let\txx\normaltxx \fi\fi} \def\setcurrentfontxalternative#1% {\checknestedxfontsize \dosetcurrentfontxxxalternative{#1}1\c!x\scriptstyle \let\tx\txx} \def\setcurrentfontxxalternative#1% {\checknestedxfontsize \dosetcurrentfontxxxalternative{#1}2\c!xx\scriptscriptstyle \let\tx\empty \let\txx\empty} \def\setcurrentfontxstylealternative #1{\csname#1\endcsname\tx} \def\setcurrentfontxxstylealternative#1{\csname#1\endcsname\txx} \setupoutput[pdftex] \setuplayout[middle] \noheaderandfooterlines \def\fontstate{\setstrut\ruledhbox{\strut Hello}} \starttabulate[|||||] \HL \NC \rlap{\quad\bf grouped} \NC \NC \type {\tx} \NC \type {\txx} \NC \NR \HL \NC \type{\tfx} \NC \tfx \fontstate \NC \tfx \tx \fontstate \NC \tfx \txx \fontstate \NC \NR \NC \type{\tfxx} \NC \tfxx \fontstate \NC \tfxx\tx \fontstate \NC \tfxx\txx \fontstate \NC \NR \NC \type{\tf} \NC \tf \fontstate \NC \tf \tx \fontstate \NC \tf \txx \fontstate \NC \NR \NC \type{\tfa} \NC \tfa \fontstate \NC \tfa \tx \fontstate \NC \tfa \txx \fontstate \NC \NR \NC \type{\tfb} \NC \tfb \fontstate \NC \tfb \tx \fontstate \NC \tfb \txx \fontstate \NC \NR \NC \type{\tfc} \NC \tfc \fontstate \NC \tfc \tx \fontstate \NC \tfc \txx \fontstate \NC \NR \NC \type{\tfd} \NC \tfd \fontstate \NC \tfd \tx \fontstate \NC \tfd \txx \fontstate \NC \NR \NC \type{\tfx} \NC \tfx \fontstate \NC \tfx \tx \fontstate \NC \tfx \txx \fontstate \NC \NR \NC \type{\tfxx} \NC \tfxx \fontstate \NC \tfxx\tx \fontstate \NC \tfxx\txx \fontstate \NC \NR \HL \stoptabulate \blank \starttabulate[|||||] \HL \NC \rlap{\quad\bf stacked} \NC \NC \type {\tx} \NC \type {\txx} \NC \NR \HL \NC \type{\tfx} \NC \tfx \fontstate \NC \tfx \tx \fontstate \NC \tfx \txx \fontstate \NC \NR \NC \type{\tfxx} \NC \tfx\tfxx \fontstate \NC \tfx\tfxx \tx \fontstate \NC \tfx\tfxx \txx \fontstate \NC \NR \NC \type{\tf} \NC \tfx\tfxx\tf \fontstate \NC \tfx\tfxx\tf \tx \fontstate \NC \tfx\tfxx\tf \txx \fontstate \NC \NR \NC \type{\tfa} \NC \tfx\tfxx\tf\tfa \fontstate \NC \tfx\tfxx\tf\tfa \tx \fontstate \NC \tfx\tfxx\tf\tfa \txx \fontstate \NC \NR \NC \type{\tfb} \NC \tfx\tfxx\tf\tfa\tfb \fontstate \NC \tfx\tfxx\tf\tfa\tfb \tx \fontstate \NC \tfx\tfxx\tf\tfa\tfb \txx \fontstate \NC \NR \NC \type{\tfc} \NC \tfx\tfxx\tf\tfa\tfb\tfc \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfc \tx \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfc \txx \fontstate \NC \NR \NC \type{\tfd} \NC \tfx\tfxx\tf\tfa\tfb\tfd \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfd \tx \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfd \txx \fontstate \NC \NR \NC \type{\tfx} \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \tx \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \txx \fontstate \NC \NR \NC \type{\tfxx} \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \tx \fontstate \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \txx \fontstate \NC \NR \HL \stoptabulate \stoptext ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
participants (1)
-
Hans Hagen