From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/10981 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Font size switching problem Date: Wed, 12 Feb 2003 12:48:40 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <5.1.0.14.1.20030212124234.02ae96f0@server-1> References: <5.1.0.14.1.20030124101026.030aec50@server-1> <5.1.0.14.1.20030124231632.06b02a48@remote-1> <5.1.0.14.1.20030209230022.02713fd0@remote-1> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1045050487 28083 80.91.224.249 (12 Feb 2003 11:48:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 12 Feb 2003 11:48:07 +0000 (UTC) Cc: ntg-context@ntg.nl Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ivMw-0007If-00 for ; Wed, 12 Feb 2003 12:48:02 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 1AD0410AEF; Wed, 12 Feb 2003 12:50:15 +0100 (MET) Original-Received: from mail.solcon.nl (mail.solcon.nl [212.45.33.11]) by ref.ntg.nl (Postfix) with ESMTP id D8A9B10AE8 for ; Wed, 12 Feb 2003 12:48:59 +0100 (MET) Original-Received: from server-1.pragma-ade.nl (wc-58016.solcon.nl [212.45.58.16]) by mail.solcon.nl (8.12.5/pre1.0-MySQL/8.12.5) with ESMTP id h1CBmqit030509; Wed, 12 Feb 2003 12:48:52 +0100 Original-Received: from LAPTOP-3.wxs.nl (laptop-3 [10.100.1.191]) by server-1.pragma-ade.nl (8.12.3/8.12.2) with ESMTP id h1CBmst5010092; Wed, 12 Feb 2003 12:48:54 +0100 X-Sender: hagen-mail@server-1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Original-To: "Victor Figurnov" In-Reply-To: <000101c2d1ce$bc1d4c20$6401a8c0@victorfi> X-RAVMilter-Version: 8.4.1(snapshot 20020919) (mail.solcon.nl) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:10981 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:10981 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 -------------------------------------------------------------------------