From 3b02c6f2fbe02ac093a1738a2695597d4df486ec Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 27 Jun 2011 20:17:00 +0200 Subject: beta 2011.06.27 20:17 --- tex/context/base/back-pdf.mkiv | 4 +- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/font-con.lua | 12 +- tex/context/base/font-ctx.lua | 14 +- tex/context/base/font-def.lua | 19 +- tex/context/base/font-ini.mkiv | 268 +++++++++++++-------- tex/context/base/font-unk.mkiv | 30 +-- tex/context/base/math-ini.mkiv | 34 +-- tex/context/base/math-map.lua | 94 +++++--- tex/context/base/math-noa.lua | 25 +- tex/context/base/meta-ini.mkiv | 5 - tex/context/base/mlib-pps.mkiv | 2 +- tex/context/base/mult-sys.mkiv | 16 ++ tex/context/base/pack-obj.mkiv | 1 - tex/context/base/pack-rul.mkiv | 2 - tex/context/base/status-files.pdf | Bin 23742 -> 23703 bytes tex/context/base/status-lua.pdf | Bin 157615 -> 157636 bytes tex/context/base/strc-des.mkiv | 2 +- tex/context/base/strc-reg.mkiv | 2 +- tex/context/base/strc-sec.mkiv | 2 +- tex/context/base/type-lucidanova.mkiv | 11 +- tex/context/base/type-otf.mkiv | 24 +- tex/context/base/type-siz.mkiv | 40 ++- tex/context/fonts/lm-math.lfg | 37 +-- tex/generic/context/luatex/luatex-fonts-merged.lua | 33 ++- 28 files changed, 409 insertions(+), 276 deletions(-) (limited to 'tex') diff --git a/tex/context/base/back-pdf.mkiv b/tex/context/base/back-pdf.mkiv index 30beb2fb9..1737e9866 100644 --- a/tex/context/base/back-pdf.mkiv +++ b/tex/context/base/back-pdf.mkiv @@ -124,14 +124,14 @@ %D Transformations. Some day we will use primitives (once they're fixed). \def\dostartrotation#1% grouped - {\forcecolorhack + {\forcecolorhack % maybe use signal instead \pdfliteral{q \ctxlua{lpdf.rotationcm(#1)}}} \def\dostoprotation {\pdfliteral{Q}} \def\dostartscaling#1#2% the test is needed because acrobat is bugged! - {\forcecolorhack + {\forcecolorhack % maybe use signal instead \pdfliteral{q \ifdim#1\points=\zeropoint.0001\else#1\fi\space 0 0 \ifdim#2\points=\zeropoint.0001\else#2\fi\space 0 0 cm}} diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index c0753b8ae..a7d1c6328 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.06.26 13:23} +\newcontextversion{2011.06.27 20:17} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 391315f13..db8c21cca 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.06.26 13:23} +\newcontextversion{2011.06.27 20:17} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index b9e18eb63..77547c3a4 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.06.26 13:23} +\edef\contextversion{2011.06.27 20:17} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index c03d3b707..f33ac769d 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.06.26 13:23} +\edef\contextversion{2011.06.27 20:17} %D For those who want to use this: diff --git a/tex/context/base/font-con.lua b/tex/context/base/font-con.lua index 0caa93b76..d330d4c1e 100644 --- a/tex/context/base/font-con.lua +++ b/tex/context/base/font-con.lua @@ -212,9 +212,10 @@ function constructors.scale(tfmdata,specification) -- specification.textsize : natural (text)size -- parameters.mathsize : 1=text 2=script 3=scriptscript >1000 enforced size (feature value other than yes) -- - local mathsize = tonumber(specification.mathsize) or 0 - local textsize = tonumber(specification.textsize) or scaledpoints - local forcedsize = tonumber(parameters.mathsize ) or 0 + local mathsize = tonumber(specification.mathsize) or 0 + local textsize = tonumber(specification.textsize) or scaledpoints + local forcedsize = tonumber(parameters.mathsize ) or 0 + local extrafactor = tonumber(specification.factor ) or 1 if (mathsize == 2 or forcedsize == 2) and parameters.scriptpercentage then scaledpoints = parameters.scriptpercentage * textsize / 100 elseif (mathsize == 3 or forcedsize == 3) and parameters.scriptscriptpercentage then @@ -373,6 +374,11 @@ function constructors.scale(tfmdata,specification) local scaledheight = defaultheight * vdelta local scaleddepth = defaultdepth * vdelta -- + if trace_defining then + report_defining("scaling by (%s,%s): name '%s', fullname: '%s', filename: '%s'", + hdelta,vdelta,name or "noname",fullname or "nofullname",filename or "nofilename") + end + -- local hasmath = (properties.has_math or next(mathparameters)) and true if hasmath then if trace_defining then diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index e39e29080..d036c042c 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -601,6 +601,10 @@ local setsomefontsize = context.fntsetsomesize function definers.stage_one(str) statistics.starttiming(fonts) + if trace_defining then + report_defining("memory usage before: %s",statistics.memused()) + report_defining("start stage one: %s",str) + end local fullname, size = lpegmatch(splitpattern,str) local lookup, name, sub, method, detail = getspecification(fullname) if not name then @@ -630,6 +634,9 @@ function definers.stage_one(str) setemptyfontsize() end specification = definers.makespecification(str,lookup,name,sub,method,detail,size) + if trace_defining then + report_defining("stop stage one") + end end local n = 0 @@ -640,7 +647,7 @@ local n = 0 function definers.stage_two(global,cs,str,size,inheritancemode,classfeatures,fontfeatures,classfallbacks,fontfallbacks, mathsize,textsize,relativeid,classgoodies,goodies) if trace_defining then - report_defining("memory usage before: %s",statistics.memused()) + report_defining("start stage two: %s (%s)",str,size) end -- name is now resolved and size is scaled cf sa/mo local lookup, name, sub, method, detail = getspecification(str or "") @@ -714,7 +721,9 @@ function definers.stage_two(global,cs,str,size,inheritancemode,classfeatures,fon specification.fallbacks = fontfallbacks end end - local tfmdata = definers.read(specification,size) -- id not yet known +--~ report_defining("SIZE %s %s",size,specification.size) + local tfmdata = definers.read(specification,size) -- id not yet known (size in spec?) +--~ report_defining("HASH AFTER %s",specification.size) if not tfmdata then report_defining("unable to define %s as \\%s",name,cs) texsetcount("global","lastfontid",-1) @@ -759,6 +768,7 @@ function definers.stage_two(global,cs,str,size,inheritancemode,classfeatures,fon end if trace_defining then report_defining("memory usage after: %s",statistics.memused()) + report_defining("stop stage two") end statistics.stoptiming(fonts) end diff --git a/tex/context/base/font-def.lua b/tex/context/base/font-def.lua index 182e543b0..533d1ec3c 100644 --- a/tex/context/base/font-def.lua +++ b/tex/context/base/font-def.lua @@ -119,7 +119,7 @@ function definers.registersplit(symbol,action,verbosename) end end -function definers.makespecification(specification, lookup, name, sub, method, detail, size) +function definers.makespecification(specification,lookup,name,sub,method,detail,size) size = size or 655360 if trace_defining then report_defining("%s -> lookup: %s, name: %s, sub: %s, method: %s, detail: %s", @@ -395,14 +395,25 @@ function definers.read(specification,size,id) -- id can be optional, name can al specification = definers.resolve(specification) local hash = constructors.hashinstance(specification) local tfmdata = definers.registered(hash) -- id - if not tfmdata then + if tfmdata then + if trace_defining then + report_defining("already hashed: %s",hash) + end + else tfmdata = definers.loadfont(specification) -- can be overloaded if tfmdata then ---~ constructors.checkvirtualid(tfmdata) -- interferes + if trace_defining then + report_defining("loaded and hashed: %s",hash) + end + --~ constructors.checkvirtualid(tfmdata) -- interferes tfmdata.properties.hash = hash if id then definers.register(tfmdata,id) end + else + if trace_defining then + report_defining("not loaded and hashed: %s",hash) + end end end lastdefined = tfmdata or id -- todo ! ! ! ! ! @@ -412,7 +423,7 @@ function definers.read(specification,size,id) -- id can be optional, name can al local properties = tfmdata.properties or { } local parameters = tfmdata.parameters or { } report_defining("using %s font with id %s, name:%s size:%s bytes:%s encoding:%s fullname:%s filename:%s", - properties.type or "unknown", + properties.format or "unknown", id or "?", properties.name or "?", parameters.size or "default", diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index 76376f01b..3b05eea90 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -492,6 +492,10 @@ %D check for fontclass being default or empty and save a few %D tests but it does not help us when no math is defined. +%D Because we want to keep mr=.. and mb=... settings (read: not +%D break downward compatibility by enforcing mrlr etc) we need a +%D bit more code that optimal. + \let\mrfam \zerocount % math regular \let\mrfamlr\plusone % math regular l2r \let\mrfamrl\plustwo % math regular r2l @@ -502,7 +506,8 @@ \definesystemattribute[mathfamily][public] -\newconditional\bidirectionalmathstrategy +\newconditional\bidirectionalmathstrategy % can be default, not that much overhead: \settrue\bidirectionalmathstrategy +\newconditional\completeboldmathstrategy \settrue\completeboldmathstrategy \def\mathtextsuffix {-text} \def\mathscriptsuffix {-script} @@ -521,7 +526,7 @@ \fi\fi #1#2\font} -\def\dodosetmathfamilyx#1#2% +\def\dodosetmathfamilyx#1#2% somehow this fallback does now always work {\ifcsname\defaultfontclass\fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \autofontsizefalse \csname\defaultfontclass\fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \else \ifcsname\defaultfontclass\fontbody\c!mm\fontfamily \currentmathsize\endcsname \autofontsizetrue @@ -534,17 +539,17 @@ \csname \fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \else \ifcsname \fontbody\c!mm\fontfamily \currentmathsize\endcsname \autofontsizetrue \csname \fontbody\c!mm\fontfamily \currentmathsize\endcsname \else - \nullfont \autofontsizetrue + \nullfont \autofontsizetrue \fi\fi} \def\dosetmathfamily#1#2% {\let\savedfontbody\fontbody % op hoger plan \let\fontfamily#2% - % new per 20100817 - \checkbodyfontenvironment[\scriptscriptface]% pretty slow when many switches - \checkbodyfontenvironment[\scriptface]% - \checkbodyfontenvironment[\textface]% - % +% % new per 20100817 +% \checkbodyfontenvironment[\scriptscriptface]% pretty slow when many switches +% \checkbodyfontenvironment[\scriptface]% +% \checkbodyfontenvironment[\textface]% +% % \let\currentmathsize\!!plusthree\let\fontbody\scriptscriptface\dodosetmathfamily\scriptscriptfont#1% \let\currentmathsize\!!plustwo \let\fontbody\scriptface \dodosetmathfamily\scriptfont #1% \let\currentmathsize\!!plusone \let\fontbody\textface \dodosetmathfamily\textfont #1% @@ -552,19 +557,48 @@ \let\fontbody\savedfontbody \autofontsizefalse} +% experiment +% +% optimized: math fonts are never changed (10K \bfa $x$: 3.2 => 2.5 (baseline 1.0)) + +\def\dosetmathfamily#1#2% fam tag + {\ifcsname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname + \csname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname + \else + \dosetmathfamilyindeed#1#2% + \fi} + +\def\dosetmathfamilyindeed#1#2% + {\let\savedfontbody\fontbody % op hoger plan + \let\fontfamily#2% + \let\currentmathsize\!!plusthree\let\fontbody\scriptscriptface\dodosetmathfamily\scriptscriptfont#1% + \let\currentmathsize\!!plustwo \let\fontbody\scriptface \dodosetmathfamily\scriptfont #1% + \let\currentmathsize\!!plusone \let\fontbody\textface \dodosetmathfamily\textfont #1% + \expandafter\xdef\csname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname{% + \scriptscriptfont#1\csname*\fontclass\scriptscriptface\c!mm#23\fontsize3*\endcsname + \scriptfont #1\csname*\fontclass\scriptface \c!mm#22\fontsize2*\endcsname + \textfont #1\csname*\fontclass\textface \c!mm#21\fontsize1*\endcsname + }% + \let\currentmathsize\empty + \let\fontbody\savedfontbody + \autofontsizefalse} % It would be nice if characters could be defined in a neutral way (say fam 255) and % be mapped to a real family during noad list construction. However, this changes % tex in critical places so for the moment we simulate this using manipulation. -% For tracing purposes we use three families but in l2r mode 1 and 2 are copies of 0 -% while in rl mode 0 is a copy of 1. There is no real overhead involved in this. +\appendtoks + % new per 20100817 + \checkbodyfontenvironment[\scriptscriptface]% pretty slow when many switches + \checkbodyfontenvironment[\scriptface]% + \checkbodyfontenvironment[\textface]% +\to \mathstrategies -% \appendtoks -% \dosetmathfamily\mrfam\c!mr -% \to \mathstrategies +% For tracing purposes we use three families but in l2r mode 1 and 2 are copies of 0 +% while in rl mode 0 is a copy of 1. There is no real overhead involved in this. This +% also permits different font definitions for normal and mixed. -\appendtoks +\appendtoks % can be analyzed once % why here .. \edef\@@fontclassdirection{\ifcsname\fontclass\c!mm\s!direction\endcsname\csname\fontclass\c!mm\s!direction\endcsname\fi}% % ... @@ -575,29 +609,74 @@ \fi \to \mathstrategies +\def\bidirectionalmathstrategyyes + {\dosetmathfamily \mrfamlr\c!mrlr + \dosetmathfamily \mrfamrl\c!mrrl + \textfont \mrfam \textfont \mrfamlr + \scriptfont \mrfam \scriptfont \mrfamlr + \scriptscriptfont\mrfam \scriptscriptfont\mrfamlr} + +\def\bidirectionalmathstrategynop + {\dosetmathfamily \mrfam \c!mr + \textfont \mrfamrl\textfont \mrfam + \scriptfont \mrfamrl\scriptfont \mrfam + \scriptscriptfont\mrfamrl\scriptscriptfont\mrfam + \textfont \mrfamlr\textfont \mrfam + \scriptfont \mrfamlr\scriptfont \mrfam + \scriptscriptfont\mrfamlr\scriptscriptfont\mrfam} + \appendtoks \ifconditional\bidirectionalmathstrategy - \dosetmathfamily \mrfamlr\c!mrlr - \dosetmathfamily \mrfamrl\c!mrrl - \textfont \mrfam \textfont \mrfamlr - \scriptfont \mrfam \scriptfont \mrfamlr - \scriptscriptfont\mrfam \scriptscriptfont\mrfamlr + \bidirectionalmathstrategyyes \else - \dosetmathfamily \mrfam \c!mr - \textfont \mrfamrl\textfont \mrfam - \scriptfont \mrfamrl\scriptfont \mrfam - \scriptscriptfont\mrfamrl\scriptscriptfont\mrfam - \textfont \mrfamlr\textfont \mrfam - \scriptfont \mrfamlr\scriptfont \mrfam - \scriptscriptfont\mrfamlr\scriptscriptfont\mrfam + \bidirectionalmathstrategynop \fi \to \mathstrategies +\def\completeboldmathstrategyyesbidi + {\dosetmathfamily \mbfamlr\c!mblr + \dosetmathfamily \mbfamrl\c!mbrl + \textfont \mbfam \textfont \mbfamlr + \scriptfont \mbfam \scriptfont \mbfamlr + \scriptscriptfont\mbfam \scriptscriptfont\mbfamlr} + +\def\completeboldmathstrategyyes + {\dosetmathfamily \mbfam \c!mb + \textfont \mbfamrl\textfont \mbfam + \scriptfont \mbfamrl\scriptfont \mbfam + \scriptscriptfont\mbfamrl\scriptscriptfont\mbfam + \textfont \mbfamlr\textfont \mbfam + \scriptfont \mbfamlr\scriptfont \mbfam + \scriptscriptfont\mbfamlr\scriptscriptfont\mbfam} + +\def\completeboldmathstrategynop + {\textfont \mbfam \textfont \mrfam + \scriptfont \mbfam \scriptfont \mrfam + \scriptscriptfont\mbfam \scriptscriptfont\mrfam + \textfont \mbfamrl\textfont \mrfamrl + \scriptfont \mbfamrl\scriptfont \mrfamrl + \scriptscriptfont\mbfamrl\scriptscriptfont\mrfamrl + \textfont \mbfamlr\textfont \mrfamlr + \scriptfont \mbfamlr\scriptfont \mrfamlr + \scriptscriptfont\mbfamlr\scriptscriptfont\mrfamlr} + \appendtoks - \fam\defaultmathfamily + \ifconditional\completeboldmathstrategy + \ifconditional\bidirectionalmathstrategy + \completeboldmathstrategyyesbidi + \else + \completeboldmathstrategyyes + \fi + \else + \completeboldmathstrategynop + \fi +\to \mathstrategies + +\appendtoks + \fam\defaultmathfamily % all characters and symbols are in this family \to \everymathematics -\unexpanded\def\synchronizemathfamily +\unexpanded\def\synchronizemathfamilymr {\attribute\mathfamilyattribute\ifconditional\bidirectionalmathstrategy \ifconditional\mathematics_right_to_left \plustwo @@ -608,45 +687,73 @@ \zerocount \fi} +\unexpanded\def\synchronizemathfamilymb + {\attribute\mathfamilyattribute\ifconditional\bidirectionalmathstrategy + \ifconditional\mathematics_right_to_left + \ifconditional\pseudoboldmathstate\pluseight\else\plusfive\fi + \else + \ifconditional\pseudoboldmathstate\plusseven\else\plusfour\fi + \fi + \else + \ifconditional\pseudoboldmathstate\plussix\else\plusthree\fi + \fi} + +\letvalue{\??ff:\c!mr:\c!tf }\synchronizemathfamilymr +\letvalue{\??ff:\c!mr:\c!sl }\synchronizemathfamilymr +\letvalue{\??ff:\c!mr:\c!it }\synchronizemathfamilymr +\letvalue{\??ff:\c!mr:\c!bf }\synchronizemathfamilymb +\letvalue{\??ff:\c!mr:\c!bs }\synchronizemathfamilymb +\letvalue{\??ff:\c!mr:\c!bi }\synchronizemathfamilymb +\letvalue{\??ff:\c!mr:\empty}\synchronizemathfamilymr + +\def\synchronizemathfamily + {\csname\??ff:\c!mr:\ifcsname\??ff:\c!mr:\fontalternative\endcsname\fontalternative\fi\endcsname} + +% we need \fontid (or could store this for a fontclass) + +\appendtoks + \edef\currentmathfontmr{\fontname\textfont\zerocount}% + \edef\currentmathfontmb{\fontname\textfont\plusthree}% + \ifx\currentmathfontmr\currentmathfontmb + \letvalue{\??ff:ms:\fontclass}\dosetmathpartialboldstrategy % enables partial bold math + \else + \letvalue{\??ff:ms:\fontclass}\dosetmathfullboldstrategy % enables full bold math + \fi +\to \mathstrategies + +\def\synchronizemathboldstrategy {\csname\??ff:ms:\fontclass\endcsname} + +\newconditional\pseudoboldmathstate + +\def\dosetmathpartialboldstrategy{\settrue \pseudoboldmathstate} +\def\dosetmathfullboldstrategy {\setfalse\pseudoboldmathstate} + +\appendtoks + \synchronizemathboldstrategy +\to \everymathematics + % Bold is somewhat special as we might want both full-bold-math mixed % regular-math, as well as automatic adaption to outer bold (in titles % and inline text bold) so we will need explicit switches as well as % an automatic one. (We will use lucida as an example.) -% \unexpanded\def\mr{\ifmmode\fam\mrfam\else\setcurrentfontalternative\c!mr\fi} -% \unexpanded\def\mb{\ifmmode\fam\mbfam\else\setcurrentfontalternative\c!mb\fi} - \unexpanded\def\mr {\ifmmode - \synchronizemathfamily + \synchronizemathfamilymr \else \setcurrentfontalternative\c!mr \fi} \unexpanded\def\mb {\ifmmode - \fam\mbfam + \synchronizeboldfamilymb \else \setcurrentfontalternative\c!mb \fi} -\let\mr\mb % for the moment - \appendtoks - \synchronizemathfamily + \synchronizemathfamily % auto bold \to \everymathematics - -% not official (doesn't work currently as some math definitions are bound to families) and -% we're not going to mix families -% -% \newconditional\boldmathmode % might change ... maybe \mathfontsupport 1 (normal) 2 (bold too) -% -% \def\enableboldmath {\settrue \boldmathmode} % todo: \setupbodyfont[boldmath,...] -% \def\disableboldmath{\setfalse\boldmathmode} -% -% \appendtoks -% \ifconditional\boldmathmode\dosetmathfamily\mbfam\c!mb\fi -% \to \mathstrategies %D All used styles, like rm, ss and tt, are saved in a comma %D separated list. Appart from practical limitations one can @@ -800,6 +907,8 @@ \setnewconstant\featureinheritancedefault \featureinheritancefontfirst \setnewconstant\featureinheritancemode \featureinheritancedefault +\newdimen\scaledtextface + \unexpanded\def\lowleveldefinefont#1#2% #2 = cs {% we can now set more at the lua end \ctxlua{fonts.definers.stage_one("\luaescapestring{#1}")}% the escapestring catches at \somedimen @@ -826,12 +935,18 @@ \scaledfontsize\localrelativefontsize\scaledfontsize \ifautofontsize \scaledfontsize\currentfontbodyscale\scaledfontsize + \scaledtextface\currentfontbodyscale\dimexpr\textface\relax + \else + \scaledtextface\textface \fi \edef\somefontspec{at \number\scaledfontsize sp}% \edef\somefontfile{\truefontname\somefontname}% \ifx\somefontfile\s!unknown \edef\somefontfile{\defaultfontfile}% \fi + \ifx\somefontfile\s!unknown + \edef\somefontfile{\defaultfontfile}% + \fi \updatefontparameters \updatefontclassparameters \ctxlua{fonts.definers.stage_two( @@ -845,7 +960,7 @@ "\@@fontclassfallbacks", "\@@fontfallbacks", 0\currentmathsize, - \number\dimexpr\textface\relax, + \number\scaledtextface, "\relativefontid", % experiment "\@@fontclassgoodies", % experiment (not yet used) "\@@fontgoodies" % experiment @@ -1275,6 +1390,8 @@ %D The \type {*} makes the switch local, so that we can redefine a %D logical name and/or change the size in between. +%D todo: now mathsize twice in name (so it can go here) + \newif\ifautofontsize \autofontsizetrue \let\lastfontidentifier\empty @@ -1285,7 +1402,7 @@ \let\oldrawfontidentifier\rawfontidentifier \let\oldnewfontidentifier\newfontidentifier -\def\newfontidentifier{*\fontclass\lastfontidentifier\fontstyle\fontsize*} +\def\newfontidentifier{*\fontclass\lastfontidentifier\fontstyle\fontsize*} % no \currentmathsize \def\dododefinefont#1#2% {\featureinheritancemode\featureinheritancefontonly @@ -1792,6 +1909,8 @@ %D If we move design size info to the lfg file (after all only lm %D has design sizes) we can get rid of much code .. 2012 or so. +% todo: \s!parent + \unexpanded\def\definebodyfont {\doquadrupleempty\redefinebodyfont} @@ -1906,26 +2025,6 @@ \expandafter\checktextbodyfont \fi{#1}} % no \c!!mm, not expanded later on -% some day we can do an auto-fam if needed - -% \def\checkmathbodyfont#1#2#3% style alt size / gdef % #3 can be empty (checking needed as \bf is already defined) -% {%\message{!m #1 #2 #3!}% #1 #2 #3 = signal -% %ifcsname #2\endcsname\else\setugvalue {#2}{\setcurrentfontalternative {#2}}\fi % \mr \mb -% \ifcsname #1\endcsname\else\setugvalue {#1}{\setcurrentfontstyle {#1}}\fi} % \mm - -% \def\checktextbodyfont#1#2#3% style alt size / gdef % #3 can be empty (checking needed as \bf is already defined) -% {%\message{!t #1 #2 #3!}% -% \ifcsname #1#3\endcsname\else\setugvalue {#1#3}{\setcurrentfontstylesize {#1}{#3}}\fi % \rma -% \ifcsname #2#3\endcsname\else\setugvalue {#2#3}{\setcurrentfontalternativesize {#2}{#3}}\fi % \sla -% \ifcsname #1#2#3\endcsname\else\setugvalue {#1#2#3}{\setcurrentfontstylealternativesize{#1}{#2}{#3}}\fi % \rmsla -% \ifcsname #1\endcsname\else\setugvalue {#1}{\setcurrentfontstyle {#1}}\fi % \rm -% \ifcsname #2\endcsname\else\setugvalue {#2}{\setcurrentfontalternative {#2}}\fi % \sl -% \ifcsname #1\c!x\endcsname\else\setugvalue {#1\c!x}{\setcurrentfontxstylealternative {#1}}\fi % \rmx -% \ifcsname#1\c!xx\endcsname\else\setugvalue{#1\c!xx}{\setcurrentfontxxstylealternative {#1}}\fi % \rmxx -% \ifcsname #2\c!x\endcsname\else\setugvalue {#2\c!x}{\setcurrentfontxalternative {#2}}\fi % \slx -% \ifcsname#2\c!xx\endcsname\else\setugvalue{#2\c!xx}{\setcurrentfontxxalternative {#2}}\fi % \slxx -% \ifcsname #1#2\endcsname\else\setugvalue {#1#2}{\setcurrentfontstylealternative {#1}{#2}}\fi} % \rmsl - \def\checkmathbodyfont#1#2#3% style alt size / gdef % #3 can be empty (checking needed as \bf is already defined) {%\message{!m #1 #2 #3!}% #1 #2 #3 = signal %setugvalue {#2}{\setcurrentfontalternative {#2}}% % \mr \mb @@ -3930,35 +4029,6 @@ \let\thedefinedfont\relax -% \def\symbolicsizedfont#1#2#3% -% {\scaledfontsize#1% -% \scaledfontsize#2\scaledfontsize -% \font\thedefinedfont=\truefontname{\glyphfontfile{#3}} at \currentfontbodyscale\scaledfontsize\relax -% \thedefinedfont} -% -% \def\symbolicscaledfont -% {\symbolicsizedfont\fontbody} -% -% \unexpanded\def\symbolicfont -% {\symbolicsizedfont\fontbody\plusone} -% -% \unexpanded\def\getglyph#1#2% slow, faster, much faster -% %{{\definefont[\s!dummy][\glyphfontfile{#1} sa \currentfontscale]\dummy#2}} -% %{{\definefont[\s!dummy][\glyphfontfile{#1} sa *]\dummy#2}} -% %{{\symbolicfont{#1}#2}} -% {{\symbolicfont{#1}\doifnumberelse{#2}\char\donothing#2}} -% -% \unexpanded\def\getscaledglyph#1#2#3% -% {{\symbolicscaledfont{#1}{#2}\doifnumberelse{#3}\char\donothing#3}} -% -% \unexpanded\def\getrawglyph#1#2% for simple symbols -% {{\scaledfontsize\fontbody -% \font\thedefinedfont=#1 at \currentfontbodyscale\scaledfontsize\relax -% \thedefinedfont\doifnumberelse{#2}\char\donothing#2}} -% -% \unexpanded\def\getfontchar#1#2% -% {{\symbolicfont{#1}\fontchar{#2}}} - \def\setscaledstyledsymbolicfont#1#2#3% quite a slowdown, glyphfontfile {\edef\askedsymbolfont{\truefontname{\glyphfontfile{#3}} at \the\dimexpr#2\dimexpr\currentfontbodyscale\dimexpr#1}% \ifcsname\??ss->\askedsymbolfont\endcsname diff --git a/tex/context/base/font-unk.mkiv b/tex/context/base/font-unk.mkiv index 90cab07a0..601f0449f 100644 --- a/tex/context/base/font-unk.mkiv +++ b/tex/context/base/font-unk.mkiv @@ -43,7 +43,11 @@ \definefontsynonym [MonoCaps] [unknown] \definefontsynonym [MathRoman] [unknown] +\definefontsynonym [MathRomanL2R] [MathRoman] +\definefontsynonym [MathRomanR2L] [MathRoman] \definefontsynonym [MathRomanBold] [MathRoman] +\definefontsynonym [MathRomanBoldL2R] [MathRomanBold] +\definefontsynonym [MathRomanBoldR2L] [MathRomanBold] \definefontsynonym [Handwriting] [unknown] \definefontsynonym [Calligraphic] [unknown] @@ -128,28 +132,10 @@ \definebodyfont [default] [mm] [mr=MathRoman mo 1, mrlr=MathRomanL2R mo 1, - mrrl=MathRomanR2L mo 1] - -% \definebodyfont [default] [mm] -% [mr=MathRoman mo 1, -% mrlr=MathRomanL2R mo 1, -% mrrl=MathRomanR2L mo 1, -% mb=MathRomanBold mo 1, -% mblr=MathRomanBoldL2R mo 1, -% mbrl=MathRomanBoldR2L mo 1] - -\definebodyfont [bfmath] [mm] % why not just bold - [mr=MathRomanBold mo 1, - mrlr=MathRomanBoldL2R mo 1, - mrrl=MathRomanBoldR2L mo 1] - -% \definebodyfont [bidi] [mm] -% [mrlr=MathRomanL2R mo 1, -% mrrl=MathRomanR2L mo 1] - -% \definebodyfont [bidibfmath] [mm] -% [mrlr=MathRomanBoldL2R mo 1, -% mrrl=MathRomanBoldR2L mo 1] + mrrl=MathRomanR2L mo 1, + mb=MathRomanBold mo 1, + mblr=MathRomanBoldL2R mo 1, + mbrl=MathRomanBoldR2L mo 1] \definebodyfont [default] [hw] [tf=Handwriting sa 1] diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index ad01fa0b2..c7e44e2a7 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -59,7 +59,7 @@ \attribute\mathmodeattribute\plusone \to \everybeforedisplayformula -\setnewconstant\defaultmathfamily 255 +\setnewconstant\defaultmathfamily \zerocount % 255 %D \macros %D {setupmathematics} @@ -118,28 +118,30 @@ \let\mathalternate\setmathalternate % obsolete -\unexpanded\def\mr {\setmathattribute{regular}{tf}\setmathstylealterternate{tf}} +\unexpanded\def\mr {\setmathattribute\s!regular\c!tf\setmathstylealterternate\s!tf} -\unexpanded\def\mathdefault {\setmathattribute{regular}{it}\setmathstylealterternate{it}} -\unexpanded\def\mathscript {\setmathalphabet{script}\setmathstylealterternate{script}} -\unexpanded\def\mathfraktur {\setmathalphabet{fraktur}\setmathstylealterternate{fraktur}} -\unexpanded\def\mathblackboard{\setmathalphabet{blackboard}\setmathstylealterternate{blackboard}} +\unexpanded\def\mathdefault {\setmathattribute\s!regular\c!it\setmathstylealterternate\s!it} +\unexpanded\def\mathscript {\setmathalphabet \s!script \setmathstylealterternate\s!script} +\unexpanded\def\mathfraktur {\setmathalphabet \s!fraktur \setmathstylealterternate\s!fraktur} +\unexpanded\def\mathblackboard{\setmathalphabet \s!blackboard \setmathstylealterternate\s!blackboard} -\unexpanded\def\mathrm{\setmathattribute{rm}{tf}\setmathstylealterternate{tf}} -\unexpanded\def\mathss{\setmathattribute{ss}{tf}\setmathstylealterternate{tf}} -\unexpanded\def\mathtt{\setmathattribute{tt}{tf}\setmathstylealterternate{tf}} +\unexpanded\def\mathrm {\setmathattribute\s!rm\c!tf \setmathstylealterternate\s!tf} +\unexpanded\def\mathss {\setmathattribute\s!ss\c!tf \setmathstylealterternate\s!tf} +\unexpanded\def\mathtt {\setmathattribute\s!tt\c!tf \setmathstylealterternate\s!tf} -\unexpanded\def\mathtf{\setmathstyle{tf}\setmathstylealterternate{tf}} -\unexpanded\def\mathbf{\setmathstyle{bf}\setmathstylealterternate{bf}} -\unexpanded\def\mathsl{\setmathstyle{it}\setmathstylealterternate{it}} % no sl -\unexpanded\def\mathit{\setmathstyle{it}\setmathstylealterternate{it}} -\unexpanded\def\mathbs{\setmathstyle{bi}\setmathstylealterternate{bi}} % no sl -\unexpanded\def\mathbi{\setmathstyle{bi}\setmathstylealterternate{bi}} +\unexpanded\def\mathtf {\setmathstyle\s!tf \setmathstylealterternate\s!tf} +\unexpanded\def\mathsl {\setmathstyle\s!it \setmathstylealterternate\s!it} % no sl +\unexpanded\def\mathit {\setmathstyle\s!it \setmathstylealterternate\s!it} + +\unexpanded\def\mathbf {\setmathstyle\s!bf \setmathstylealterternate\s!bf} +\unexpanded\def\mathbs {\setmathstyle\s!bi \setmathstylealterternate\s!bi} % no sl +\unexpanded\def\mathbi {\setmathstyle\s!bi \setmathstylealterternate\c!bi} \let\tfmath\mathtf % maybe a grouped command -\let\bfmath\mathbf \let\slmath\mathsl \let\itmath\mathit + +\let\bfmath\mathbf \let\bsmath\mathbs \let\bimath\mathbi diff --git a/tex/context/base/math-map.lua b/tex/context/base/math-map.lua index bf02a4c9d..ec8b1ce8a 100644 --- a/tex/context/base/math-map.lua +++ b/tex/context/base/math-map.lua @@ -38,10 +38,14 @@ local mathematics = mathematics -- following approach permits easier remapping of a-a, A-Z and 0-9 to -- fallbacks; symbols is currently mostly greek +local function todigit(n) local t = { } for i=0, 9 do t[0x00030+i] = n+i end return t end +local function toupper(n) local t = { } for i=0,26 do t[0x00041+i] = n+i end return t end +local function tolower(n) local t = { } for i=0,26 do t[0x00061+i] = n+i end return t end + local regular_tf = { - digits = 0x00030, - ucletters = 0x00041, - lcletters = 0x00061, + digits = todigit(0x00030), + ucletters = toupper(0x00041), + lcletters = tolower(0x00061), ucgreek = { [0x0391]=0x0391, [0x0392]=0x0392, [0x0393]=0x0393, [0x0394]=0x0394, [0x0395]=0x0395, [0x0396]=0x0396, [0x0397]=0x0397, [0x0398]=0x0398, [0x0399]=0x0399, [0x039A]=0x039A, @@ -65,7 +69,7 @@ local regular_tf = { local regular_it = { digits = regular_tf.digits, - ucletters = 0x1D434, + ucletters = toupper(0x1D434), lcletters = { -- H [0x00061]=0x1D44E, [0x00062]=0x1D44F, [0x00063]=0x1D450, [0x00064]=0x1D451, [0x00065]=0x1D452, [0x00066]=0x1D453, [0x00067]=0x1D454, [0x00068]=0x0210E, [0x00069]=0x1D456, [0x0006A]=0x1D457, @@ -96,9 +100,9 @@ local regular_it = { } local regular_bf= { - digits = 0x1D7CE, - ucletters = 0x1D400, - lcletters = 0x1D41A, + digits = todigit(0x1D7CE), + ucletters = toupper(0x1D400), + lcletters = tolower(0x1D41A), ucgreek = { [0x0391]=0x1D6A8, [0x0392]=0x1D6A9, [0x0393]=0x1D6AA, [0x0394]=0x1D6AB, [0x0395]=0x1D6AC, [0x0396]=0x1D6AD, [0x0397]=0x1D6AE, [0x0398]=0x1D6AF, [0x0399]=0x1D6B0, [0x039A]=0x1D6B1, @@ -122,8 +126,8 @@ local regular_bf= { local regular_bi = { digits = regular_bf.digits, - ucletters = 0x1D468, - lcletters = 0x1D482, + ucletters = toupper(0x1D468), + lcletters = tolower(0x1D482), ucgreek = { [0x0391]=0x1D71C, [0x0392]=0x1D71D, [0x0393]=0x1D71E, [0x0394]=0x1D71F, [0x0395]=0x1D720, [0x0396]=0x1D721, [0x0397]=0x1D722, [0x0398]=0x1D723, [0x0399]=0x1D724, [0x039A]=0x1D725, @@ -153,9 +157,9 @@ local regular = { } local sansserif_tf = { - digits = 0x1D7E2, - ucletters = 0x1D5A0, - lcletters = 0x1D5BA, + digits = todigit(0x1D7E2), + ucletters = toupper(0x1D5A0), + lcletters = tolower(0x1D5BA), lcgreek = regular_tf.lcgreek, ucgreek = regular_tf.ucgreek, symbols = regular_tf.symbols, @@ -163,17 +167,17 @@ local sansserif_tf = { local sansserif_it = { digits = regular_tf.digits, - ucletters = 0x1D608, - lcletters = 0x1D622, + ucletters = toupper(0x1D608), + lcletters = tolower(0x1D622), lcgreek = regular_tf.lcgreek, ucgreek = regular_tf.ucgreek, symbols = regular_tf.symbols, } local sansserif_bf = { - digits = 0x1D7EC, - ucletters = 0x1D5D4, - lcletters = 0x1D5EE, + digits = todigit(0x1D7EC), + ucletters = toupper(0x1D5D4), + lcletters = tolower(0x1D5EE), ucgreek = { [0x0391]=0x1D756, [0x0392]=0x1D757, [0x0393]=0x1D758, [0x0394]=0x1D759, [0x0395]=0x1D75A, [0x0396]=0x1D75B, [0x0397]=0x1D75C, [0x0398]=0x1D75D, [0x0399]=0x1D75E, [0x039A]=0x1D75F, @@ -197,8 +201,8 @@ local sansserif_bf = { local sansserif_bi = { digits = sansserif_bf.digits, - ucletters = 0x1D63C, - lcletters = 0x1D656, + ucletters = toupper(0x1D63C), + lcletters = tolower(0x1D656), ucgreek = { [0x0391]=0x1D790, [0x0392]=0x1D791, [0x0393]=0x1D792, [0x0394]=0x1D793, [0x0395]=0x1D794, [0x0396]=0x1D795, [0x0397]=0x1D796, [0x0398]=0x1D797, [0x0399]=0x1D798, [0x039A]=0x1D799, @@ -228,9 +232,9 @@ local sansserif = { } local monospaced_tf = { - digits = 0x1D7F6, - ucletters = 0x1D670, - lcletters = 0x1D68A, + digits = todigit(0x1D7F6), + ucletters = toupper(0x1D670), + lcletters = tolower(0x1D68A), lcgreek = sansserif_tf.lcgreek, ucgreek = sansserif_tf.ucgreek, symbols = sansserif_tf.symbols, @@ -244,7 +248,7 @@ local monospaced = { } local blackboard_tf = { - digits = 0x1D7D8, + digits = todigit(0x1D7D8), ucletters = { -- C H N P Q R Z [0x00041]=0x1D538, [0x00042]=0x1D539, [0x00043]=0x02102, [0x00044]=0x1D53B, [0x00045]=0x1D53C, [0x00046]=0x1D53D, [0x00047]=0x1D53E, [0x00048]=0x0210D, [0x00049]=0x1D540, [0x0004A]=0x1D541, @@ -253,7 +257,7 @@ local blackboard_tf = { [0x00055]=0x1D54C, [0x00056]=0x1D54D, [0x00057]=0x1D54E, [0x00058]=0x1D54F, [0x00059]=0x1D550, [0x0005A]=0x02124, }, - lcletters = 0x1D552, + lcletters = tolower(0x1D552), lcgreek = { -- gamma pi [0x03B3]=0x0213C, [0x03C0]=0x0213D, }, @@ -286,7 +290,7 @@ local fraktur_tf= { [0x00055]=0x1D518, [0x00056]=0x1D519, [0x00057]=0x1D51A, [0x00058]=0x1D51B, [0x00059]=0x1D51C, [0x0005A]=0x02128, }, - lcletters = 0x1D51E, + lcletters = tolower(0x1D51E), lcgreek = regular_tf.lcgreek, ucgreek = regular_tf.ucgreek, symbols = regular_tf.symbols, @@ -294,8 +298,8 @@ local fraktur_tf= { local fraktur_bf = { digits = regular_bf.digits, - ucletters = 0x1D56C, - lcletters = 0x1D586, + ucletters = toupper(0x1D56C), + lcletters = tolower(0x1D586), lcgreek = regular_bf.lcgreek, ucgreek = regular_bf.ucgreek, symbols = regular_bf.symbols, @@ -308,7 +312,7 @@ local fraktur = { -- ok bi = fraktur_bf, } -local script_tf= { +local script_tf = { digits = regular_tf.digits, ucletters = { -- B E F H I L M R -- P 2118 [0x00041]=0x1D49C, [0x00042]=0x0212C, [0x00043]=0x1D49E, [0x00044]=0x1D49F, [0x00045]=0x02130, @@ -333,8 +337,8 @@ local script_tf= { local script_bf = { digits = regular_bf.digits, - ucletters = 0x1D4D0, - lcletters = 0x1D4EA, + ucletters = toupper(0x1D4D0), + lcletters = tolower(0x1D4EA), lcgreek = regular_bf.lcgreek, ucgreek = regular_bf.ucgreek, symbols = regular_bf.symbols, @@ -358,6 +362,35 @@ local alphabets = allocate { mathematics.alphabets = alphabets +local boldmap = { } + +local function remap(tf,bf) + for _, alphabet in next, alphabets do + local tfdata = alphabet[tf] + local bfdata = alphabet[bf] + if tfdata then + for k, tfd in next, tfdata do + if type(tfd) == "table" then + local bfd = bfdata[k] + if bfd then + for n, u in next, tfd do + local bn = bfd[n] + if bn then + boldmap[u] = bn + end + end + end + end + end + end + end +end + +remap("tf","bf") +remap("it","bi") + +mathematics.boldmap = boldmap + local mathremap = { } for alphabet, styles in next, alphabets do -- per 9/6/2011 we also have attr for missing @@ -481,6 +514,7 @@ function mathematics.remapalphabets(char,mathalphabet,mathgreek) end end end + -- table test can go away if mathalphabet and mathalphabet > 0 then local newchar local offset = mathremap[mathalphabet] diff --git a/tex/context/base/math-noa.lua b/tex/context/base/math-noa.lua index 28965a09a..e7258b1ca 100644 --- a/tex/context/base/math-noa.lua +++ b/tex/context/base/math-noa.lua @@ -600,7 +600,7 @@ local alternate = { } -- processors.alternate = alternate function mathematics.setalternate(fam,tag) local id = font_of_family(fam) local tfmdata = fontdata[id] - local mathalternates = tfmdata.shared.mathalternates + local mathalternates = tfmdata.shared and tfmdata.shared.mathalternates if mathalternates then local m = mathalternates[tag] tex.attribute[a_mathalternate] = m and m.attribute or attributes.unsetvalue @@ -630,15 +630,28 @@ end -- experiment (when not present fall back to fam 0) -local families = { } +-- 0-2 regular +-- 3-5 bold +-- 6-8 pseudobold +local families = { } local a_mathfamily = attributes.private("mathfamily") +local boldmap = mathematics.boldmap families[math_char] = function(pointer) - if pointer.fam == 255 then + if pointer.fam == 0 then local a = has_attribute(pointer,a_mathfamily) if a and a > 0 then set_attribute(pointer,a_mathfamily,0) + if a > 5 then + local char = pointer.char + local bold = boldmap[pointer.char] + if bold then + set_attribute(pointer,exportstatus,char) + pointer.char = bold + end + a = a - 3 + end pointer.fam = a else pointer.fam = 0 @@ -647,10 +660,14 @@ families[math_char] = function(pointer) end families[math_delim] = function(pointer) - if pointer.small_fam == 255 then + if pointer.small_fam == 0 then local a = has_attribute(pointer,a_mathfamily) if a and a > 0 then set_attribute(pointer,a_mathfamily,0) + if a > 5 then + -- no bold delimiters in unicode + a = a - 3 + end pointer.small_fam = a pointer.large_fam = a else diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index d435f5772..8dbbfca8a 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -912,7 +912,6 @@ \to \everyMPgraphic \appendtoks % before color - %\normalexpanded{\noexpand\definecolor[currentcolor][\currentcolorname]}% \doregistercolor{currentcolor}\currentcolorname \to \everyMPgraphic @@ -922,10 +921,6 @@ % fill fullcircle scaled 1cm withcolor \MPcolor{red} ; % \stopMPcode def} -% \appendtoks -% \doactivatecolor\s!black\forcecolorhack % we can also move this to the backend -% \to \everyMPgraphic - \appendtoks \baselineskip1\baselineskip \lineheight 1\lineheight diff --git a/tex/context/base/mlib-pps.mkiv b/tex/context/base/mlib-pps.mkiv index 8dac53b74..a4b41072e 100644 --- a/tex/context/base/mlib-pps.mkiv +++ b/tex/context/base/mlib-pps.mkiv @@ -42,7 +42,7 @@ {\dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox} \def\MPLIBgettextscaled#1#2#3% why a copy .. can be used more often - {\ctxlua{metapost.gettext(\number\MPtextbox,#1)}% we need the colorhack or else the color backend does not sync + {\ctxlua{metapost.gettext(\number\MPtextbox,#1)}% \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[\c!sx=#2,\c!sy=#3]{\raise\dp\MPtextbox\box\MPtextbox}\forcecolorhack\hss}}} \def\MPLIBgraphictext#1% diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv index aa0b535a1..fb331ed0e 100644 --- a/tex/context/base/mult-sys.mkiv +++ b/tex/context/base/mult-sys.mkiv @@ -133,6 +133,22 @@ \definesystemconstant {default} \definesystemconstant {smallcaps} +\definesystemconstant {regular} +\definesystemconstant {script} +\definesystemconstant {fraktur} +\definesystemconstant {blackboard} + +\definesystemconstant {tf} +\definesystemconstant {sl} +\definesystemconstant {it} +\definesystemconstant {bf} +\definesystemconstant {bs} +\definesystemconstant {bi} + +\definesystemconstant {rm} +\definesystemconstant {ss} +\definesystemconstant {tt} + %D As the name of their define command states, the next set of %D constants is used in the message macro's. diff --git a/tex/context/base/pack-obj.mkiv b/tex/context/base/pack-obj.mkiv index a89e72207..5adfeae86 100644 --- a/tex/context/base/pack-obj.mkiv +++ b/tex/context/base/pack-obj.mkiv @@ -309,7 +309,6 @@ %\vss\box\scratchbox \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}% fix Chof \fi\fi}}% -% \forcecolorhack % needed in order to use layers etc \box\scratchbox \endgroup} diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index c8e2f529a..c07331a8b 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -123,7 +123,6 @@ \edef\ovalrad{\the\dimexpr\framedparameter\c!frameradius}% \let\ovalstr\!!plusone \let\ovalfil\!!zerocount -% \forcecolorhack \doovalbox\ovalwid\ovalhei\ovaldep\ovallin\ovalrad\ovalstr\ovalfil\ovalmod \egroup} @@ -142,7 +141,6 @@ \edef\ovalrad{\the\dimexpr\framedparameter\c!backgroundradius\relax}% \let\ovalstr\!!zerocount \let\ovalfil\!!plusone -% \forcecolorhack \doovalbox\ovalwid\ovalhei\ovaldep\ovallin\ovalrad\ovalstr\ovalfil\ovalmod \egroup} diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index d872011d3..af30bf52c 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 2b38edff7..5ce1d8d2f 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv index f1ff7df69..aaec8de69 100644 --- a/tex/context/base/strc-des.mkiv +++ b/tex/context/base/strc-des.mkiv @@ -532,7 +532,7 @@ \begingroup \currentdescriptionsynchronize \attribute\destinationattribute\currentdescriptionattribute\relax % todo, whole text - \forcecolorhack + \signalcharacter \endgroup \fi#1} diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv index f99f49c40..0e391a0d7 100644 --- a/tex/context/base/strc-reg.mkiv +++ b/tex/context/base/strc-reg.mkiv @@ -270,7 +270,7 @@ \currentregistersynchronize % here? % needs thinking ... bla\index{bla}. will break before the . but adding a % penalty is also no solution - \attribute\destinationattribute\lastdestinationattribute \forcecolorhack % no \strut as it will be removed during cleanup + \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup \endgroup} \def\doregister[#1][#2]% diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv index f26ed8e7e..2b0e8ce70 100644 --- a/tex/context/base/strc-sec.mkiv +++ b/tex/context/base/strc-sec.mkiv @@ -101,7 +101,7 @@ \definemarking[\currenthead\v!number][\currentheadparent\c!number]% }% \doifelselist\currenthead\donothing - {\definelist[\currenthead][\currentheadparent][\c!prefix=\v!no]}% + {\normalexpanded{\definelist[\currenthead][\currentheadparent][\c!prefix=\v!no]}}% \fi \presetlabeltext[\currenthead=]% \the\everysetuphead diff --git a/tex/context/base/type-lucidanova.mkiv b/tex/context/base/type-lucidanova.mkiv index c59f560d9..2b2c2af0e 100644 --- a/tex/context/base/type-lucidanova.mkiv +++ b/tex/context/base/type-lucidanova.mkiv @@ -16,7 +16,8 @@ \starttypescriptcollection[lucidanova] \starttypescript [\s!math] [lucidanova] - \definefontsynonym [MathRoman] [\s!file:LucidaMath.otf] [\s!features=\s!math\mathsizesuffix,\s!goodies=lucidanova-math] + \definefontsynonym [MathRoman] [\s!file:LucidaMath.otf] [\s!features=\s!math\mathsizesuffix,\s!goodies=lucidanova-math] + \definefontsynonym [MathRomanBold] [\s!file:LucidaMath-Demi.otf] [\s!features=\s!math\mathsizesuffix,\s!goodies=lucidanova-math] \stoptypescript \starttypescript [\s!serif] [lucidanova] @@ -38,10 +39,10 @@ \stoptypescript \starttypescript [\s!mono] [lucidanova] - \definefontsynonym [\s!Mono] [\s!file:LucidaSans-Typewriter.otf] - \definefontsynonym [\s!MonoBold] [\s!file:LucidaSans-TypewriterBold.otf] - \definefontsynonym [\s!MonoItalic] [\s!file:LucidaSans-TypewriterOblique.otf] - \definefontsynonym [\s!MonoBoldItalic] [\s!file:LucidaSans-TypewriterBoldOblique.otf] + \definefontsynonym [\s!Mono] [\s!file:LucidaSansTypewriter.otf] + \definefontsynonym [\s!MonoBold] [\s!file:LucidaSansTypewriter-Bold.otf] + \definefontsynonym [\s!MonoItalic] [\s!file:LucidaSansTypewriter-Oblique.otf] + \definefontsynonym [\s!MonoBoldItalic] [\s!file:LucidaSansTypewriter-BoldOblique.otf] \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic] \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic] \stoptypescript diff --git a/tex/context/base/type-otf.mkiv b/tex/context/base/type-otf.mkiv index f2c9a6436..4138f69de 100644 --- a/tex/context/base/type-otf.mkiv +++ b/tex/context/base/type-otf.mkiv @@ -167,19 +167,21 @@ \definefontsynonym[LMMathRoman12-Regular][LMMath12-Regular@lmroman12-math] \definefontsynonym[LMMathRoman17-Regular][LMMath17-Regular@lmroman17-math] - \definefontsynonym[LMMathRoman5-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman6-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman7-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman8-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman9-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman10-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman12-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[LMMathRoman17-Bold] [LMMath10-Bold@lmroman10-boldmath] + % we no longer care to provide pseudo full bold + + \definefontsynonym[LMMathRoman5-Bold] [LMMathRoman5-Regular] + \definefontsynonym[LMMathRoman6-Bold] [LMMathRoman6-Regular] + \definefontsynonym[LMMathRoman7-Bold] [LMMathRoman7-Regular] + \definefontsynonym[LMMathRoman8-Bold] [LMMathRoman8-Regular] + \definefontsynonym[LMMathRoman9-Bold] [LMMathRoman9-Regular] + \definefontsynonym[LMMathRoman10-Bold] [LMMathRoman10-Regular] + \definefontsynonym[LMMathRoman12-Bold] [LMMathRoman12-Regular] + \definefontsynonym[LMMathRoman17-Bold] [LMMathRoman17-Regular] % overloads lmmath.otf usage % % \definefontsynonym[MathRoman][LMMath10-Regular@lmroman10-math] - % \definefontsynonym[MathBold] [LMMath10-Bold@lmroman10-boldmath] + % \definefontsynonym[MathBold] [MathRoman] \loadfontgoodies[lm-math] \stoptypescript @@ -374,8 +376,8 @@ \starttypescript [math] [modern,latin-modern,default] % \loadfontgoodies[lm-math] - \definefontsynonym [LMMathRoman-Regular] [\v!file:lmmath.otf] [\s!features=\s!math] - % \definefontsynonym [LMMathRoman-Bold] [\v!file:lmmathbold.otf] [\s!features=\s!math] + \definefontsynonym [LMMathRoman-Regular] [\v!file:lmmath.otf] [\s!features=\s!math] + \definefontsynonym [LMMathRoman-Bold] [\v!file:lmmath.otf] [\s!features=\s!math] \stoptypescript \starttypescript [modern,default] diff --git a/tex/context/base/type-siz.mkiv b/tex/context/base/type-siz.mkiv index ec51bc77d..ed1aa6ed5 100644 --- a/tex/context/base/type-siz.mkiv +++ b/tex/context/base/type-siz.mkiv @@ -31,24 +31,12 @@ [tt] [default] \stoptypescript -\starttypescript [math,boldmath] [default] [size] +\starttypescript [math] [default] [size] \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] [mm] [default] \stoptypescript -\starttypescript [bfmath] [default] [size] - \definebodyfont - [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] - [mm] [bfmath] -\stoptypescript - -% \starttypescript [math] [bidi] [size] -% \definebodyfont -% [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] -% [mm] [bidi] -% \stoptypescript - \starttypescript [handwriting] [default] [size] \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] @@ -166,7 +154,7 @@ [tt] [default] \stoptypescript -\starttypescript [math,boldmath] [dtp] [size] +\starttypescript [math] [dtp] [size] \definebodyfont [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt] [mm] [default] @@ -383,17 +371,19 @@ \starttypescript [math] [modern,computer-modern,latin-modern] [size] - \definebodyfont [12pt] [mm] [mr=LMMathRoman12-Regular sa 1, mb=LMMathRoman12-Bold sa 1] - \definebodyfont [11pt] [mm] [mr=LMMathRoman10-Regular sa 1, mb=LMMathRoman10-Bold sa 1] - \definebodyfont [10pt] [mm] [mr=LMMathRoman10-Regular sa 1, mb=LMMathRoman10-Bold sa 1] - \definebodyfont [9pt] [mm] [mr=LMMathRoman9-Regular sa 1, mb=LMMathRoman9-Bold sa 1] - \definebodyfont [8pt] [mm] [mr=LMMathRoman8-Regular sa 1, mb=LMMathRoman8-Bold sa 1] - \definebodyfont [7pt] [mm] [mr=LMMathRoman7-Regular sa 1, mb=LMMathRoman7-Bold sa 1] - \definebodyfont [6pt] [mm] [mr=LMMathRoman6-Regular sa 1, mb=LMMathRoman6-Bold sa 1] - \definebodyfont [5pt] [mm] [mr=LMMathRoman5-Regular sa 1, mb=LMMathRoman5-Bold sa 1] - \definebodyfont [4pt] [mm] [mr=LMMathRoman5-Regular sa 1, mb=LMMathRoman5-Bold sa 1] - - \definebodyfont [14.4pt,17.3pt,20.7pt] [mm] [mr=LMMathRoman12-Regular sa 1, mb=LMMathRoman12-Bold sa 1] + \definebodyfont [12pt] [mm] [mr=LMMathRoman12-Regular sa 1,mb=LMMathRoman12-Regular sa 1] + \definebodyfont [11pt] [mm] [mr=LMMathRoman10-Regular sa 1,mb=LMMathRoman10-Regular sa 1] + \definebodyfont [10pt] [mm] [mr=LMMathRoman10-Regular sa 1,mb=LMMathRoman10-Regular sa 1] + \definebodyfont [9pt] [mm] [mr=LMMathRoman9-Regular sa 1,mb=LMMathRoman9-Regular sa 1] + \definebodyfont [8pt] [mm] [mr=LMMathRoman8-Regular sa 1,mb=LMMathRoman8-Regular sa 1] + \definebodyfont [7pt] [mm] [mr=LMMathRoman7-Regular sa 1,mb=LMMathRoman7-Regular sa 1] + \definebodyfont [6pt] [mm] [mr=LMMathRoman6-Regular sa 1,mb=LMMathRoman6-Regular sa 1] + \definebodyfont [5pt] [mm] [mr=LMMathRoman5-Regular sa 1,mb=LMMathRoman5-Regular sa 1] + \definebodyfont [4pt] [mm] [mr=LMMathRoman5-Regular sa 1,mb=LMMathRoman5-Regular sa 1] + + \definebodyfont [14.4pt,17.3pt,20.7pt] [mm] + [mr=LMMathRoman12-Regular sa 1, + mb=LMMathRoman12-Regular sa 1] \stoptypescript diff --git a/tex/context/fonts/lm-math.lfg b/tex/context/fonts/lm-math.lfg index 43de0c51e..07e8036e9 100644 --- a/tex/context/fonts/lm-math.lfg +++ b/tex/context/fonts/lm-math.lfg @@ -179,26 +179,6 @@ local ten = { { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true }, } -local ten_bold = { - { name = "lmroman10-bold.otf", features = "virtualmath", main = true }, - { name = "rm-lmr10.tfm", vector = "tex-mr-missing" } , - { name = "lmmib10.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "lmmib10.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "lmbsy10.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } , - { name = "lmex10.tfm", vector = "tex-ex", extension = true } , --- copied from roman: - { name = "msam10.tfm", vector = "tex-ma" }, - { name = "msbm10.tfm", vector = "tex-mb" }, - { name = "stmary10.afm", vector = "tex-mc" }, - -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } , - { name = "lmroman10-bold.otf", vector = "tex-bf" } , - { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } , - { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true }, - { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true }, - { name = "eufm10.tfm", vector = "tex-fraktur", optional=true }, - { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true }, -} - -- rm-lmr12 : LMMathRoman12-Regular -- rm-lmbx12 : LMMathRoman12-Bold -- lmmi12 : LMMathItalic12-Italic @@ -256,15 +236,14 @@ return { "mkiv-base.map", }, virtuals = { - ["lmroman5-math"] = five, - ["lmroman6-math"] = six, - ["lmroman7-math"] = seven, - ["lmroman8-math"] = eight, - ["lmroman9-math"] = nine, - ["lmroman10-math"] = ten, - ["lmroman10-boldmath"] = ten_bold, - ["lmroman12-math"] = twelve, - ["lmroman17-math"] = seventeen, + ["lmroman5-math"] = five, + ["lmroman6-math"] = six, + ["lmroman7-math"] = seven, + ["lmroman8-math"] = eight, + ["lmroman9-math"] = nine, + ["lmroman10-math"] = ten, + ["lmroman12-math"] = twelve, + ["lmroman17-math"] = seventeen, }, variables = { joinrelfactor = 3, -- default anyway diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 2b3fc5fc7..f1d8adae4 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 06/26/11 13:23:20 +-- merge date : 06/27/11 20:17:22 do -- begin closure to overcome local limits and interference @@ -3290,9 +3290,10 @@ function constructors.scale(tfmdata,specification) -- specification.textsize : natural (text)size -- parameters.mathsize : 1=text 2=script 3=scriptscript >1000 enforced size (feature value other than yes) -- - local mathsize = tonumber(specification.mathsize) or 0 - local textsize = tonumber(specification.textsize) or scaledpoints - local forcedsize = tonumber(parameters.mathsize ) or 0 + local mathsize = tonumber(specification.mathsize) or 0 + local textsize = tonumber(specification.textsize) or scaledpoints + local forcedsize = tonumber(parameters.mathsize ) or 0 + local extrafactor = tonumber(specification.factor ) or 1 if (mathsize == 2 or forcedsize == 2) and parameters.scriptpercentage then scaledpoints = parameters.scriptpercentage * textsize / 100 elseif (mathsize == 3 or forcedsize == 3) and parameters.scriptscriptpercentage then @@ -3451,6 +3452,11 @@ function constructors.scale(tfmdata,specification) local scaledheight = defaultheight * vdelta local scaleddepth = defaultdepth * vdelta -- + if trace_defining then + report_defining("scaling by (%s,%s): name '%s', fullname: '%s', filename: '%s'", + hdelta,vdelta,name or "noname",fullname or "nofullname",filename or "nofilename") + end + -- local hasmath = (properties.has_math or next(mathparameters)) and true if hasmath then if trace_defining then @@ -11781,7 +11787,7 @@ function definers.registersplit(symbol,action,verbosename) end end -function definers.makespecification(specification, lookup, name, sub, method, detail, size) +function definers.makespecification(specification,lookup,name,sub,method,detail,size) size = size or 655360 if trace_defining then report_defining("%s -> lookup: %s, name: %s, sub: %s, method: %s, detail: %s", @@ -12057,14 +12063,25 @@ function definers.read(specification,size,id) -- id can be optional, name can al specification = definers.resolve(specification) local hash = constructors.hashinstance(specification) local tfmdata = definers.registered(hash) -- id - if not tfmdata then + if tfmdata then + if trace_defining then + report_defining("already hashed: %s",hash) + end + else tfmdata = definers.loadfont(specification) -- can be overloaded if tfmdata then ---~ constructors.checkvirtualid(tfmdata) -- interferes + if trace_defining then + report_defining("loaded and hashed: %s",hash) + end + --~ constructors.checkvirtualid(tfmdata) -- interferes tfmdata.properties.hash = hash if id then definers.register(tfmdata,id) end + else + if trace_defining then + report_defining("not loaded and hashed: %s",hash) + end end end lastdefined = tfmdata or id -- todo ! ! ! ! ! @@ -12074,7 +12091,7 @@ function definers.read(specification,size,id) -- id can be optional, name can al local properties = tfmdata.properties or { } local parameters = tfmdata.parameters or { } report_defining("using %s font with id %s, name:%s size:%s bytes:%s encoding:%s fullname:%s filename:%s", - properties.type or "unknown", + properties.format or "unknown", id or "?", properties.name or "?", parameters.size or "default", -- cgit v1.2.3