From 08473f11287cb263079c0435068312cbc6d736e8 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 14 Nov 2022 23:18:10 +0100 Subject: 2022-11-14 22:56:00 --- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-fr.mkii | 5 +- tex/context/base/mkiv/char-ini.lua | 29 +- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-cft.lua | 2 +- tex/context/base/mkiv/font-con.lua | 22 +- tex/context/base/mkiv/font-dsp.lua | 38 +- tex/context/base/mkiv/font-ini.mkvi | 47 +- tex/context/base/mkiv/font-mis.lua | 2 +- tex/context/base/mkiv/font-otl.lua | 40 +- tex/context/base/mkiv/font-oto.lua | 3 + tex/context/base/mkiv/font-oup.lua | 55 +- tex/context/base/mkiv/font-sel.lua | 31 +- tex/context/base/mkiv/font-shp.lua | 2 +- tex/context/base/mkiv/font-ttf.lua | 24 +- tex/context/base/mkiv/lang-def.mkiv | 21 + tex/context/base/mkiv/lang-txt.lua | 158 ++++- tex/context/base/mkiv/mtx-context-setters.tex | 9 +- tex/context/base/mkiv/mult-low.lua | 5 +- tex/context/base/mkiv/mult-prm.lua | 1 + tex/context/base/mkiv/mult-sys.mkiv | 4 + tex/context/base/mkiv/spac-chr.lua | 24 +- tex/context/base/mkiv/spac-chr.mkiv | 3 +- tex/context/base/mkiv/status-files.pdf | Bin 24600 -> 24564 bytes tex/context/base/mkiv/status-lua.pdf | Bin 263132 -> 263628 bytes tex/context/base/mkiv/type-set.mkiv | 6 +- tex/context/base/mkxl/char-tex.lmt | 1 - tex/context/base/mkxl/cont-new.mkxl | 2 +- tex/context/base/mkxl/context.mkxl | 2 +- tex/context/base/mkxl/font-chk.lmt | 15 +- tex/context/base/mkxl/font-con.lmt | 153 +++-- tex/context/base/mkxl/font-ctx.lmt | 20 +- tex/context/base/mkxl/font-def.lmt | 1 + tex/context/base/mkxl/font-imp-quality.lmt | 99 ++- tex/context/base/mkxl/font-ini.mklx | 81 ++- tex/context/base/mkxl/font-lib.mklx | 2 - tex/context/base/mkxl/font-mat.mklx | 66 +- tex/context/base/mkxl/font-mps.lmt | 407 ------------ tex/context/base/mkxl/font-otl.lmt | 88 ++- tex/context/base/mkxl/font-pre.mkxl | 44 +- tex/context/base/mkxl/font-set.mklx | 10 +- tex/context/base/mkxl/lang-def.mkxl | 21 + tex/context/base/mkxl/lang-rep.lmt | 4 +- tex/context/base/mkxl/lpdf-lmt.lmt | 32 +- tex/context/base/mkxl/math-act.lmt | 681 ++++++++++++++------- tex/context/base/mkxl/math-ali.mkxl | 6 +- tex/context/base/mkxl/math-fen.mkxl | 17 + tex/context/base/mkxl/math-ini.mkxl | 63 +- tex/context/base/mkxl/math-lop.mkxl | 11 +- tex/context/base/mkxl/math-map.lmt | 19 +- tex/context/base/mkxl/math-vfu.lmt | 70 +-- tex/context/base/mkxl/meta-imp-glyphs.mkxl | 65 ++ tex/context/base/mkxl/mlib-ctx.mkxl | 1 + tex/context/base/mkxl/mlib-fnt.lmt | 548 +++++++++++++++++ tex/context/base/mkxl/mult-sys.mkxl | 3 + tex/context/base/mkxl/node-cmp.lmt | 12 +- tex/context/base/mkxl/node-res.lmt | 3 +- tex/context/base/mkxl/spac-chr.lmt | 32 +- tex/context/base/mkxl/spac-chr.mkxl | 3 +- tex/context/base/mkxl/spac-hor.lmt | 14 +- tex/context/base/mkxl/spac-hor.mkxl | 2 + tex/context/base/mkxl/strc-mat.mkxl | 14 + tex/context/base/mkxl/tabl-tbl.mkxl | 7 +- tex/context/base/mkxl/trac-vis.lmt | 26 +- tex/context/base/mkxl/type-imp-euler.mkxl | 10 +- tex/context/base/mkxl/type-set.mkxl | 32 +- tex/context/base/mkxl/typo-chr.lmt | 4 +- tex/context/base/mkxl/typo-itc.lmt | 6 +- tex/context/fonts/mkiv/asana-math.lfg | 107 ---- tex/context/fonts/mkiv/bonum-math.lfg | 58 +- tex/context/fonts/mkiv/cambria-math.lfg | 30 +- tex/context/fonts/mkiv/common-math.lfg | 4 +- tex/context/fonts/mkiv/concrete-math.lfg | 26 +- tex/context/fonts/mkiv/dejavu-math.lfg | 93 ++- tex/context/fonts/mkiv/ebgaramond-math.lfg | 336 ++++++++++ tex/context/fonts/mkiv/erewhon-math.lfg | 44 +- tex/context/fonts/mkiv/garamond-math.lfg | 318 ---------- tex/context/fonts/mkiv/kpfonts-math.lfg | 40 +- tex/context/fonts/mkiv/libertinus-math.lfg | 39 +- tex/context/fonts/mkiv/lm.lfg | 517 +--------------- tex/context/fonts/mkiv/lucida-math.lfg | 290 +++++++++ tex/context/fonts/mkiv/lucida-opentype-math.lfg | 274 --------- tex/context/fonts/mkiv/minion-math.lfg | 25 +- tex/context/fonts/mkiv/modern-math.lfg | 525 ++++++++++++++++ tex/context/fonts/mkiv/pagella-math.lfg | 52 +- tex/context/fonts/mkiv/schola-math.lfg | 48 +- tex/context/fonts/mkiv/stix-two-math.lfg | 220 ------- tex/context/fonts/mkiv/stixtwo-math.lfg | 242 ++++++++ tex/context/fonts/mkiv/termes-math.lfg | 46 +- tex/context/fonts/mkiv/type-imp-asana.mkiv | 35 -- tex/context/fonts/mkiv/type-imp-cambria.mkiv | 16 +- tex/context/fonts/mkiv/type-imp-concrete.mkiv | 28 +- tex/context/fonts/mkiv/type-imp-dejavu.mkiv | 37 +- tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv | 22 +- tex/context/fonts/mkiv/type-imp-erewhon.mkiv | 28 +- tex/context/fonts/mkiv/type-imp-euler.mkiv | 18 +- tex/context/fonts/mkiv/type-imp-kpfonts.mkiv | 38 +- tex/context/fonts/mkiv/type-imp-latinmodern.mkiv | 31 +- tex/context/fonts/mkiv/type-imp-libertinus.mkiv | 21 +- .../fonts/mkiv/type-imp-lucida-opentype.mkiv | 87 --- tex/context/fonts/mkiv/type-imp-lucida.mkiv | 96 +++ tex/context/fonts/mkiv/type-imp-stix.mkiv | 58 +- tex/context/fonts/mkiv/type-imp-texgyre.mkiv | 88 ++- tex/context/fonts/mkiv/type-imp-xcharter.mkiv | 63 ++ tex/context/fonts/mkiv/xcharter-math.lfg | 127 ++++ tex/context/fonts/mkiv/xits-math.lfg | 3 + tex/context/interface/mkii/keys-fr.xml | 5 +- tex/context/modules/mkiv/s-math-extensibles.mkiv | 68 ++ tex/generic/context/luatex/luatex-fonts-merged.lua | 125 ++-- 111 files changed, 4629 insertions(+), 2935 deletions(-) delete mode 100644 tex/context/base/mkxl/font-mps.lmt create mode 100644 tex/context/base/mkxl/meta-imp-glyphs.mkxl create mode 100644 tex/context/base/mkxl/mlib-fnt.lmt delete mode 100644 tex/context/fonts/mkiv/asana-math.lfg create mode 100644 tex/context/fonts/mkiv/ebgaramond-math.lfg delete mode 100644 tex/context/fonts/mkiv/garamond-math.lfg create mode 100644 tex/context/fonts/mkiv/lucida-math.lfg delete mode 100644 tex/context/fonts/mkiv/lucida-opentype-math.lfg create mode 100644 tex/context/fonts/mkiv/modern-math.lfg delete mode 100644 tex/context/fonts/mkiv/stix-two-math.lfg create mode 100644 tex/context/fonts/mkiv/stixtwo-math.lfg delete mode 100644 tex/context/fonts/mkiv/type-imp-asana.mkiv delete mode 100644 tex/context/fonts/mkiv/type-imp-lucida-opentype.mkiv create mode 100644 tex/context/fonts/mkiv/type-imp-lucida.mkiv create mode 100644 tex/context/fonts/mkiv/type-imp-xcharter.mkiv create mode 100644 tex/context/fonts/mkiv/xcharter-math.lfg (limited to 'tex') diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 32680be28..0b5c9bdf9 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2022.10.22 11:20} +\newcontextversion{2022.11.14 22:54} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 73cbdb23f..e4fb9c469 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2022.10.22 11:20} +\edef\contextversion{2022.11.14 22:54} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index 0d2c7c424..c78135316 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -93,7 +93,6 @@ \setinterfacevariable{author}{auteur} \setinterfacevariable{auto}{auto} \setinterfacevariable{autointro}{autointro} -\setinterfacevariable{autopunctuation}{autoponctuation} \setinterfacevariable{back}{retour} \setinterfacevariable{background}{arriereplan} \setinterfacevariable{backmatter}{pagesdefin} @@ -677,9 +676,13 @@ \setinterfaceconstant{authoretaltext}{auteuretaltexte} \setinterfaceconstant{auto}{auto} \setinterfaceconstant{autocase}{autocase} +\setinterfaceconstant{autofencing}{autofencing} \setinterfaceconstant{autofile}{autofichier} \setinterfaceconstant{autofocus}{autofocus} \setinterfaceconstant{autohang}{autosuspendre} +\setinterfaceconstant{autonumbers}{autonumbers} +\setinterfaceconstant{autopunctuation}{autoponctuation} +\setinterfaceconstant{autospacing}{autospacing} \setinterfaceconstant{autostrut}{autoentretoise} \setinterfaceconstant{autowidth}{autolargeur} \setinterfaceconstant{availableheight}{hauteurdisponible} diff --git a/tex/context/base/mkiv/char-ini.lua b/tex/context/base/mkiv/char-ini.lua index 6fe56a062..8f1bc4fb0 100644 --- a/tex/context/base/mkiv/char-ini.lua +++ b/tex/context/base/mkiv/char-ini.lua @@ -817,6 +817,19 @@ local is_symbol = allocate ( tohash { "sm", "sc", "sk", "so", } ) +local can_have_space = allocate ( tohash { + "lu", "ll", "lt", "lm", "lo", -- letters + -- "mn", "mc", "me", -- marks + "nd", "nl", "no", -- numbers + "ps", "pi", -- initial + -- "pe", "pf", -- final + -- "pc", "pd", "po", -- punctuation + "sm", "sc", "sk", "so", -- symbols + -- "zs", "zl", "zp", -- separators + -- "cc", "cf", "cs", "co", "cn", -- others +} ) + + -- to be redone: store checked characters characters.is_character = is_character @@ -827,6 +840,7 @@ characters.is_mark = is_mark characters.is_punctuation = is_punctuation characters.is_hyphenator = is_hyphenator characters.is_symbol = is_symbol +characters.can_have_space = can_have_space local mti = function(t,k) if type(k) == "number" then @@ -837,13 +851,14 @@ local mti = function(t,k) end end -setmetatableindex(characters.is_character, mti) -setmetatableindex(characters.is_letter, mti) -setmetatableindex(characters.is_command, mti) -setmetatableindex(characters.is_spacing, mti) -setmetatableindex(characters.is_punctuation,mti) -setmetatableindex(characters.is_hyphenator, mti) -setmetatableindex(characters.is_symbol, mti) +setmetatableindex(characters.is_character, mti) +setmetatableindex(characters.is_letter, mti) +setmetatableindex(characters.is_command, mti) +setmetatableindex(characters.is_spacing, mti) +setmetatableindex(characters.is_punctuation, mti) +setmetatableindex(characters.is_hyphenator, mti) +setmetatableindex(characters.is_symbol, mti) +setmetatableindex(characters.can_have_space, mti) -- todo: also define callers for the above diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 4c07bceb5..333a3dc54 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2022.10.22 11:20} +\newcontextversion{2022.11.14 22:54} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 86374e2d7..db4a0a66f 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2022.10.22 11:20} +\edef\contextversion{2022.11.14 22:54} %D Kind of special: diff --git a/tex/context/base/mkiv/font-cft.lua b/tex/context/base/mkiv/font-cft.lua index 267c63f7a..d6afc01f7 100644 --- a/tex/context/base/mkiv/font-cft.lua +++ b/tex/context/base/mkiv/font-cft.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['font-cft'] = { license = "see context related readme files" } --- context font tables (needs updating) +-- context font tables (needs updating, only okay for mkiv) -- -- todo: extra: -- diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua index 5c156c2ba..820e45f52 100644 --- a/tex/context/base/mkiv/font-con.lua +++ b/tex/context/base/mkiv/font-con.lua @@ -388,20 +388,20 @@ function constructors.scale(tfmdata,specification) -- local mathsize = tonumber(specification.mathsize) or 0 local textsize = tonumber(specification.textsize) or scaledpoints - local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize" + -- local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize" 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 - scaledpoints = parameters.scriptscriptpercentage * textsize / 100 - elseif forcedsize > 1000 then -- safeguard - scaledpoints = forcedsize - else - -- in context x and xx also use mathsize - end + -- 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 + -- scaledpoints = parameters.scriptscriptpercentage * textsize / 100 + -- elseif forcedsize > 1000 then -- safeguard + -- scaledpoints = forcedsize + -- else + -- -- in context x and xx also use mathsize + -- end targetparameters.mathsize = mathsize -- context specific targetparameters.textsize = textsize -- context specific - targetparameters.forcedsize = forcedsize -- context specific + -- targetparameters.forcedsize = forcedsize -- context specific targetparameters.extrafactor = extrafactor -- context specific -- local addtounicode = constructors.addtounicode diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua index 1735b4cdc..f5e12c0ef 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -2332,12 +2332,11 @@ do local reported = { } - local function report_issue(i,what,sequence,kind) - local name = sequence.name - if not reported[name] then - report("rule %i in %s lookup %a has %s lookups",i,what,name,kind) - reported[name] = true - end + local function report_issue(i,what,step,kind) +-- if not reported[step] then + report("rule %i in step %i of %s has %s lookups",i,step,what,kind) +-- reported[name] = true +-- end end -- for i=lastsequence+1,nofsequences do @@ -2346,18 +2345,18 @@ do -- for i=1,#steps do -- local step = steps[i] - for i=1,#allsteps do -- new per 2022-09-25 - local step = allsteps[i] -- new per 2022-09-25 + for s=1,#allsteps do -- new per 2022-09-25 + local step = allsteps[s] -- new per 2022-09-25 local rules = step.rules if rules then for i=1,#rules do local rule = rules[i] local rlookups = rule.lookups if not rlookups then - report_issue(i,what,sequence,"no") + report_issue(i,what,s,"no") elseif not next(rlookups) then -- can be ok as it aborts a chain sequence - -- report_issue(i,what,sequence,"empty") + -- report_issue(i,what,s,"empty") rule.lookups = nil else -- we can have holes in rlookups flagged false and we can have multiple lookups @@ -2398,12 +2397,12 @@ do sublookupcheck[lookupid] = 1 h = nofsublookups else - report_issue(i,what,sequence,"missing") + report_issue(i,what,s,"missing") rule.lookups = nil break end else - report_issue(i,what,sequence,"bad") + report_issue(i,what,s,"bad") rule.lookups = nil break end @@ -2977,7 +2976,7 @@ local function readmathvariants(f,fontdata,offset) -- advance = readushort(f), -- } - local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic) + local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic,korientation,orientation) if coverage ~= 0 and nofglyphs > 0 then local coverage = readcoverage(f,offset+coverage,true) for i=1,nofglyphs do @@ -3042,14 +3041,23 @@ local function readmathvariants(f,fontdata,offset) if italic and italic ~= 0 then math[kitalic] = italic end + if orientation then + math[korientation] = orientation + end end end end end end - get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic") - get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic") + -- if LUATEXENGINE == "luametatex" then + if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then + get(offset,hcoverage,hnofglyphs,hconstruction,"variants","parts","partsitalic","partsorientation","horizontal") + get(offset,vcoverage,vnofglyphs,vconstruction,"variants","parts","partsitalic","partsorientation","vertical") + else + get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic") + get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic") + end end function readers.math(f,fontdata,specification) diff --git a/tex/context/base/mkiv/font-ini.mkvi b/tex/context/base/mkiv/font-ini.mkvi index ccd034106..c51019fdd 100644 --- a/tex/context/base/mkiv/font-ini.mkvi +++ b/tex/context/base/mkiv/font-ini.mkvi @@ -474,15 +474,52 @@ \installcorenamespace{mappedfontsize} +% \unexpanded\def\mapfontsize +% {\dodoubleargument\font_basics_map_fontsize} + +% \def\font_basics_map_fontsize[#from][#to]% +% {\setvalue{\??mappedfontsize\the\dimexpr#from\relax}{#to}} + +% \def\font_basics_set_mapped_fontsize#from% +% {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname +% \lastnamedcs\else#from% +% \fi} + +%letcsname\??mappedfontsize\s!text \endcsname\!!plusone +\letcsname\??mappedfontsize\s!script \endcsname\!!plustwo +\letcsname\??mappedfontsize\s!scriptscript\endcsname\!!plusthree + \unexpanded\def\mapfontsize - {\dodoubleargument\font_basics_map_fontsize} + {\dotripleargument\font_basics_map_fontsize} + +\def\font_basics_map_fontsize[#class][#from][#to]% + {\setvalue{% + \??mappedfontsize + #class:% + \ifcsname\??mappedfontsize#from\endcsname\lastnamedcs\else1\fi + }{#to}} + +\permanent\tolerant\protected\def\checkedmapfontsize[#class]#spacer[#from]#spacer[#to]% + {\ifcsname\??mappedfontsize#class:\csname\??mappedfontsize#from\endcsname\endcsname + % keep (user) value + \else + \mapfontsize[#class][#from][#to]% + \fi} -\def\font_basics_map_fontsize[#from][#to]% - {\setvalue{\??mappedfontsize\the\dimexpr#from\relax}{#to}} +\permanent\tolerant\def\mappedfontsize#class#from% + {\begincsname + \??mappedfontsize + #class:% + \ifcsname\??mappedfontsize#from\endcsname\lastnamedcs\else1\fi + \endcsname} \def\font_basics_set_mapped_fontsize#from% - {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname - \lastnamedcs\else#from% + {\ifcsname\??mappedfontsize\fontclass:\fontface\endcsname + %\the\dimexpr\lastnamedcs\dimexpr#from\relax\relax + %\the\dimexpr\lastnamedcs\dimexpr\bodyfontsize\relax\relax + \the\dimexpr\lastnamedcs\dimexpr\normalizedbodyfontsize\relax\relax + \else % we could use default + #from% \fi} \installcorenamespace{fontbodyknown} diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua index 5ae6659c5..4937dca31 100644 --- a/tex/context/base/mkiv/font-mis.lua +++ b/tex/context/base/mkiv/font-mis.lua @@ -21,7 +21,7 @@ local readers = otf.readers if readers then - otf.version = otf.version or 3.121 + otf.version = otf.version or 3.130 otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true) function fonts.helpers.getfeatures(name,save) diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua index 9493bd03c..4199db03f 100644 --- a/tex/context/base/mkiv/font-otl.lua +++ b/tex/context/base/mkiv/font-otl.lua @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.121 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.130 -- beware: also sync font-mis.lua and in mtx-fonts otf.cache = containers.define("fonts", "otl", otf.version, true) otf.svgcache = containers.define("fonts", "svg", otf.version, true) otf.pngcache = containers.define("fonts", "png", otf.version, true) @@ -643,25 +643,25 @@ local function read_from_otf(specification) return tfmdata end -local function checkmathsize(tfmdata,mathsize) - local mathdata = tfmdata.shared.rawdata.metadata.math - local mathsize = tonumber(mathsize) - if mathdata then -- we cannot use mathparameters as luatex will complain - local parameters = tfmdata.parameters - parameters.scriptpercentage = mathdata.ScriptPercentScaleDown - parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown - parameters.mathsize = mathsize -- only when a number ! - end -end - -registerotffeature { - name = "mathsize", - description = "apply mathsize specified in the font", - initializers = { - base = checkmathsize, - node = checkmathsize, - } -} +-- local function checkmathsize(tfmdata,mathsize) +-- local mathdata = tfmdata.shared.rawdata.metadata.math +-- local mathsize = tonumber(mathsize) +-- if mathdata then -- we cannot use mathparameters as luatex will complain +-- local parameters = tfmdata.parameters +-- parameters.scriptpercentage = mathdata.ScriptPercentScaleDown +-- parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown +-- parameters.mathsize = mathsize -- only when a number ! +-- end +-- end +-- +-- registerotffeature { +-- name = "mathsize", +-- description = "apply mathsize specified in the font", +-- initializers = { +-- base = checkmathsize, +-- node = checkmathsize, +-- } +-- } -- readers diff --git a/tex/context/base/mkiv/font-oto.lua b/tex/context/base/mkiv/font-oto.lua index 1475fcf67..e8b92c077 100644 --- a/tex/context/base/mkiv/font-oto.lua +++ b/tex/context/base/mkiv/font-oto.lua @@ -504,6 +504,9 @@ local function featuresinitializer(tfmdata,value) local value = features[feature] if value then local validlookups, lookuplist = collectlookups(rawdata,feature,script,language) +-- if not validlookups and not lookuplist and script == "math" then +-- validlookups, lookuplist = collectlookups(rawdata,feature,"dflt","dflt") +-- end if not validlookups then -- skip elseif basesubstitutions and basesubstitutions[feature] then diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua index 248aad04d..198e62bee 100644 --- a/tex/context/base/mkiv/font-oup.lua +++ b/tex/context/base/mkiv/font-oup.lua @@ -898,26 +898,42 @@ local function unifyglyphs(fontdata,usenames) end end -- - for index=1,nofglyphs do - local math = glyphs[index].math - if math then - local list = math.vparts - if list then - for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end - end - local list = math.hparts - if list then - for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end - end - local list = math.vvariants - if list then - -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end - for i=1,#list do list[i] = indices[list[i]] end + if LUATEXENGINE == "luametatex" then + for index=1,nofglyphs do + local math = glyphs[index].math + if math then + local list = math.parts + if list then + for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end + end + local list = math.variants + if list then + for i=1,#list do list[i] = indices[list[i]] end + end end - local list = math.hvariants - if list then - -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end - for i=1,#list do list[i] = indices[list[i]] end + end + else + for index=1,nofglyphs do + local math = glyphs[index].math + if math then + local list = math.vparts + if list then + for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end + end + local list = math.hparts + if list then + for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end + end + local list = math.vvariants + if list then + -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end + for i=1,#list do list[i] = indices[list[i]] end + end + local list = math.hvariants + if list then + -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end + for i=1,#list do list[i] = indices[list[i]] end + end end end end @@ -947,7 +963,6 @@ end local stripredundant do - local p_hex = R("af","AF","09") local p_digit = R("09") local p_done = S("._-")^0 + P(-1) diff --git a/tex/context/base/mkiv/font-sel.lua b/tex/context/base/mkiv/font-sel.lua index 04dd4379b..ab6297f40 100644 --- a/tex/context/base/mkiv/font-sel.lua +++ b/tex/context/base/mkiv/font-sel.lua @@ -77,19 +77,24 @@ local report_typescript = logs.reporter("selectfont","typescripts") defaults["rm"] = { features = { ["sc"] = "*,f:smallcaps" } } defaults["ss"] = { features = { ["sc"] = "*,f:smallcaps" } } -defaults["asanamath"] = { options = { extras = "asana-math", features = "math\\mathsizesuffix", goodies = "anana-math" } } -defaults["cambriamath"] = { options = { extras = "cambria-math", features = "math\\mathsizesuffix", goodies = "cambria-math" } } -defaults["dejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix" } } -defaults["neoeuler"] = { options = { extras = "euler-math", features = "math\\mathsizesuffix" } } -defaults["latinmodernmath"] = { options = { extras = "lm,lm-math", features = "math\\mathsizesuffix,lm-math", goodies = "lm" } } -defaults["lucidabrightmathot"] = { options = { extras = "lucida-opentype-math", features = "math\\mathsizesuffix", goodies = "lucida-opentype-math" } } -defaults["minionmath"] = { options = { extras = "minion-math", features = "math\\mathsizesuffix", goodies = "minion-math" } } -defaults["texgyredejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix" } } -defaults["texgyrepagellamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } } -defaults["texgyrebonummath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } } -defaults["texgyrescholamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } } -defaults["texgyretermesmath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } } -defaults["xitsmath"] = { options = { extras = "xits-math", features = "math\\mathsizesuffix", goodies = "xits-math" } } +-- WS: we need to check the extras with the typescripts + +defaults["asanamath"] = { options = { extras = "asana-math", features = "math\\mathsizesuffix,mathextra", goodies = "anana-math" } } +defaults["cambriamath"] = { options = { extras = "cambria-math", features = "math\\mathsizesuffix,mathextra", goodies = "cambria-math" } } +defaults["euler"] = { options = { extras = "euler-math", features = "math\\mathsizesuffix,mathextra", goodies = "euler-math" } } +defaults["latinmodernmath"] = { options = { extras = "lm,lm-math", features = "math\\mathsizesuffix,mathextra,lm-math", goodies = "modern" } } +defaults["lucidabrightmathot"] = { options = { extras = "lucida-opentype-math", features = "math\\mathsizesuffix,mathextra", goodies = "lucida-math" } } +defaults["minionmath"] = { options = { extras = "minion-math", features = "math\\mathsizesuffix,mathextra", goodies = "minion-math" } } +defaults["stixtwomath"] = { options = { extras = "stix-two-math", features = "math\\mathsizesuffix,mathextra", goodies = "stixtwo-math" } } +defaults["texgyredejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix,mathextra", goodies = "dejavu-math" } } +defaults["texgyrepagellamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "pagella-math" } } +defaults["texgyrebonummath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "bonum-math" } } +defaults["texgyrescholamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "schola-math" } } +defaults["texgyretermesmath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "termes-math" } } +defaults["xitsmath"] = { options = { extras = "xits-math", features = "math\\mathsizesuffix,mathextra", goodies = "xits-math" } } + +defaults["neoeuler"] = defaults["euler"] +defaults["dejavumath"] = defaults["texgyredejavumath"] extras["features"] = function(data,alternative,features) local d = data.options.features diff --git a/tex/context/base/mkiv/font-shp.lua b/tex/context/base/mkiv/font-shp.lua index cab4b7540..feae0ba1c 100644 --- a/tex/context/base/mkiv/font-shp.lua +++ b/tex/context/base/mkiv/font-shp.lua @@ -17,7 +17,7 @@ local pfb = fonts.handlers.pfb local hashes = fonts.hashes local identifiers = hashes.identifiers -local version = otf.version or 0.013 +local version = otf.version or 0.014 local shapescache = containers.define("fonts", "shapes", version, true) local streamscache = containers.define("fonts", "streams", version, true) diff --git a/tex/context/base/mkiv/font-ttf.lua b/tex/context/base/mkiv/font-ttf.lua index d1a3972b2..0f3838c88 100644 --- a/tex/context/base/mkiv/font-ttf.lua +++ b/tex/context/base/mkiv/font-ttf.lua @@ -263,20 +263,28 @@ local function applyaxis(glyph,shape,deltas,dowidth) end if found == last then lastindex = currentindex - break; + break elseif found > last then + +-- \definefontfeature[book][default][axis={weight=800}] +-- \definefont[testfont][file:Commissioner-vf-test.ttf*book] +-- \testfont EΘÄΞ +while lastindex > 1 and dpoints[lastindex] > last do + lastindex = lastindex - 1 +end + break end end end - -- print("unicode: ",glyph.unicode or "?") - -- print("contour: ",first,contour,last) - -- print("index : ",firstindex,lastindex,cnt) - -- print("points : ",dpoints[firstindex],dpoints[lastindex]) + -- print("unicode: ",glyph.unicode or "?") + -- print("contour: ",first,contour,last) + -- print("index : ",firstindex,lastindex,cnt) + -- print("points : ",dpoints[firstindex],dpoints[lastindex]) local function find(i) local prv = lastindex for j=firstindex,lastindex do - local nxt = dpoints[j] + local nxt = dpoints[j] -- we could save this lookup when we return it if nxt == i then return false, j, false elseif nxt > i then @@ -980,8 +988,8 @@ local function readglyph(f,nofcontours) -- read deltas here, saves space local x = 0 for i=1,nofpoints do local flag = flags[i] - -- local short = band(flag,0x04) ~= 0 - -- local same = band(flag,0x20) ~= 0 + -- local short = band(flag,0x02) ~= 0 + -- local same = band(flag,0x10) ~= 0 if band(flag,0x02) ~= 0 then if band(flag,0x10) ~= 0 then x = x + readbyte(f) diff --git a/tex/context/base/mkiv/lang-def.mkiv b/tex/context/base/mkiv/lang-def.mkiv index 441d328c8..19f431ebf 100644 --- a/tex/context/base/mkiv/lang-def.mkiv +++ b/tex/context/base/mkiv/lang-def.mkiv @@ -269,6 +269,23 @@ \c!rightquotation=\leftguillemot, \c!date={\v!day,{.},\space,\v!month,\space,\v!year}] +\installlanguage + [\s!hy] + [\c!spacing=\v!packed, + \c!leftsentence=\endash, % *sentences not confirmed + \c!rightsentence=\endash, + \c!leftsubsentence=\endash, + \c!rightsubsentence=\endash, + \c!leftquote=\guilsingleleft, + \c!rightquote=\guilsingleright, + \c!leftquotation=\leftguillemot + \c!rightquotation=\rightguillemot + \c!date={\v!day,\space,\v!month,\space,\v!year}, % word + % \c!date={\v!day,{.},\v!month,{.},\v!year}, % numbers + \s!patterns=\s!hy, + \s!lefthyphenmin=2, + \s!righthyphenmin=2] + \installlanguage [\s!polish] [\s!pl] \installlanguage [\s!czech] [\s!cs] \installlanguage [\s!slovak] [\s!sk] @@ -276,6 +293,10 @@ \installlanguage [\s!slovenian] [\s!sl] \installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?) +\installlanguage [\s!armenian] [\s!hy] +\installlanguage [\s!hye] [\s!hy] % Eastern Armenian +\installlanguage [\s!hyw] [\s!hy] % Western Armenian + % Cyrillic Languages \installlanguage diff --git a/tex/context/base/mkiv/lang-txt.lua b/tex/context/base/mkiv/lang-txt.lua index 834f9ce43..c4f3603ec 100644 --- a/tex/context/base/mkiv/lang-txt.lua +++ b/tex/context/base/mkiv/lang-txt.lua @@ -32,11 +32,13 @@ if not modules then modules = { } end modules ['lang-txt'] = { -- eo Esperanto Alain Delmotte (2021) -- es Spanish Andrés Montoya, ... -- et Estonian Clyde Johnston (2018) --- fi Finish ... +-- fa Persian Mohammad Hossein Bateni (2016) +-- fi Finnish ... -- fr French Daniel Flipo, Arthur Reutenauer -- gr Greek Apostolos Syropoulos, Thomas Schmitz -- hr Croatian Željko Vrba, Richard Gabriel, Vedran Miletić -- hu Hungarian Adam Reviczky +-- hy Armenian Kristina Nazarjanová (2022) -- it Italian Giuseppe Bilotta, Luigi Scarso -- ja Japanese Richard Gabriel -- kr Korean Jeong Dalyoung @@ -46,7 +48,6 @@ if not modules then modules = { } end modules ['lang-txt'] = { -- nb Norwegian Hans Fredrik Nordhaug, ... -- nn Norwegian Hans Fredrik Nordhaug, ... -- nl Dutch Hans Hagen --- pe Persian Mohammad Hossein Bateni (2016) -- pl Polish Grzegorz Sapijaszko (2011) -- pt Portuguese Pedro F. M. Mendonça -- ro Romanian Dan Seracu, ... @@ -88,6 +89,7 @@ data.labels={ ["es"]="En", ["fa"]="در", ["fr"]="Dans", + ["hy"]="Մեջ", ["mk"]="во", ["sr"]="У", ["sr-latn"]="U", @@ -102,6 +104,7 @@ data.labels={ ["eo"]="Nombro", ["fa"]="شماره", ["fr"]="Numéro", + ["hy"]="Համար", ["mk"]="Број", ["nl"]="Nummer", ["sr"]="Број", @@ -117,10 +120,11 @@ data.labels={ ["eo"]="Volumo", ["et"]="Köide", ["fa"]="جلد", + ["hy"]="Ծավալ", ["mk"]="Том", ["nl"]="Deel", - ["sr"]="Том", ["sr-latn"]="Tom", + ["sr"]="Том", }, }, ["and"]={ @@ -134,6 +138,7 @@ data.labels={ ["et"]="ja", ["fa"]="و", ["fr"]="et", + ["hy"]="և", ["it"]="e", ["mk"]="и", ["nl"]="en", @@ -152,6 +157,7 @@ data.labels={ ["et"]="väljaanne", ["fa"]="ویرایش", ["fr"]="édition", + ["hy"]="հրատարակություն", ["it"]="edizione", ["mk"]="издание", ["nl"]="editie", @@ -169,6 +175,7 @@ data.labels={ ["et"]="toimetaja", ["fa"]="ویراستار", ["fr"]="éditeur", + ["hy"]="խմբագիր", ["it"]="a cura di", ["mk"]="уредник", ["sr"]="уредник", @@ -185,6 +192,7 @@ data.labels={ ["es"]="editores", ["et"]="toimetajad", ["fr"]="éditeurs", + ["hy"]="խմբագիրներ", ["it"]="a cura di", ["mk"]="уредници", ["sr"]="уредници", @@ -201,6 +209,7 @@ data.labels={ ["es"]="en", ["fa"]="در", ["fr"]="dans", + ["hy"]="մեջ", ["mk"]="во", ["sr"]="у", ["sr-latn"]="u", @@ -217,6 +226,7 @@ data.labels={ ["et"]="magistritöö", ["fa"]="پایان‌نامه کارشناسی ارشد", ["fr"]="Thèse de master (DEA, DESS, master)", + ["hy"]="Մագիստրոսական թեզ", ["it"]="Tesi di laurea", ["mk"]="Магистерска дисертација", ["nl"]="Masterproef", @@ -233,6 +243,7 @@ data.labels={ ["eo"]="numero", ["fa"]="شماره", ["fr"]="numéro", + ["hy"]="համար", ["mk"]="број", ["nl"]="nummer", ["sr"]="број", @@ -247,6 +258,7 @@ data.labels={ ["en"]="of", ["eo"]="de", ["fr"]="de", + ["hy"]="-ից", ["mk"]="од", ["nl"]="van", ["sr"]="од", @@ -259,6 +271,7 @@ data.labels={ ["en"]="et al.", ["eo"]="aliaj", ["et"]="jt", + ["hy"]="եւ այլն", ["mk"]="и др.", ["sr"]="и др.", ["sr-latn"]="i dr.", @@ -272,6 +285,7 @@ data.labels={ ["eo"]="p.", ["et"]="lk", ["fa"]="ص", + ["hy"]="էջ", ["mk"]="стр.", ["sr"]="стр.", ["sr-latn"]="str.", @@ -286,6 +300,7 @@ data.labels={ ["eo"]="paĝoj", ["et"]="leheküljed", ["fa"]="صفحات", + ["hy"]="էջեր", ["mk"]="страници", ["nl"]="paginas", ["sr"]="страницa", @@ -302,6 +317,7 @@ data.labels={ ["es"]="Patente", ["et"]="Patent", ["fr"]="Brevet", + ["hy"]="Արտոնագիր", ["it"]="Brevetto", ["mk"]="Патент", ["nl"]="Octrooi", @@ -320,6 +336,7 @@ data.labels={ ["et"]="doktoritöö", ["fa"]="رساله دکتری", ["fr"]="Thèse de doctorat", + ["hy"]="Դոկտորական թեզ", ["it"]="Tesi di dottorato", ["mk"]="Докторска дисертација", ["nl"]="Proefschrift", @@ -334,6 +351,7 @@ data.labels={ ["eo"]="pp.", ["et"]="lk-d", ["fa"]="صص", + ["hy"]="էջ", ["mk"]="стр.", ["sr"]="стр.", ["sr-latn"]="str.", @@ -350,6 +368,7 @@ data.labels={ ["et"]="tehniline raport", ["fa"]="گزارش فنی", ["fr"]="Rapport technique", + ["hy"]="Տեխնիկական հաշվետվություն", ["it"]="Relazione tecnica", ["mk"]="Технички извештај", ["nl"]="Technisch rapport", @@ -366,6 +385,7 @@ data.labels={ ["eo"]="volumo", ["et"]="köide", ["fa"]="جلد", + ["hy"]="ծավալ", ["mk"]="том", ["nl"]="deel", ["sr"]="том", @@ -382,6 +402,7 @@ data.labels={ ["es"]="con", ["et"]="koos", ["fr"]="avec", + ["hy"]="ի հետ", ["it"]="con", ["mk"]="со", ["nl"]="met", @@ -396,6 +417,7 @@ data.labels={ ["cs"]="P", ["en"]="Pr", ["eo"]="P", + ["hy"]="P", ["mk"]="P", ["sk"]="P", ["sr"]="P", @@ -409,6 +431,7 @@ data.labels={ ["eo"]="arccos", ["es"]="arc\\sixperemspace cos", ["hr"]="arc\\sixperemspace cos", + ["hy"]="arccos", ["mk"]="arccos", ["pl"]="arc\\sixperemspace cos", ["sk"]="arccos", @@ -423,6 +446,7 @@ data.labels={ ["eo"]="arccosh", ["es"]="arc\\sixperemspace cosh", ["hr"]="arc\\sixperemspace cosh", + ["hy"]="arccosh", ["mk"]="arccosh", ["pl"]="arc\\sixperemspace cosh", ["sk"]="arccosh", @@ -437,6 +461,7 @@ data.labels={ ["eo"]="arcctan", ["es"]="arc\\sixperemspace cot", ["hr"]="arc\\sixperemspace ctg", + ["hy"]="arcctg", ["mk"]="arccotg", ["pl"]="arc\\sixperemspace ctg", ["sk"]="arccotg", @@ -451,6 +476,7 @@ data.labels={ ["eo"]="arcsin", ["es"]="arc\\sixperemspace sen", ["hr"]="arc\\sixperemspace sin", + ["hy"]="arcsin", ["mk"]="arcsin", ["pl"]="arc\\sixperemspace sin", ["sk"]="arcsin", @@ -465,6 +491,7 @@ data.labels={ ["eo"]="arcsinh", ["es"]="arc\\sixperemspace senh", ["hr"]="arc\\sixperemspace sinh", + ["hy"]="arcsinh", ["mk"]="arcsinh", ["pl"]="arc\\sixperemspace sinh", ["sk"]="arcsinh", @@ -479,6 +506,7 @@ data.labels={ ["eo"]="arctang", ["es"]="arc\\sixperemspace tan", ["hr"]="arc\\sixperemspace tg", + ["hy"]="arctan", ["mk"]="arctg", ["pl"]="arc\\sixperemspace tg", ["sk"]="arctg", @@ -493,6 +521,7 @@ data.labels={ ["eo"]="arctanh", ["es"]="arc\\sixperemspace tanh", ["hr"]="arc\\sixperemspace tgh", + ["hy"]="arctanh", ["mk"]="arctgh", ["pl"]="arc\\sixperemspace tgh", ["sk"]="arctgh", @@ -506,6 +535,7 @@ data.labels={ ["en"]="arg", ["eo"]="arg", ["es"]="arg", + ["hy"]="arg", ["mk"]="arg", ["sk"]="arg", ["sr"]="arg", @@ -518,6 +548,7 @@ data.labels={ ["en"]="cos", ["eo"]="cos", ["es"]="cos", + ["hy"]="cos", ["mk"]="cos", ["sk"]="cos", ["sr"]="cos", @@ -530,6 +561,7 @@ data.labels={ ["en"]="cosh", ["eo"]="cosh", ["es"]="cosh", + ["hy"]="cosh", ["mk"]="cosh", ["sk"]="cosh", ["sr"]="cosh", @@ -543,6 +575,7 @@ data.labels={ ["eo"]="cotan", ["es"]="cot", ["hr"]="ctg", + ["hy"]="cot", ["mk"]="ctg", ["pl"]="ctg", ["sk"]="cotg", @@ -556,6 +589,7 @@ data.labels={ ["en"]="coth", ["eo"]="cotanh", ["es"]="coth", + ["hy"]="coth", ["mk"]="ctgh", ["sk"]="cotgh", ["sr"]="ctgh", @@ -568,6 +602,7 @@ data.labels={ ["en"]="csc", ["eo"]="cosec", ["es"]="csc", + ["hy"]="csc", ["mk"]="cosec", ["sk"]="cosec", ["sr"]="cosec", @@ -581,6 +616,7 @@ data.labels={ ["eo"]="cotan", ["es"]="cot", ["hr"]="ctg", + ["hy"]="cot", ["mk"]="ctg", ["pl"]="ctg", ["sk"]="cotg", @@ -594,6 +630,7 @@ data.labels={ ["en"]="deg", ["eo"]="gr", ["es"]="gr", + ["hy"]="deg", ["mk"]="deg", ["sk"]="deg", ["sr"]="deg", @@ -606,6 +643,7 @@ data.labels={ ["en"]="det", ["eo"]="det", ["es"]="det", + ["hy"]="det", ["sk"]="det", ["sr"]="det", ["sr-latn"]="det", @@ -615,6 +653,7 @@ data.labels={ ["labels"]={ ["en"]="d", ["eo"]="dif", + ["hy"]="diff", }, }, ["dim"]={ @@ -623,6 +662,7 @@ data.labels={ ["en"]="dim", ["eo"]="dim", ["es"]="dim", + ["hy"]="dim", ["mk"]="dim", ["sk"]="dim", ["sr"]="dim", @@ -635,6 +675,7 @@ data.labels={ ["en"]="exp", ["eo"]="eksp", ["es"]="exp", + ["hy"]="exp", ["sk"]="exp", ["sr"]="exp", ["sr-latn"]="exp", @@ -648,6 +689,7 @@ data.labels={ ["eo"]="", ["es"]="mcd", ["hr"]="nzd", + ["hy"]="ԱԸԲ", ["mk"]="НЗД", ["nl"]="ggd", ["sk"]="NSD", @@ -661,6 +703,7 @@ data.labels={ ["en"]="hom", ["eo"]="hom", ["es"]="hom", + ["hy"]="հոմ", ["sk"]="Hom", }, }, @@ -670,6 +713,7 @@ data.labels={ ["en"]="inf", ["eo"]="inf", ["es"]="inf", + ["hy"]="inf", ["mk"]="inf", ["sk"]="inf", ["sr"]="inf", @@ -682,6 +726,7 @@ data.labels={ ["en"]="inv", ["eo"]="inv", ["es"]="inv", + ["hy"]="inv", ["mk"]="inv", ["sk"]="inv", ["sr"]="inv", @@ -694,6 +739,7 @@ data.labels={ ["en"]="inj\\sixperemspace lim", ["eo"]="", ["es"]="lím\\sixperemspace iny", + ["hy"]="inj\\sixperemspace lim", ["sk"]="inj\\sixperemspace lim", ["sr"]="inj\\sixperemspace lim", ["sr-latn"]="inj\\sixperemspace lim", @@ -705,6 +751,7 @@ data.labels={ ["en"]="ker", ["eo"]="", ["es"]="Ker", + ["hy"]="ker", ["sk"]="ker", ["sr"]="ker", ["sr-latn"]="ker", @@ -718,6 +765,7 @@ data.labels={ ["eo"]="", ["es"]="MCM", ["hr"]="nzv", + ["hy"]="աըբ", ["mk"]="НЗС", ["nl"]="kgv", ["sk"]="NSN", @@ -732,6 +780,7 @@ data.labels={ ["en"]="lg", ["eo"]="log", ["es"]="log", + ["hy"]="lg", ["mk"]="lg", ["sk"]="log", ["sr"]="lg", @@ -744,6 +793,7 @@ data.labels={ ["en"]="lim", ["eo"]="lim", ["es"]="lím", + ["hy"]="lim", ["mk"]="lim", ["sk"]="lim", ["sr"]="lim", @@ -756,6 +806,7 @@ data.labels={ ["en"]="lim\\sixperemspace inf", ["eo"]="subinf", ["es"]="lím\\sixperemspace inf", + ["hy"]="lim\\sixperemspace infs", ["mk"]="lim\\sixperemspace inf", ["sk"]="lim\\sixperemspace inf", ["sr"]="lim\\sixperemspace inf", @@ -768,6 +819,7 @@ data.labels={ ["en"]="lim\\sixperemspace sup", ["eo"]="suplim", ["es"]="lím\\sixperemspace sup", + ["hy"]="lim\\sixperemspace sup", ["mk"]="lim\\sixperemspace sup", ["sk"]="lim\\sixperemspace sup", ["sr"]="lim\\sixperemspace sup", @@ -780,6 +832,7 @@ data.labels={ ["en"]="ln", ["eo"]="ln", ["es"]="ln", + ["hy"]="ln", ["mk"]="ln", ["sk"]="ln", ["sr"]="ln", @@ -792,6 +845,7 @@ data.labels={ ["en"]="log", ["eo"]="log", ["es"]="log", + ["hy"]="log", ["mk"]="log", ["sk"]="log", ["sr"]="log", @@ -804,6 +858,7 @@ data.labels={ ["en"]="max", ["eo"]="maks", ["es"]="máx", + ["hy"]="max", ["mk"]="max", ["sk"]="max", ["sr"]="max", @@ -816,6 +871,7 @@ data.labels={ ["en"]="median", ["eo"]="mediano", ["es"]="Mediana", + ["hy"]="միջին", ["sk"]="\\tilde", ["sr"]="median", ["sr-latn"]="median", @@ -827,6 +883,7 @@ data.labels={ ["en"]="min", ["eo"]="min", ["es"]="mín", + ["hy"]="min", ["mk"]="min", ["sk"]="min", ["sr"]="min", @@ -839,6 +896,7 @@ data.labels={ ["en"]="mod", ["eo"]="mod", ["es"]="mod", + ["hy"]="mod", ["mk"]="mod", ["sk"]="mod", ["sr"]="mod", @@ -851,6 +909,7 @@ data.labels={ ["en"]="proj\\sixperemspace lim", ["eo"]="", ["es"]="lím\\sixperemspace proy", + ["hy"]="proj\\sixperemspace lim", ["sk"]="proj\\sixperemspace lim", ["sr"]="proj\\sixperemspace lim", ["sr-latn"]="proj\\sixperemspace lim", @@ -862,6 +921,7 @@ data.labels={ ["en"]="sec", ["eo"]="sek", ["es"]="sec", + ["hy"]="sec", ["mk"]="sec", ["sk"]="sec", ["sr"]="sec", @@ -874,6 +934,7 @@ data.labels={ ["en"]="sin", ["eo"]="sin", ["es"]="sen", + ["hy"]="sin", ["mk"]="sin", ["sk"]="sin", ["sr"]="sin", @@ -886,6 +947,7 @@ data.labels={ ["en"]="sinh", ["eo"]="sinh", ["es"]="senh", + ["hy"]="sinh", ["mk"]="sinh", ["sk"]="sinh", ["sr"]="sinh", @@ -898,6 +960,7 @@ data.labels={ ["en"]="sup", ["eo"]="sup", ["es"]="sup", + ["hy"]="sup", ["mk"]="sup", ["sk"]="sup", ["sr"]="sup", @@ -911,6 +974,7 @@ data.labels={ ["eo"]="tan", ["es"]="tan", ["hr"]="tg", + ["hy"]="tan", ["mk"]="tg", ["pl"]="tg", ["sk"]="tg", @@ -924,6 +988,7 @@ data.labels={ ["en"]="tanh", ["eo"]="tanh", ["es"]="tanh", + ["hy"]="tanh", ["mk"]="tgh", ["sk"]="tgh", ["sr"]="tgh", @@ -949,6 +1014,7 @@ data.labels={ ["gr"]="", ["hr"]=" i ", ["hu"]=" és ", + ["hy"]=" և ", ["it"]="", ["la"]="", ["lt"]="", @@ -991,6 +1057,7 @@ data.labels={ ["gr"]="Παράρτημα ", ["hr"]="Dodatak ", ["hu"]="Melléklet ", + ["hy"]="Հավելված ", ["it"]="", ["ja"]="付録", ["kr"]="부록", @@ -1038,6 +1105,7 @@ data.labels={ ["gr"]="Απρίλιος", ["hr"]="travnja", ["hu"]="április", + ["hy"]="Ապրիլ", ["it"]="aprile", ["ja"]="4", ["kr"]="4", @@ -1066,6 +1134,7 @@ data.labels={ ["labels"]={ ["en"]="Tir", ["fa"]="تیر", + ["hy"]="Տիր", }, }, ["april:mnem"]={ @@ -1085,6 +1154,7 @@ data.labels={ ["gr"]="", ["hr"]="tra", ["hu"]="ápr.", + ["hy"]="Ապր", ["it"]="", ["la"]="", ["lt"]="apr", @@ -1125,6 +1195,7 @@ data.labels={ ["gr"]="", ["hr"]="na stranici ", ["hu"]="oldal ", + ["hy"]="էջում ", ["it"]="a pagina ", ["la"]="", ["lt"]="puslapyje ", @@ -1171,6 +1242,7 @@ data.labels={ ["gr"]="Αύγουστος", ["hr"]="kolovoza", ["hu"]="augusztus", + ["hy"]="Օգոստոս", ["it"]="agosto", ["ja"]="8", ["kr"]="8", @@ -1199,6 +1271,7 @@ data.labels={ ["labels"]={ ["en"]="Aban", ["fa"]="آبان", + ["hy"]="Աբան", }, }, ["august:mnem"]={ @@ -1218,6 +1291,7 @@ data.labels={ ["gr"]="", ["hr"]="kol", ["hu"]="aug.", + ["hy"]="Օգ", ["it"]="", ["la"]="", ["lt"]="aug", @@ -1262,6 +1336,7 @@ data.labels={ ["gr"]="Κεφάλαιο", ["hr"]="Poglavlje ", ["hu"]={ "", " fejezet" }, + ["hy"]="Գլուխ ", ["it"]="", ["ja"]={ "第", "章" }, ["kr"]={ "제", "장" }, @@ -1305,6 +1380,7 @@ data.labels={ ["gr"]="", ["hr"]=" (nastavak)", ["hu"]=" (folytatás)", + ["hy"]=" (շարունակություն)", ["it"]="", ["la"]="", ["lt"]="", @@ -1335,6 +1411,7 @@ data.labels={ ["eo"]="tago", ["et"]="päev", ["fa"]="روز", + ["hy"]="օր", ["kr"]="일", ["mk"]="ден", ["nl"]="dag", @@ -1365,6 +1442,7 @@ data.labels={ ["gr"]="Δεκέμβριος", ["hr"]="prosinca", ["hu"]="december", + ["hy"]="Դեկտեմբեր", ["it"]="dicembre", ["ja"]="12", ["kr"]="12", @@ -1393,6 +1471,7 @@ data.labels={ ["labels"]={ ["en"]="Esfand", ["fa"]="اسفند", + ["hy"]="Էսֆանդ", }, }, ["december:mnem"]={ @@ -1412,6 +1491,7 @@ data.labels={ ["gr"]="", ["hr"]="pro", ["hu"]="dec.", + ["hy"]="Դեկ", ["it"]="", ["la"]="", ["lt"]="dec", @@ -1457,6 +1537,7 @@ data.labels={ ["gr"]="Φεβρουάριος", ["hr"]="veljače", ["hu"]="február", + ["hy"]="Պետրվար", ["it"]="febbraio", ["ja"]="2", ["kr"]="2", @@ -1485,6 +1566,7 @@ data.labels={ ["labels"]={ ["en"]="Ordibehesht", ["fa"]="اردیبهشت", + ["hy"]="Օրդիբեհեշթ", }, }, ["february:mnem"]={ @@ -1504,6 +1586,7 @@ data.labels={ ["gr"]="", ["hr"]="velj", ["hu"]="feb.", + ["hy"]="Փետ", ["it"]="", ["la"]="", ["lt"]="feb", @@ -1547,6 +1630,7 @@ data.labels={ ["gr"]="Σχήμα", ["hr"]="Slika ", ["hu"]={ "", " ábra" }, + ["hy"]="Նկար ", ["it"]="Fig. ", ["ja"]="図", ["kr"]="그림 ", @@ -1577,6 +1661,7 @@ data.labels={ ["en"]="ff.", ["eo"]="sekvv", ["fr"]=hairspace .. "sqq", + ["hy"]="ff.", }, }, ["following:singular"]={ @@ -1585,6 +1670,7 @@ data.labels={ ["en"]="f.", ["eo"]="sekv", ["fr"]=hairspace .. "sq", + ["hy"]="f.", }, }, ["followingpage"]={ @@ -1594,6 +1680,7 @@ data.labels={ ["eo"]="je sekvanta paĝo", ["et"]="järgmisel leheküljel", ["fa"]="در صفحات آینده", + ["hy"]="Հաջորդ էջում", ["mk"]="на следната страница", ["nl"]="op een volgende bladzijde", ["sr"]="на следећој страници", @@ -1621,6 +1708,7 @@ data.labels={ ["gr"]="Παρασκευή", ["hr"]="petak", ["hu"]="péntek", + ["hy"]="ուրբաթ", ["it"]="venerdì", ["ja"]="金曜日", ["kr"]="금요일", @@ -1652,6 +1740,7 @@ data.labels={ ["de"]="Fr.", ["en"]="fri", ["eo"]="ven.", + ["hy"]="Ուրբ", ["sk"]="pi", ["sr"]="пет", ["sr-latn"]="pet", @@ -1678,6 +1767,7 @@ data.labels={ ["gr"]="Γραφικό", ["hr"]="Slika ", ["hu"]={ "", " kép" }, + ["hy"]="Գրաֆ", ["it"]="Grafico ", ["ja"]="イラスト", ["la"]="Typus ", @@ -1721,6 +1811,7 @@ data.labels={ ["gr"]="", ["hr"]="vidi gore", ["hu"]="lásd feljebb", + ["hy"]="ստորև նշված", ["it"]="come mostrato sopra", ["kr"]="그러므로", ["la"]="", @@ -1764,6 +1855,7 @@ data.labels={ ["gr"]="", ["hr"]="vidi ispod", ["hu"]="lásd lejjebb", + ["hy"]="ինչպես ցույց է տրված ստորև", ["it"]="come mostrato sotto", ["kr"]="이후로", ["la"]="", @@ -1807,6 +1899,7 @@ data.labels={ ["gr"]="Παύση", ["hr"]="Intermeco ", ["hu"]={ "", " intermezzo" }, + ["hy"]="Ինտերմեցո", ["it"]="Intermezzo ", ["ja"]="間奏曲", ["kr"]="간주곡", @@ -1854,6 +1947,7 @@ data.labels={ ["gr"]="Ιανουάριος", ["hr"]="siječnja", ["hu"]="január", + ["hy"]="Հունվար", ["it"]="gennaio", ["ja"]="1", ["kr"]="1", @@ -1882,6 +1976,7 @@ data.labels={ ["labels"]={ ["en"]="Farvardin", ["fa"]="فروردین", + ["hy"]="Ֆարվարդին", }, }, ["january:mnem"]={ @@ -1901,6 +1996,7 @@ data.labels={ ["gr"]="", ["hr"]="sij", ["hu"]="jan.", + ["hy"]="Հունվ", ["it"]="", ["la"]="", ["lt"]="jan", @@ -1947,6 +2043,7 @@ data.labels={ ["gr"]="Ιούλιος", ["hr"]="srpnja", ["hu"]="július", + ["hy"]="Հուլիս", ["it"]="luglio", ["ja"]="7", ["kr"]="7", @@ -1975,6 +2072,7 @@ data.labels={ ["labels"]={ ["en"]="Mehr", ["fa"]="مهر", + ["hy"]="Մեհր", }, }, ["july:mnem"]={ @@ -1994,6 +2092,7 @@ data.labels={ ["gr"]="", ["hr"]="srp", ["hu"]="júl.", + ["hy"]="Հուլ", ["it"]="", ["la"]="", ["lt"]="jul", @@ -2039,6 +2138,7 @@ data.labels={ ["gr"]="Ιούνιος", ["hr"]="lipnja", ["hu"]="június", + ["hy"]="Հունիսի", ["it"]="giugno", ["ja"]="6", ["kr"]="6", @@ -2067,6 +2167,7 @@ data.labels={ ["labels"]={ ["en"]="Shahrivar", ["fa"]="شهریور", + ["hy"]="Շահրիվար", }, }, ["june:mnem"]={ @@ -2086,6 +2187,7 @@ data.labels={ ["gr"]="", ["hr"]="lip", ["hu"]="jún.", + ["hy"]="Հուն", ["it"]="", ["la"]="", ["lt"]="jun", @@ -2129,6 +2231,7 @@ data.labels={ ["gr"]="Γραμμή", ["hr"]="redak ", ["hu"]={ "", " sor" }, + ["hy"]="Տող ", ["it"]="riga ", ["ja"]="線", ["kr"]="행", @@ -2174,6 +2277,7 @@ data.labels={ ["gr"]="Γραμμές", ["hr"]="retci ", ["hu"]="sorok ", + ["hy"]="Տողեր ", ["it"]="righe ", ["ja"]="線", ["kr"]="행", @@ -2220,6 +2324,7 @@ data.labels={ ["gr"]="Μάρτιος", ["hr"]="ožujka", ["hu"]="március", + ["hy"]="Մարտ", ["it"]="marzo", ["ja"]="3", ["kr"]="3", @@ -2248,6 +2353,7 @@ data.labels={ ["labels"]={ ["en"]="Khordad", ["fa"]="خرداد", + ["hy"]="Խորդադ", }, }, ["march:mnem"]={ @@ -2267,6 +2373,7 @@ data.labels={ ["gr"]="", ["hr"]="ožu", ["hu"]="már.", + ["hy"]="Մարտ", ["it"]="", ["la"]="", ["lt"]="mar", @@ -2313,6 +2420,7 @@ data.labels={ ["gr"]="Μάιος", ["hr"]="svibnja", ["hu"]="május", + ["hy"]="Մայիս", ["it"]="maggio", ["ja"]="5", ["kr"]="5", @@ -2341,6 +2449,7 @@ data.labels={ ["labels"]={ ["en"]="Mordad", ["fa"]="مرداد", + ["hy"]="Մորդադ", }, }, ["may:mnem"]={ @@ -2360,6 +2469,7 @@ data.labels={ ["gr"]="", ["hr"]="svi", ["hu"]="máj.", + ["hy"]="Մայ", ["it"]="", ["la"]="", ["lt"]="may", @@ -2403,6 +2513,7 @@ data.labels={ ["gr"]="Δευτέρα", ["hr"]="ponedjeljak", ["hu"]="hétfő", + ["hy"]="երկուշաբթի", ["it"]="lunedì", ["ja"]="月曜日", ["kr"]="월요일", @@ -2434,6 +2545,7 @@ data.labels={ ["de"]="Mo.", ["en"]="mon", ["eo"]="lun.", + ["hy"]="Երկ", ["sk"]="po", ["sr"]="пон", ["sr-latn"]="pon", @@ -2448,6 +2560,7 @@ data.labels={ ["eo"]="monato", ["et"]="kuu", ["fa"]="ماه", + ["hy"]="ամիս", ["kr"]="월", ["mk"]="месец", ["nl"]="maand", @@ -2478,6 +2591,7 @@ data.labels={ ["gr"]="Νοέμβριος", ["hr"]="studenog", ["hu"]="november", + ["hy"]="Նոյեմբեր", ["it"]="novembre", ["ja"]="11", ["kr"]="11", @@ -2506,6 +2620,7 @@ data.labels={ ["labels"]={ ["en"]="Bahman", ["fa"]="بهمن", + ["hy"]="Բահման", }, }, ["november:mnem"]={ @@ -2525,6 +2640,7 @@ data.labels={ ["gr"]="", ["hr"]="stu", ["hu"]="nov.", + ["hy"]="Նոյ", ["it"]="", ["la"]="", ["lt"]="nov", @@ -2569,6 +2685,7 @@ data.labels={ ["gr"]="Οκτώβριος", ["hr"]="listopada", ["hu"]="október", + ["hy"]="հոկտեմբեր", ["it"]="ottobre", ["ja"]="10", ["kr"]="10", @@ -2597,6 +2714,7 @@ data.labels={ ["labels"]={ ["en"]="Dey", ["fa"]="دی", + ["hy"]="Դեյ", }, }, ["october:mnem"]={ @@ -2616,6 +2734,7 @@ data.labels={ ["gr"]="", ["hr"]="lis", ["hu"]="okt.", + ["hy"]="Հոկ", ["it"]="", ["la"]="", ["lt"]="oct", @@ -2658,6 +2777,7 @@ data.labels={ ["gr"]="", ["hr"]="stranica ", ["hu"]="oldal ", + ["hy"]="էջ ", ["it"]="pagina ", ["kr"]="쪽", ["la"]="", @@ -2702,6 +2822,7 @@ data.labels={ ["gr"]="Μέρος", ["hr"]="Dio ", ["hu"]={ "", " rész" }, + ["hy"]="Մաս ", ["it"]="Parte ", ["ja"]={ "第", "パート" }, ["kr"]={ "제", "부" }, @@ -2733,6 +2854,7 @@ data.labels={ ["eo"]="sur antaŭa paĝo", ["et"]="eelmisel lehel", ["fa"]="در صفحات گذشته", + ["hy"]="նախորդ էջ", ["mk"]="на претходната страница", ["nl"]="op een voorgaande bladzijde", ["sr"]="на претходној страници", @@ -2760,6 +2882,7 @@ data.labels={ ["gr"]="Σάββατο", ["hr"]="subota", ["hu"]="szombat", + ["hy"]="շաբաթ", ["it"]="sabato", ["ja"]="土曜日", ["kr"]="토요일", @@ -2791,6 +2914,7 @@ data.labels={ ["de"]="Sa.", ["en"]="sat", ["eo"]="sab.", + ["hy"]="Շաբ", ["sk"]="so", ["sr"]="суб", ["sr-latn"]="sub", @@ -2817,6 +2941,7 @@ data.labels={ ["gr"]="Ενότητα", ["hr"]="Odjeljak ", ["hu"]="Fejezet ", + ["hy"]="Բաժին ", ["it"]="", ["ja"]={ "第", "項" }, ["kr"]={ "제", "절" }, @@ -2861,6 +2986,7 @@ data.labels={ ["gr"]="", ["hr"]="vidi ", ["hu"]="lásd ", + ["hy"]="Նայել ", ["it"]="cf. ", ["kr"]="", ["la"]="", @@ -2907,6 +3033,7 @@ data.labels={ ["gr"]="Σεπτέμβριος", ["hr"]="rujna", ["hu"]="szeptember", + ["hy"]="Սեպտեմբեր", ["it"]="settembre", ["ja"]="9", ["kr"]="9", @@ -2935,6 +3062,7 @@ data.labels={ ["labels"]={ ["en"]="Azar", ["fa"]="آذر", + ["hy"]="Ազար", }, }, ["september:mnem"]={ @@ -2954,6 +3082,7 @@ data.labels={ ["gr"]="", ["hr"]="ruj", ["hu"]="szep.", + ["hy"]="Սեպ", ["it"]="", ["la"]="", ["lt"]="sep", @@ -2997,6 +3126,7 @@ data.labels={ ["gr"]="Υπόενότητα", ["hr"]="Pododjeljak ", ["hu"]="Alfejezet ", + ["hy"]=" Ենթաբաժին ", ["it"]="", ["ja"]="", ["la"]="", @@ -3041,6 +3171,7 @@ data.labels={ ["gr"]="", ["hr"]="Podpododjeljak ", ["hu"]="Al-alfejezet ", + ["hy"]="Ենթաենթաբաժին ", ["it"]="", ["ja"]="", ["la"]="", @@ -3085,6 +3216,7 @@ data.labels={ ["gr"]="", ["hr"]="Podpodpododjeljak ", ["hu"]="Al-al-alfejezet ", + ["hy"]="Ենթաենթաենթաբաժին ", ["it"]="", ["ja"]="", ["la"]="", @@ -3129,6 +3261,7 @@ data.labels={ ["gr"]="Κυριακή", ["hr"]="nedjelja", ["hu"]="vasárnap", + ["hy"]="կիրակի", ["it"]="domenica", ["ja"]="日曜日", ["kr"]="일요일", @@ -3160,6 +3293,7 @@ data.labels={ ["de"]="So.", ["en"]="sun", ["eo"]="dim.", + ["hy"]="Կիր", ["sk"]="ne", ["sr"]="нед", ["sr-latn"]="ned", @@ -3186,6 +3320,7 @@ data.labels={ ["gr"]="Πίνακας", ["hr"]="Tablica ", ["hu"]={ "", " táblázat" }, + ["hy"]="Աղյուսակ ", ["it"]="Tabella ", ["ja"]="表", ["kr"]="표 ", @@ -3231,6 +3366,7 @@ data.labels={ ["gr"]="Πέμπτη", ["hr"]="četvrtak", ["hu"]="csütörtök", + ["hy"]="հինգշաբթի", ["it"]="giovedì", ["ja"]="木曜日", ["kr"]="목요일", @@ -3262,6 +3398,7 @@ data.labels={ ["de"]="Do.", ["en"]="thu", ["eo"]="ĵaŭ.", + ["hy"]="Հնգ", ["sk"]="št", ["sr"]="чет", ["sr-latn"]="čet", @@ -3288,6 +3425,7 @@ data.labels={ ["gr"]="Τρίτη", ["hr"]="utorak", ["hu"]="kedd", + ["hy"]="երեքշաբթի", ["it"]="martedì", ["ja"]="火曜日", ["kr"]="화요일", @@ -3319,6 +3457,7 @@ data.labels={ ["de"]="Di.", ["en"]="tue", ["eo"]="mar.", + ["hy"]="Երք", ["sk"]="út", ["sr"]="уто", ["sr-latn"]="uto", @@ -3345,6 +3484,7 @@ data.labels={ ["gr"]="Τετάρτη", ["hr"]="srijeda", ["hu"]="szerda", + ["hy"]="չորեքշաբթի", ["it"]="mercoledì", ["ja"]="水曜日", ["kr"]="수요일", @@ -3376,6 +3516,7 @@ data.labels={ ["de"]="Mi.", ["en"]="wed", ["eo"]="mer.", + ["hy"]="չոր", ["sk"]="st", ["sr"]="сре", ["sr-latn"]="sre", @@ -3389,6 +3530,7 @@ data.labels={ ["eo"]="jaro", ["et"]="aasta", ["fa"]="سال", + ["hy"]="Տարի", ["kr"]="년", ["mk"]="година", ["nl"]="jaar", @@ -3419,6 +3561,7 @@ data.labels={ ["gr"]="Συντομογραφίες", ["hr"]="Kratice", ["hu"]="Rövidítések", + ["hy"]="Հապավումներ", ["it"]="Abbreviazioni", ["ja"]="略語", ["kr"]="약어", @@ -3464,6 +3607,7 @@ data.labels={ ["gr"]="Περιεχόμενα", ["hr"]="Sadržaj", ["hu"]="Tartalom", + ["hy"]="Բովանդակություն", ["it"]="Indice", ["ja"]="目次", ["kr"]="목차", @@ -3508,6 +3652,7 @@ data.labels={ ["gr"]="Σχήματα", ["hr"]="Slike", ["hu"]="Ábrák", + ["hy"]="Նկարազարդումներ", ["it"]="Figure", ["ja"]="図", ["kr"]="그림 ", @@ -3553,6 +3698,7 @@ data.labels={ ["gr"]="Γραφικά", ["hr"]="Slike", ["hu"]="Grafikák", + ["hy"]="Գծապատկեր", ["it"]="Grafici", ["ja"]="グラフ", ["kr"]="그래픽 ", @@ -3598,6 +3744,7 @@ data.labels={ ["gr"]="Ευρετήριο", ["hr"]="Indeks", ["hu"]="Index", + ["hy"]="Այբբենական ցուցիչ", ["it"]="Indice", ["ja"]="目次", ["kr"]="찾아보기", @@ -3642,6 +3789,7 @@ data.labels={ ["gr"]="Παύσεις", ["hr"]="Intermeci", ["hu"]="Intermezzok", + ["hy"]="Ինտերլյուդներ", ["it"]="Intermezzi", ["ja"]="間奏曲", ["kr"]="간주곡", @@ -3687,6 +3835,7 @@ data.labels={ ["gr"]="Λογότυπα", ["hr"]="Logotipi", ["hu"]="Fejlécek", + ["hy"]="Լոգոներ", ["it"]="Logotipi", ["ja"]="理性", ["kr"]="이성", @@ -3728,6 +3877,7 @@ data.labels={ ["gr"]="", ["hr"]="Literatura", ["hu"]="Bibliográfia", + ["hy"]="Գրականութիւն", ["it"]="Bibliografia", ["kr"]="참고문헌", ["la"]="", @@ -3771,6 +3921,7 @@ data.labels={ ["gr"]="Πίνακες", ["hr"]="Tablice", ["hu"]="Táblázatok", + ["hy"]="Աղյուսակներ", ["it"]="Tabelle", ["ja"]="机", ["kr"]="표 ", @@ -3816,6 +3967,7 @@ data.labels={ ["gr"]="Μονάδες", ["hr"]="Jedinice", ["hu"]="Mértékegységek", + ["hy"]="Չափման միավորներ", ["it"]="Unità", ["ja"]="ユニッツ", ["kr"]="측정단위", diff --git a/tex/context/base/mkiv/mtx-context-setters.tex b/tex/context/base/mkiv/mtx-context-setters.tex index 3201ae3ba..c90c385c5 100644 --- a/tex/context/base/mkiv/mtx-context-setters.tex +++ b/tex/context/base/mkiv/mtx-context-setters.tex @@ -24,9 +24,12 @@ \starttext -\doifdocumentargument {trackers} { \ctxlua {trackers .show(environment.arguments.pattern) } } -\doifdocumentargument {directives} { \ctxlua {directives .show(environment.arguments.pattern) } } -\doifdocumentargument {experiments} { \ctxlua {experiments.show(environment.arguments.pattern) } } +\doifdocumentargument {trackers} { \ctxlua {trackers .show(environment.arguments.pattern) } } +\doifdocumentargument {directives} { \ctxlua {directives .show(environment.arguments.pattern) } } +\doifdocumentargument {experiments} { \ctxlua {experiments.show(environment.arguments.pattern) } } +\doifdocumentargument {showtrackers} { \ctxlua {trackers .show(environment.arguments.pattern) } } +\doifdocumentargument {showdirectives} { \ctxlua {directives .show(environment.arguments.pattern) } } +\doifdocumentargument {showexperiments} { \ctxlua {experiments.show(environment.arguments.pattern) } } \stoptext diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index e4566b7e4..835588e46 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -112,7 +112,8 @@ return { "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", - "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", + "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", + "extendaccentsmathcontrolcode", -- "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", @@ -188,7 +189,7 @@ return { "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", - "optionalspace", "asciispacechar", "softhyphen", + "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", -- "Ux", "eUx", "Umathaccents", -- diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index 60fb704d4..32b8aa440 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -648,6 +648,7 @@ return { "unletprotected", "untraced", "unvpack", + "variablefam", "vpack", "wordboundary", "wrapuppar", diff --git a/tex/context/base/mkiv/mult-sys.mkiv b/tex/context/base/mkiv/mult-sys.mkiv index 149a7ac24..07ec16e2b 100644 --- a/tex/context/base/mkiv/mult-sys.mkiv +++ b/tex/context/base/mkiv/mult-sys.mkiv @@ -44,6 +44,10 @@ % definesystemconstant {vn} \definesystemconstant {afrikaans} \definesystemconstant {af} +\definesystemconstant {albanian} \definesystemconstant {sq} +\definesystemconstant {armenian} \definesystemconstant {hy} + \definesystemconstant {hye} + \definesystemconstant {hyw} \definesystemconstant {ancientgreek} \definesystemconstant {agr} \definesystemconstant {ancientlatin} \definesystemconstant {ala} \definesystemconstant {arabic} \definesystemconstant {ar} diff --git a/tex/context/base/mkiv/spac-chr.lua b/tex/context/base/mkiv/spac-chr.lua index 233552460..f9b4da31a 100644 --- a/tex/context/base/mkiv/spac-chr.lua +++ b/tex/context/base/mkiv/spac-chr.lua @@ -28,7 +28,10 @@ local nodes, node = nodes, node local nuts = nodes.nuts +local getid = nuts.getid local getboth = nuts.getboth +local getsubtype = nuts.getsubtype +local setsubtype = nuts.setsubtype local getnext = nuts.getnext local getprev = nuts.getprev local getattr = nuts.getattr @@ -37,7 +40,6 @@ local getlanguage = nuts.getlanguage local setchar = nuts.setchar local setattrlist = nuts.setattrlist local getfont = nuts.getfont -local setsubtype = nuts.setsubtype local isglyph = nuts.isglyph local setcolor = nodes.tracers.colors.set @@ -60,10 +62,12 @@ local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue local spaceskip_code = gluecodes.spaceskip local chardata = characters.data -local is_punctuation = characters.is_punctuation +local ispunctuation = characters.is_punctuation +local canhavespace = characters.can_have_space local typesetters = typesetters @@ -182,13 +186,27 @@ local methods = { -- maybe also 0x0008 : backspace + [0x001E] = function(head,current) -- kind of special + local next = getnext(current) + head, current = remove_node(head,current,true) + if next and getid(next) == glue_code and getsubtype(next) == spaceskip_code then + local nextnext = getnext(next) + if nextnext then + local char, font = isglyph(nextnext) + if char and not canhavespace[char] then + remove_node(head,next,true) + end + end + end + end, + [0x001F] = function(head,current) -- kind of special local next = getnext(current) if next then local char, font = isglyph(next) if char then head, current = remove_node(head,current,true) - if not is_punctuation[char] then + if not ispunctuation[char] then local p = fontparameters[font] head, current = insertnodebefore(head,current,new_glue(p.space,p.space_stretch,p.space_shrink)) end diff --git a/tex/context/base/mkiv/spac-chr.mkiv b/tex/context/base/mkiv/spac-chr.mkiv index 9113dc6a1..4c7cc9492 100644 --- a/tex/context/base/mkiv/spac-chr.mkiv +++ b/tex/context/base/mkiv/spac-chr.mkiv @@ -95,7 +95,8 @@ \popoverloadmode -\chardef\optionalspace"1F % will be space unless before punctuation +\chardef\optionalspace "1F % will be space unless before punctuation +\chardef\autoinsertedspace"1E % a more clever \autoinsertspace % Shortcuts: diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index c02ca06bf..13b79a990 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 8c4741da4..bd256d4ec 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/type-set.mkiv b/tex/context/base/mkiv/type-set.mkiv index 269d41966..c87129e94 100644 --- a/tex/context/base/mkiv/type-set.mkiv +++ b/tex/context/base/mkiv/type-set.mkiv @@ -62,9 +62,9 @@ \definefilesynonym [type-imp-latin-modern.mkiv] [type-imp-latinmodern.mkiv] \definefilesynonym [type-imp-modern-latin.mkiv] [type-imp-modernlatin.mkiv] -\definefilesynonym [type-imp-lucida.mkiv] [type-imp-lucida-typeone.mkiv] -\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida-opentype.mkiv] -\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida-opentype.mkiv] +\definefilesynonym [type-imp-lucida-opentype.mkiv] [type-imp-lucida.mkiv] +\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida.mkiv] +\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida.mkiv] \definefilesynonym [type-imp-dejavu-condensed.mkiv] [type-imp-dejavu.mkiv] diff --git a/tex/context/base/mkxl/char-tex.lmt b/tex/context/base/mkxl/char-tex.lmt index e5ce1c4ab..02d9a6cb6 100644 --- a/tex/context/base/mkxl/char-tex.lmt +++ b/tex/context/base/mkxl/char-tex.lmt @@ -36,7 +36,6 @@ local is_letter = characters.is_letter local is_command = characters.is_command local is_spacing = characters.is_spacing local is_mark = characters.is_mark -local is_punctuation = characters.is_punctuation local data = characters.data if not data then return end local blocks = characters.blocks diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index f890b8877..48532ede6 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2022.10.22 11:20} +\newcontextversion{2022.11.14 22:54} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index 9c7a785f8..d111761b0 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2022.10.22 11:20} +\immutable\edef\contextversion{2022.11.14 22:54} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/font-chk.lmt b/tex/context/base/mkxl/font-chk.lmt index 089e68f9f..05a3611cc 100644 --- a/tex/context/base/mkxl/font-chk.lmt +++ b/tex/context/base/mkxl/font-chk.lmt @@ -379,16 +379,11 @@ local function expandglyph(characters,index,done) if n then d.next = expandglyph(characters,n,done) end - local h = d.hparts - if h then - for i=1,#h do - h[i].glyph = expandglyph(characters,h[i].glyph,done) - end - end - local v = d.vparts - if v then - for i=1,#v do - v[i].glyph = expandglyph(characters,v[i].glyph,done) + local p = d.parts + if p then + for i=1,#p do + local pi = p[i] + pi.glyph = expandglyph(characters,pi.glyph,done) end end return d diff --git a/tex/context/base/mkxl/font-con.lmt b/tex/context/base/mkxl/font-con.lmt index 2e32193e9..daf106a8a 100644 --- a/tex/context/base/mkxl/font-con.lmt +++ b/tex/context/base/mkxl/font-con.lmt @@ -276,6 +276,8 @@ local function scaleparts(parts,delta) return t end +-- getcharactertagvalues + function constructors.scale(tfmdata,specification) local target = { } -- the new table -- @@ -320,20 +322,20 @@ function constructors.scale(tfmdata,specification) -- local mathsize = tonumber(specification.mathsize) or 0 local textsize = tonumber(specification.textsize) or scaledpoints - local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize" + -- local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize" 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 - scaledpoints = parameters.scriptscriptpercentage * textsize / 100 - elseif forcedsize > 1000 then -- safeguard - scaledpoints = forcedsize - else - -- in context x and xx also use mathsize - end + -- 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 + -- scaledpoints = parameters.scriptscriptpercentage * textsize / 100 + -- elseif forcedsize > 1000 then -- safeguard + -- scaledpoints = forcedsize + -- else + -- -- in context x and xx also use mathsize + -- end targetparameters.mathsize = mathsize targetparameters.textsize = textsize - targetparameters.forcedsize = forcedsize + -- targetparameters.forcedsize = forcedsize targetparameters.extrafactor = extrafactor -- local defaultwidth = resources.defaultwidth or 0 @@ -356,6 +358,7 @@ function constructors.scale(tfmdata,specification) -- local askedscaledpoints = scaledpoints local scaledpoints, delta = constructors.calculatescale(tfmdata,scaledpoints,nil,specification) -- no shortcut, dan be redefined +-- print("B",mathsize,askedscaledpoints,scaledpoints,delta) -- local hdelta = delta local vdelta = delta @@ -486,7 +489,7 @@ function constructors.scale(tfmdata,specification) -- local ascender = parameters.ascender if ascender then - targetparameters.ascender = delta * ascender + targetparameters.ascender = delta * ascender end local descender = parameters.descender if descender then @@ -671,6 +674,10 @@ function constructors.scale(tfmdata,specification) if ve then chr.expansion = ve*1000 -- expansionfactor, hm, can happen elsewhere end + local vc = character.compression + if vc then + chr.compression = vc*1000 -- expansionfactor, hm, can happen elsewhere + end local vl = character.leftprotrusion if vl then chr.leftprotrusion = width*vl @@ -682,60 +689,42 @@ function constructors.scale(tfmdata,specification) end -- if hasmath then - -- - -- todo, just operate on descriptions.math local nxt = character.next if nxt then chr.next = nxt end - local vparts = character.vparts - if vparts then - chr.vparts = scaleparts(vparts,vdelta) - end - local hparts = character.hparts - if hparts then - chr.hparts = scaleparts(hparts,hdelta) + local parts = character.parts + if parts then + local orientation = character.partsorientation or "vertical" + chr.parts = scaleparts(parts,orientation == "horizontal" and hdelta or vdelta) + chr.partsorientation = orientation end - local vi = character.vitalic + local vi = character.partsitalic if vi and vi ~= 0 then - chr.vitalic = vi*hdelta + chr.partsitalic = vi*hdelta end --- local va = character.accent --- if va and not chr.topanchor then --- chr.topanchor = va --- end local va = character.topanchor - if va then + if va and va ~= 0 then chr.topanchor = va*vdelta end va = character.bottomanchor - if va then + if va and va ~= 0 then chr.bottomanchor = va*vdelta end - local vo = character.topovershoot - if vo then - chr.topovershoot = vo*hdelta - end - -- vo = character.bottomovershoot - -- if vo then - -- chr.bottomovershoot = vo*hdelta - -- end -- - -- if stackmath then -- not ok yet - local mk = character.mathkerns - if mk then - local tr = mk.topright - local tl = mk.topleft - local br = mk.bottomright - local bl = mk.bottomleft - chr.mathkerns = { - topright = tr and mathkerns(tr,vdelta) or nil, - topleft = tl and mathkerns(tl,vdelta) or nil, - bottomright = br and mathkerns(br,vdelta) or nil, - bottomleft = bl and mathkerns(bl,vdelta) or nil, - } - end - -- end + local mk = character.mathkerns + if mk then + local tr = mk.topright + local tl = mk.topleft + local br = mk.bottomright + local bl = mk.bottomleft + chr.mathkerns = { + topright = tr and mathkerns(tr,vdelta) or nil, + topleft = tl and mathkerns(tl,vdelta) or nil, + bottomright = br and mathkerns(br,vdelta) or nil, + bottomleft = bl and mathkerns(bl,vdelta) or nil, + } + end -- if hasitalics then local vi = character.italic @@ -743,42 +732,46 @@ function constructors.scale(tfmdata,specification) chr.italic = vi*hdelta end end - local vk = character.topleft - if vk and vk ~= 0 then - chr.topleft = vk*hdelta - end - local vk = character.topright - if vk and vk ~= 0 then - chr.topright = vk*hdelta - end - local vk = character.bottomleft - if vk and vk ~= 0 then - chr.bottomleft = vk*hdelta - end - local vk = character.bottomright - if vk and vk ~= 0 then - chr.bottomright = vk*hdelta - end - -- local ft = character.options - -- if ft then - -- chr.options = ft + -- + -- These can never happen here as these come from tweaks but I need to check it: + -- + -- local vo = character.topovershoot + -- if vo and vo ~= 0 then + -- chr.topovershoot = vo*hdelta -- end + -- local il = character.innerlocation + -- if il then + -- chr.innerlocation = il + -- chr.innerxoffset = (character.innerxoffset or 0) * hdelta + -- chr.inneryoffset = (character.inneryoffset or 0) * vdelta + -- end + -- + -- if character.extensible then + -- chr.extensible = true -- stretch fixed width accent + -- end + -- -- + -- local k = character.topleft if k and k ~= 0 then chr.topleft = k*hdelta end + -- local k = character.topright if k and k ~= 0 then chr.topright = k*hdelta end + -- local k = character.bottomleft if k and k ~= 0 then chr.bottomleft = k*hdelta end + -- local k = character.bottomright if k and k ~= 0 then chr.bottomright = k*hdelta end + -- -- + -- local m = character.leftmargin if m and m ~= 0 then chr.leftmargin = m*hdelta end + -- local m = character.rightmargin if m and m ~= 0 then chr.rightmargin = m*hdelta end + -- local m = character.topmargin if m and m ~= 0 then chr.topmargin = m*hdelta end + -- local m = character.bottommargin if m and m ~= 0 then chr.bottommargin = m*hdelta end + -- local sm = character.smaller if sm then chr.smaller = sm end - local mi = character.mirror - if mi then - chr.mirror = mi - end - local fa = character.flataccent + -- local mi = character.mirror + -- if mi then + -- chr.mirror = mi + -- end + local fa = character.flataccent -- set here? if fa then chr.flataccent = fa end - local m = character.leftmargin if m and m ~= 0 then chr.leftmargin = m*hdelta end - local m = character.rightmargin if m and m ~= 0 then chr.rightmargin = m*hdelta end - local m = character.topmargin if m and m ~= 0 then chr.topmargin = m*hdelta end - local m = character.bottommargin if m and m ~= 0 then chr.bottommargin = m*hdelta end elseif autoitalicamount then -- itlc feature local vi = description.italic if not vi then diff --git a/tex/context/base/mkxl/font-ctx.lmt b/tex/context/base/mkxl/font-ctx.lmt index 83c0a912b..23c676e4e 100644 --- a/tex/context/base/mkxl/font-ctx.lmt +++ b/tex/context/base/mkxl/font-ctx.lmt @@ -187,6 +187,12 @@ constructors.noffontsloaded = 0 -- font.getcopy = font.getfont -- we always want the table that context uses +local accuratefactors = false +----- compactfontmode = false + +experiments.register("fonts.accurate", function(v) accuratefactors = v end) +experiments.register("fonts.compact", function() accuratefactors = true end) + do -- Does this still make sense? @@ -1635,8 +1641,11 @@ function constructors.calculatescale(tfmdata,scaledpoints,relativeid,specificati scaledpoints = (- scaledpoints/1000) * (tfmdata.designsize or parameters.designsize) -- already in sp end -- a temp hack till we have upgraded all mechanisms - local delta = round(scaledpoints/units) + local delta = scaledpoints/units local size = round(scaledpoints) + if not accuratefactors then + delta = round(delta) + end texsetcount(c_font_scaled_points,size) -- return size, delta @@ -1662,16 +1671,17 @@ function constructors.hashinstance(specification,force) end specification.size = size if fallbacks then - return hash .. ' @ ' .. size .. ' @ ' .. fallbacks + hash = hash .. ' @ ' .. size .. ' @ ' .. fallbacks else local scalemode = specification.scalemode local special = scalemode and specialscale[scalemode] if special then - return hash .. ' @ ' .. size .. ' @ ' .. special + hash = hash .. ' @ ' .. size .. ' @ ' .. special else - return hash .. ' @ ' .. size + hash = hash .. ' @ ' .. size end end + return hash end -- We overload the (generic) resolver: @@ -2356,7 +2366,7 @@ do end implement { - name = "nbfs", + name = "normalizedbodyfontsize", arguments = "dimen", actions = function(d) context(lpegmatch(stripper,f_strip(d/65536))) diff --git a/tex/context/base/mkxl/font-def.lmt b/tex/context/base/mkxl/font-def.lmt index d71132180..6afeeb474 100644 --- a/tex/context/base/mkxl/font-def.lmt +++ b/tex/context/base/mkxl/font-def.lmt @@ -474,6 +474,7 @@ function definers.read(specification,size,id) -- id can be optional, name can al end specification = definers.resolve(specification) local hash = constructors.hashinstance(specification) +-- inspect(hash) local tfmdata = definers.registered(hash) -- id local name = specification.name if tfmdata then diff --git a/tex/context/base/mkxl/font-imp-quality.lmt b/tex/context/base/mkxl/font-imp-quality.lmt index 93ec1b653..9c57613ee 100644 --- a/tex/context/base/mkxl/font-imp-quality.lmt +++ b/tex/context/base/mkxl/font-imp-quality.lmt @@ -124,6 +124,9 @@ vectors['default'] = { vectors['quality'] = vectors['default'] -- metatable ? +-- Compression is new and used for a math experiment. Musical timestamp(s): November +-- 2022, a cluster of live performances: RPWL (5), PT (7, yes!) and xPropaganda (10). + local function initialize(tfmdata,value) if value then local class, vector = get_class_and_vector(tfmdata,value,"expansions") @@ -159,9 +162,23 @@ local function initialize(tfmdata,value) end end end - if v and v ~= 0 then - chr.expansion = v*factor - else -- can be option + -- So, factor influences all shapes but we now obey zero when set! + if v then + if type(v) == "table" then + local e = v[1] + local c = v[2] or 0 + if e ~= 0 then + chr.expansion = e*factor + end + if c ~= 0 then + chr.compression = c*factor + end + elseif v == 0 then + -- chr.expansion = 0 + else + chr.expansion = v*factor + end + elseif factor ~= 1 then -- test is new chr.expansion = factor end end @@ -194,6 +211,82 @@ implement { actions = function(class,settings) getparameters(classes,class,'preset',settings) end } +-- special version for math 7/11/22 + +classes.math = { + stretch = 2, + shrink = 2, + step = .5, + vector = 'math', + factor = 1, +} + +vectors.math = { + [0x002B] = { 4, 0 }, -- + + [0x2212] = { 4, 0 }, -- - + [0x003C] = { 8, 0 }, -- < + [0x003D] = { 8, 0 }, -- = + [0x003E] = { 8, 0 }, -- > + [0x002F] = { 2, 0 }, -- / + [0x0028] = { 2, 0 }, -- ( + [0x0029] = { 2, 0 }, -- ) + [0x005B] = { 2, 0 }, -- [ + [0x005D] = { 2, 0 }, -- ] +} + +local function initialize(tfmdata,value) + if value then + local class, vector = get_class_and_vector(tfmdata,value,"expansions") + if class then + if vector then + local stretch = class.stretch or 0 + local shrink = class.shrink or 0 + local step = class.step or 0 + local factor = class.factor or 1 + if trace_expansion then + report_expansions("setting class %a, vector %a, factor %a, stretch %a, shrink %a, step %a", + value,class.vector,factor,stretch,shrink,step) + end + tfmdata.parameters.expansion = { + stretch = 10 * stretch, + shrink = 10 * shrink, + step = 10 * step, + factor = factor, + } + local characters = tfmdata.characters + for u, v in next, vector do + local chr = characters[u] + if type(v) == "table" then + local e = v[1] + local c = v[2] or 0 + if e ~= 0 then + chr.expansion = e*factor + end + if c ~= 0 then + chr.compression = c*factor + end + elseif v ~= 0 then + chr.expansion = v*factor + end + end + elseif trace_expansion then + report_expansions("unknown vector %a in class %a",class.vector,value) + end + elseif trace_expansion then + report_expansions("unknown class %a",value) + end + end +end + +registerotffeature { + name = "mathexpansion", + description = "apply hz optimization to math", + initializers = { + base = initialize, + node = initialize, + } +} + -- -- -- -- -- -- -- protrusion -- -- -- -- -- -- diff --git a/tex/context/base/mkxl/font-ini.mklx b/tex/context/base/mkxl/font-ini.mklx index 1fab52386..5e521e263 100644 --- a/tex/context/base/mkxl/font-ini.mklx +++ b/tex/context/base/mkxl/font-ini.mklx @@ -419,11 +419,11 @@ \fi} \def\normalizebodyfontsize_indeed#macro#body% - {\edef#macro{\clf_nbfs\dimexpr#body\relax}% + {\edef#macro{\clf_normalizedbodyfontsize\dimexpr#body\relax}% \gletcsname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro} \permanent\def\thenormalizedbodyfontsize#body% - {\clf_nbfs\dimexpr#body\relax} + {\clf_normalizedbodyfontsize\dimexpr#body\relax} \mutable\edef\normalizedglobalbodyfontsize{\thenormalizedbodyfontsize\bodyfontsize} \mutable\edef\normalizedlocalbodyfontsize {\thenormalizedbodyfontsize\bodyfontsize} @@ -458,12 +458,60 @@ \installcorenamespace{mappedfontsize} -\permanent\tolerant\protected\def\mapfontsize[#from]#spacer[#to]% - {\ifarguments\or\or\defcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname{#to}\fi} +% \permanent\tolerant\protected\def\mapfontsize[#from]#spacer[#to]% +% {\ifarguments\or\or\defcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname{#to}\fi} +% +% \def\font_basics_set_mapped_fontsize#from% +% {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname +% \lastnamedcs\else#from% +% \fi} + +% will become: mapmathfontsize + +%letcsname\??mappedfontsize\s!text \endcsname\!!plusone +\letcsname\??mappedfontsize\s!script \endcsname\!!plustwo +\letcsname\??mappedfontsize\s!scriptscript\endcsname\!!plusthree + +\permanent\tolerant\protected\def\mapfontsize[#class]#spacer[#from]#spacer[#to]% + {\ifarguments + % ignore + \or + % reset + \letcsname\??mappedfontsize#class:1\endcsname\undefined + \letcsname\??mappedfontsize#class:2\endcsname\undefined + \letcsname\??mappedfontsize#class:3\endcsname\undefined + \or + % unsupported + \or + % set + \defcsname + \??mappedfontsize + #class:% + \begincsname\??mappedfontsize#from\endcsname + \endcsname{#to}% + \fi} + +\permanent\tolerant\protected\def\checkedmapfontsize[#class]#spacer[#from]#spacer[#to]% + {\ifcsname\??mappedfontsize#class:\begincsname\??mappedfontsize#from\endcsname\endcsname + % keep (user) value + \else + \mapfontsize[#class][#from][#to]% + \fi} + +\permanent\tolerant\def\mappedfontsize#class#from% + {\begincsname + \??mappedfontsize + #class:% + \begincsname\??mappedfontsize#from\endcsname + \endcsname} \def\font_basics_set_mapped_fontsize#from% - {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname - \lastnamedcs\else#from% + {\ifcsname\??mappedfontsize\fontclass:\fontface\endcsname + %\the\dimexpr\lastnamedcs\dimexpr#from\relax\relax + %\the\dimexpr\lastnamedcs\dimexpr\bodyfontsize\relax\relax + \the\dimexpr\lastnamedcs\dimexpr\normalizedbodyfontsize\relax\relax + \else % we could use default + #from% \fi} \installcorenamespace{fontbodyknown} @@ -747,7 +795,7 @@ \d_font_scaled_font_size\v_font_size_absolute\relax \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size % uses \somefontsize set by lua \or - % mo + % mo % mapped font size will go away \d_font_scaled_font_size\font_basics_set_mapped_fontsize\v_font_size_absolute \d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size \or @@ -1328,13 +1376,14 @@ \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi} -% \permanent\def\bodyfontsizevariable#size#parameter% -% {\begincsname\??fontenvironments -% \ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\fontclass#size#parameter\orelse -% \ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse -% \ifcsname\??fontenvironments #size#parameter\endcsname #size#parameter\orelse -% \ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi -% \endcsname} +\permanent\def\bodyfontsizevariable#size#parameter% used in s-fonts-show + {\begincsname\??fontenvironments + \ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\fontclass#size#parameter\orelse + \ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse + \ifcsname\??fontenvironments\v!all #size#parameter\endcsname\v!all #size#parameter\orelse + \ifcsname\??fontenvironments #size#parameter\endcsname #size#parameter\orelse + \ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi + \endcsname} \def\font_bodyfontvariable#parameter% {\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse @@ -1669,6 +1718,8 @@ %D Here the rest concerns rl or lr so in this case it is not a size specifier but %D a directional one. +%D no need for the: one two rest + \protected\def\font_basics_define_body_font_nop_mm[#one#two#rest=#value]% local {%\ifcsname\s!mm\endcsname\else\font_basics_check_fontname_combination\s!mm{#one#two}{#rest}\fi \letcsname\??fontinstanceclass\m_font_asked_body-\s!mm-#one#two#rest-1\endcsname\undefined @@ -2366,6 +2417,8 @@ %D math families and finally we activate the default typeface and also set the font %D specific parameters assigned to \type {\everybodyfont}. +% todo: per class + \permanent\protected\def\textface {\currentbodyfontdimension\s!text } \permanent\protected\def\scriptface {\currentbodyfontdimension\s!script } \permanent\protected\def\scriptscriptface{\currentbodyfontdimension\s!scriptscript} diff --git a/tex/context/base/mkxl/font-lib.mklx b/tex/context/base/mkxl/font-lib.mklx index 05367dae8..bb0eec7e6 100644 --- a/tex/context/base/mkxl/font-lib.mklx +++ b/tex/context/base/mkxl/font-lib.mklx @@ -97,8 +97,6 @@ \registerctxluafile{node-fnt}{autosuffix} % here -\registerctxluafile{font-mps}{autosuffix} % outline fun - \registerctxluafile{font-lua}{} \registerctxluafile{font-enh}{autosuffix} diff --git a/tex/context/base/mkxl/font-mat.mklx b/tex/context/base/mkxl/font-mat.mklx index 868f44198..d9337d1b0 100644 --- a/tex/context/base/mkxl/font-mat.mklx +++ b/tex/context/base/mkxl/font-mat.mklx @@ -124,23 +124,26 @@ \mutable\let\fontfamily\relax % for now public but it is a helper -\newconditional\c_math_last_family_set +%newconditional\c_math_last_family_set +\newcount \c_math_last_family_used \def\font_helpers_set_math_family_indeed_normal#mrtag#family% \fontface etc are also used later on {\let\savedfontbody\fontbody \let\fontfamily#family% - \settrue\c_math_last_family_set +% \settrue\c_math_last_family_set +\c_math_last_family_used\zerocount % the order is important as we depend on known id's when completing fonts - % enabling is needed when we have fallbacks which spoils the families + % enabling is needed when we have fallbacks which spoils the families; per + % mid 2022 this is no longer true as we do fallbacks differently \let\mathsizesuffix\mathscriptscriptsuffix\let\fontface\!!plusthree \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % defines - \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % enables + \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % enables / still needed ? \let\mathsizesuffix\mathscriptsuffix \let\fontface\!!plustwo \font_helpers_set_math_family_a\scriptfont #mrtag\font % defines - \font_helpers_set_math_family_a\scriptfont #mrtag\font % enables + \font_helpers_set_math_family_a\scriptfont #mrtag\font % enables / still needed ? \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone \font_helpers_set_math_family_a\textfont #mrtag\font % defines - \font_helpers_set_math_family_a\textfont #mrtag\font % enables + \font_helpers_set_math_family_a\textfont #mrtag\font % enables / still needed ? \let\mathsizesuffix\empty \let\fontface\!!zerocount \let\fontbody\savedfontbody \setfalse\c_font_auto_size} @@ -160,13 +163,14 @@ \def\font_helpers_set_math_family_indeed_compact#mrtag#family% \fontface etc are also used later on {\let\savedfontbody\fontbody \let\fontfamily#family% - \settrue\c_math_last_family_set +% \settrue\c_math_last_family_set +\c_math_last_family_used\zerocount \font_helpers_set_math_family_set_scales_compact % the order is important as we depend on known id's when completing fonts % enabling is needed when we have fallbacks which spoils the families \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone \font_helpers_set_math_family_a\textfont #mrtag\font % defines - \font_helpers_set_math_family_a\textfont #mrtag\font % enables + \font_helpers_set_math_family_a\textfont #mrtag\font % enables / still needed ? \scriptfont #mrtag\font % reuses \scriptscriptfont#mrtag\font % reuses \let\mathsizesuffix\empty \let\fontface\!!zerocount @@ -185,17 +189,18 @@ \let\defaultfontclass\fontclass % else truefontname falls back on the wrong one \let\savedfontbody\fontbody \let\fontfamily#familytag% - \settrue\c_math_last_family_set +% \settrue\c_math_last_family_set +\c_math_last_family_used\zerocount \font_helpers_set_math_family_set_scales_normal \let\mathsizesuffix\mathscriptscriptsuffix\let\fontface\!!plusthree \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% defines - \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% enables + \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% enables / still needed ? \let\mathsizesuffix\mathscriptsuffix \let\fontface\!!plustwo \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% defines - \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% enables + \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% enables / still needed ? \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% defines - \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables + \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables / still needed ? \let\mathsizesuffix\empty \let\fontface\!!zerocount \let\fontbody\savedfontbody \let\defaultfontclass\savedfontclass @@ -206,10 +211,11 @@ \let\defaultfontclass\fontclass % else truefontname falls back on the wrong one \let\savedfontbody\fontbody \let\fontfamily#familytag% - \settrue\c_math_last_family_set +% \settrue\c_math_last_family_set +\c_math_last_family_used\zerocount \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% defines - \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables +% \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables / still needed ? \scriptfont #mbfam\textfont#mbfam% reuses \scriptscriptfont#mbfam\textfont#mbfam% reuses \let\mathsizesuffix\empty \let\fontface\!!zerocount @@ -474,8 +480,18 @@ \mutable\let\bigmathfontsize\empty +% \permanent\protected\def\synchronizebigmath +% {\ifx\bigmathfontsize\fontsize +% % already in sync +% \else +% \let\bigmathfontsize\fontsize +% \font_helpers_synchronize_math +% \fi} + \permanent\protected\def\synchronizebigmath - {\ifx\bigmathfontsize\fontsize + {\ifconditional\c_font_compact + % no need + \orelse\ifx\bigmathfontsize\fontsize % already in sync \else \let\bigmathfontsize\fontsize @@ -501,14 +517,26 @@ %D This is nasty, as the engine only stores the last set family parameters (per style) which %D in our case can be bold. +% \def\font_helpers_synchronize_math_parameters +% {\textfont \zerocount\textfont \zerocount +% \scriptfont \zerocount\scriptfont \zerocount +% \scriptscriptfont\zerocount\scriptscriptfont\zerocount +% \setfalse\c_math_last_family_set} +% +% \appendtoks +% \ifconditional\c_math_last_family_set +% \font_helpers_synchronize_math_parameters +% \fi +% \to\everybodyfont + \def\font_helpers_synchronize_math_parameters - {\textfont \zerocount\textfont \zerocount + {\c_math_last_family_used\mathstylefontid\textstyle\zerocount + \textfont \zerocount\textfont \zerocount \scriptfont \zerocount\scriptfont \zerocount - \scriptscriptfont\zerocount\scriptscriptfont\zerocount - \setfalse\c_math_last_family_set} + \scriptscriptfont\zerocount\scriptscriptfont\zerocount} \appendtoks - \ifconditional\c_math_last_family_set + \ifnum\c_math_last_family_used=\mathstylefontid\textstyle\zerocount\else \font_helpers_synchronize_math_parameters \fi \to\everybodyfont diff --git a/tex/context/base/mkxl/font-mps.lmt b/tex/context/base/mkxl/font-mps.lmt deleted file mode 100644 index 7afc48d0f..000000000 --- a/tex/context/base/mkxl/font-mps.lmt +++ /dev/null @@ -1,407 +0,0 @@ -if not modules then modules = { } end modules ['font-mps'] = { - version = 1.001, - comment = "companion to font-ini.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local tostring = tostring -local concat = table.concat -local formatters = string.formatters - --- QP0 [QP1] QP2 => CP0 [CP1 CP2] CP3 - --- CP0 = QP0 --- CP3 = QP2 --- --- CP1 = QP0 + 2/3 *(QP1-QP0) --- CP2 = QP2 + 2/3 *(QP1-QP2) - -fonts = fonts or { } -local metapost = fonts.metapost or { } -fonts.metapost = metapost - -local f_moveto = formatters["(%N,%N)"] -local f_lineto = formatters["--(%N,%N)"] -local f_curveto = formatters["..controls(%N,%N)and(%N,%N)..(%N,%N)"] -local s_cycle = "--cycle" - -local f_nofill = formatters["nofill %s;"] -local f_dofill = formatters["fill %s;"] - -local f_draw_trace = formatters["drawpathonly %s;"] -local f_draw = formatters["draw %s;"] - -local f_boundingbox = formatters["((%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle)"] -local f_vertical = formatters["((%N,%N)--(%N,%N))"] - -function metapost.boundingbox(d,factor) - local bounds = d.boundingbox - local factor = factor or 1 - local llx = factor*bounds[1] - local lly = factor*bounds[2] - local urx = factor*bounds[3] - local ury = factor*bounds[4] - return f_boundingbox(llx,lly,urx,lly,urx,ury,llx,ury) -end - -function metapost.baseline(d,factor) - local bounds = d.boundingbox - local factor = factor or 1 - local llx = factor*bounds[1] - local urx = factor*bounds[3] - return f_vertical(llx,0,urx,0) -end - -function metapost.widthline(d,factor) - local bounds = d.boundingbox - local factor = factor or 1 - local lly = factor*bounds[2] - local ury = factor*bounds[4] - local width = factor*d.width - return f_vertical(width,lly,width,ury) -end - -function metapost.zeroline(d,factor) - local bounds = d.boundingbox - local factor = factor or 1 - local lly = factor*bounds[2] - local ury = factor*bounds[4] - return f_vertical(0,lly,0,ury) -end - -function metapost.paths(d,xfactor,yfactor) - local sequence = d.sequence - local segments = d.segments - local list = { } - local path = { } -- recycled - local size = 0 - local xfactor = xfactor or 1 - local yfactor = yfactor or xfactor - if sequence then - local i = 1 - local n = #sequence - while i < n do - local operator = sequence[i] - if operator == "m" then -- "moveto" - if size > 0 then - size = size + 1 - path[size] = s_cycle - list[#list+1] = concat(path,"",1,size) - size = 1 - else - size = size + 1 - end - path[size] = f_moveto(xfactor*sequence[i+1],yfactor*sequence[i+2]) - i = i + 3 - elseif operator == "l" then -- "lineto" - size = size + 1 - path[size] = f_lineto(xfactor*sequence[i+1],yfactor*sequence[i+2]) - i = i + 3 - elseif operator == "c" then -- "curveto" - size = size + 1 - path[size] = f_curveto(xfactor*sequence[i+1],yfactor*sequence[i+2],xfactor*sequence[i+3],yfactor*sequence[i+4],xfactor*sequence[i+5],yfactor*sequence[i+6]) - i = i + 7 - elseif operator =="q" then -- "quadraticto" - size = size + 1 - -- first is always a moveto - local l_x = xfactor*sequence[i-2] - local l_y = yfactor*sequence[i-1] - local m_x = xfactor*sequence[i+1] - local m_y = yfactor*sequence[i+2] - local r_x = xfactor*sequence[i+3] - local r_y = yfactor*sequence[i+4] - path[size] = f_curveto ( - l_x + 2/3 * (m_x-l_x), - l_y + 2/3 * (m_y-l_y), - r_x + 2/3 * (m_x-r_x), - r_y + 2/3 * (m_y-r_y), - r_x, r_y - ) - i = i + 5 - else - -- weird - i = i + 1 - end - end - elseif segments then --- inspect(segments) - for i=1,#segments do - local segment = segments[i] - local operator = segment[#segment] - if operator == "m" then -- "moveto" - if size > 0 then - size = size + 1 - path[size] = s_cycle - list[#list+1] = concat(path,"",1,size) - size = 1 - else - size = size + 1 - end - path[size] = f_moveto(xfactor*segment[1],yfactor*segment[2]) - elseif operator == "l" then -- "lineto" - size = size + 1 - path[size] = f_lineto(xfactor*segment[1],yfactor*segment[2]) - elseif operator == "c" then -- "curveto" - size = size + 1 - path[size] = f_curveto(xfactor*segment[1],yfactor*segment[2],xfactor*segment[3],yfactor*segment[4],xfactor*segment[5],yfactor*segment[6]) - elseif operator == "q" then -- "quadraticto" - size = size + 1 - -- first is always a moveto - local prev = segments[i-1] - local l_x = xfactor*prev[#prev-2] - local l_y = yfactor*prev[#prev-1] - local m_x = xfactor*segment[1] - local m_y = yfactor*segment[2] - local r_x = xfactor*segment[3] - local r_y = yfactor*segment[4] - path[size] = f_curveto ( - l_x + 2/3 * (m_x-l_x), - l_y + 2/3 * (m_y-l_y), - r_x + 2/3 * (m_x-r_x), - r_y + 2/3 * (m_y-r_y), - r_x, r_y - ) - else - -- weird - end - end - else - return - end - if size > 0 then - size = size + 1 - path[size] = s_cycle - list[#list+1] = concat(path,"",1,size) - end - return list -end - -function metapost.fill(paths) - local r = { } - local n = #paths - for i=1,n do - if i < n then - r[i] = f_nofill(paths[i]) - else - r[i] = f_dofill(paths[i]) - end - end - return concat(r) -end - -function metapost.draw(paths,trace) - local r = { } - local n = #paths - for i=1,n do - if trace then - r[i] = f_draw_trace(paths[i]) - else - r[i] = f_draw(paths[i]) - end - end - return concat(r) -end - -function metapost.maxbounds(data,index,factor) - local maxbounds = data.maxbounds - local factor = factor or 1 - local glyphs = data.glyphs - local glyph = glyphs[index] - local boundingbox = glyph.boundingbox - local xmin, ymin, xmax, ymax - if not maxbounds then - xmin = 0 - ymin = 0 - xmax = 0 - ymax = 0 - for i=1,#glyphs do - local d = glyphs[i] - if d then - local b = d.boundingbox - if b then - if b[1] < xmin then xmin = b[1] end - if b[2] < ymin then ymin = b[2] end - if b[3] > xmax then xmax = b[3] end - if b[4] > ymax then ymax = b[4] end - end - end - end - maxbounds = { xmin, ymin, xmax, ymax } - data.maxbounds = maxbounds - else - xmin = maxbounds[1] - ymin = maxbounds[2] - xmax = maxbounds[3] - ymax = maxbounds[4] - end - local llx = boundingbox[1] - local lly = boundingbox[2] - local urx = boundingbox[3] - local ury = boundingbox[4] - local width = glyph.width - if llx > 0 then - llx = 0 - end - if width > urx then - urx = width - end - return f_boundingbox( - factor*llx,factor*ymin, - factor*urx,factor*ymin, - factor*urx,factor*ymax, - factor*llx,factor*ymax - ) -end - --- This is a nice example of tex, metapost and lua working in tandem. Each kicks in at the --- right time. It's probably why I like watching https://www.youtube.com/watch?v=c5FqpddnJmc --- so much: precisely (and perfectly) timed too. - -local texgetbox = tex.getbox - -local nodecodes = nodes.nodecodes -- no nuts yet -local rulecodes = nodes.rulecodes - -local rule_code = nodecodes.rule - -local normalrule_code = rulecodes.normal -local outlinerule_code = rulecodes.outline -local userrule_code = rulecodes.user -local emptyrule_code = rulecodes.empty - -local nuts = nodes.nuts -local getwhd = nuts.getwhd -local getexpansion = nuts.getexpansion -local isglyph = nuts.isglyph - -local characters = fonts.hashes.characters -local parameters = fonts.hashes.parameters -local shapes = fonts.hashes.shapes -local topaths = metapost.paths - -local f_text = formatters["mfun_do_outline_text_flush(%q,%i,%N,%N,%q)(%,t);"] -local f_rule = formatters["mfun_do_outline_rule_flush(%q,%N,%N,%N,%N);"] -local f_bounds = formatters["checkbounds(%N,%N,%N,%N);"] -local s_nothing = "(origin scaled 10)" - -local sc = 10 -local fc = number.dimenfactors.bp - -local function glyph(kind,font,char,advance,shift,ex) - local character = characters[font][char] - if character then - local index = character.index - if index then - local shapedata = shapes[font] - local glyphs = shapedata.glyphs -- todo: subfonts fonts.shapes.indexed(font,sub) - if glyphs then - local glyf = glyphs[index] - if glyf then - local units = 1000 -- factor already takes shapedata.units into account - local yfactor = (sc/units) * parameters[font].factor / 655.36 - local xfactor = yfactor - local shift = shift or 0 - local advance = advance or 0 - local exfactor = ex or 0 - local wfactor = 1 - local detail = kind == "p" and tostring(char) or "" - if exfactor ~= 0 then - wfactor = (1+(ex/units)/1000) - xfactor = xfactor * wfactor - end - local paths = topaths(glyf,xfactor,yfactor) - if paths then - return f_text(kind,#paths,advance,shift,detail,paths) -- , character.width * fc * wfactor - end - end - end - end - end -end - -metapost.glyph = glyph - -local kind = "" -local buffer = { } -local b = 0 - -local function reset() - buffer = { } - b = 0 -end - -local function flushcharacter(current, pos_h, pos_v, pod_r, font, char) - local char, font = isglyph(current) - local code = glyph(kind,font,char,pos_h*fc,pos_v*fc,getexpansion(current)) - if code then - b = b + 1 - buffer[b] = code - end -end - -local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v, subtype) - if subtype == normalrule_code then - b = b + 1 - buffer[b] = f_rule(kind,pos_h*fc,pos_v*fc,size_h*fc,size_v*fc) - elseif subtype == outlinerule_code then - b = b + 1 - buffer[b] = f_rule("d",pos_h*fc,pos_v*fc,size_h*fc,size_v*fc) - elseif subtype == userrule_code then - -- print("USER RULE") - -- b = b + 1 - -- buffer[b] = f_rule("d",size_h*fc,size_v*fc,pos_h*fc,pos_v*fc) - elseif subtype == emptyrule_code then - -- ignore - else - -- b = b + 1 - -- buffer[b] = f_rule("f",pos_h*fc,pos_v*fc,size_h*fc,size_v*fc) - end -end - -local function flushsimplerule(pos_h, pos_v, pos_r, size_h, size_v) - flushrule(false,pos_h,pos_v,pos_r,size_h,size_v,normalrule_code) -end - -local function flushspecialrule(pos_h, pos_v, pos_r, w, h, d, l, outline) - flushrule(false,pos_h,pos_v-d,pos_r,w,h+d,outline and outlinerule_code or normalrule_code) -end - --- installer - -drivers.install { - name = "mpo", - actions = { - initialize = function() - reset() - end, - finalize = function(driver,details) - local bb = details.boundingbox - local llx = bb[1] * fc - local lly = bb[2] * fc - local urx = bb[3] * fc - local ury = bb[4] * fc - b = b + 1 - buffer[b] = f_bounds(llx,lly,urx,ury) - -- inspect(buffer) - end, - }, - flushers = { - updatefontstate = updatefontstate, - character = flushcharacter, - rule = flushrule, - simplerule = flushsimplerule, - specialrule = flushspecialrule, - } -} - -function metapost.boxtomp(n,k) - kind = k - nodes.handlers.finalizebox(n) - drivers.converters.lmtx(drivers.instances.mpo,texgetbox(n),"box",1) - local result = concat(buffer,";") - reset() - return result -end - diff --git a/tex/context/base/mkxl/font-otl.lmt b/tex/context/base/mkxl/font-otl.lmt index b7889fc05..2d0d58a97 100644 --- a/tex/context/base/mkxl/font-otl.lmt +++ b/tex/context/base/mkxl/font-otl.lmt @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.121 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.130 -- beware: also sync font-mis.lua and in mtx-fonts otf.cache = containers.define("fonts", "otl", otf.version, true) otf.svgcache = containers.define("fonts", "svg", otf.version, true) otf.pngcache = containers.define("fonts", "png", otf.version, true) @@ -384,46 +384,33 @@ local function copytotfm(data,cache_id) local m = d.math if m then -- - local italic = m.italic - local vitalic = m.vitalic - -- - local variants = m.hvariants - local parts = m.hparts - if variants then - local c = character - for i=1,#variants do - -- local un = variants[i].glyph - local un = variants[i] - c.next = un - c = characters[un] - end -- c is now last in chain - c.hparts = parts - elseif parts then - character.hparts = parts - italic = m.hitalic + local italic = m.italic + if italic and italic ~= 0 then + character.italic = italic end -- - local variants = m.vvariants - local parts = m.vparts + local variants = m.variants + local parts = m.parts + local partsitalic = m.partsitalic + local partsorientation = m.partsorientation if variants then local c = character for i=1,#variants do - -- local un = variants[i].glyph local un = variants[i] c.next = un c = characters[un] end -- c is now last in chain - c.vparts = parts + c.parts = parts + c.partsorientation = partsorientation + if partsitalic and partsitalic ~= 0 then + c.partsitalic = partsitalic + end elseif parts then - character.vparts = parts - end - -- - if italic and italic ~= 0 then - character.italic = italic - end - -- - if vitalic and vitalic ~= 0 then - character.vitalic = vitalic + character.parts = parts + character.partsorientation = partsorientation + if partsitalic and partsitalic ~= 0 then + character.partsitalic = partsitalic + end end -- local topanchor = m.topanchor or m.accent -- for now @@ -678,25 +665,26 @@ local function read_from_otf(specification) return tfmdata end -local function checkmathsize(tfmdata,mathsize) - local mathdata = tfmdata.shared.rawdata.metadata.math - local mathsize = tonumber(mathsize) - if mathdata then -- we cannot use mathparameters as luatex will complain - local parameters = tfmdata.parameters - parameters.scriptpercentage = mathdata.ScriptPercentScaleDown - parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown - parameters.mathsize = mathsize -- only when a number ! - end -end - -registerotffeature { - name = "mathsize", - description = "apply mathsize specified in the font", - initializers = { - base = checkmathsize, - node = checkmathsize, - } -} +-- local function checkmathsize(tfmdata,mathsize) +-- local mathdata = tfmdata.shared.rawdata.metadata.math +-- local mathsize = tonumber(mathsize) +-- if mathdata then -- we cannot use mathparameters as luatex will complain +-- local parameters = tfmdata.parameters +-- parameters.scriptpercentage = mathdata.ScriptPercentScaleDown +-- parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown +-- parameters.mathsize = mathsize -- only when a number ! +-- -- print(mathdata.ScriptPercentScaleDown,mathdata.ScriptScriptPercentScaleDown) +-- end +-- end +-- +-- registerotffeature { +-- name = "mathsize", +-- description = "apply mathsize specified in the font", +-- initializers = { +-- base = checkmathsize, +-- node = checkmathsize, +-- } +-- } -- readers diff --git a/tex/context/base/mkxl/font-pre.mkxl b/tex/context/base/mkxl/font-pre.mkxl index 4a7442d10..2918a7e8c 100644 --- a/tex/context/base/mkxl/font-pre.mkxl +++ b/tex/context/base/mkxl/font-pre.mkxl @@ -412,6 +412,7 @@ [mode=base, % mode=none, % better, maybe do this last kern=yes, +% kern=force, % flac=yes, % handled differently % liga=yes, % makes no sense % mode=node, @@ -424,6 +425,7 @@ compactmath=yes, flattenaccents=yes, % mathgaps=yes, + mathexpansion=math, language=dflt, script=math] @@ -439,32 +441,32 @@ % \definefontfeature[mathextra][collapseitalics] -\definefontfeature - [mathematics-l2r] - [mathematics] - [] +% \definefontfeature % obsolete +% [mathematics-l2r] +% [mathematics] +% [] -\definefontfeature - [mathematics-r2l] - [mathematics] - [rtlm=yes, - locl=yes] +% \definefontfeature % obsolete +% [mathematics-r2l] +% [mathematics] +% [rtlm=yes, +% locl=yes] -\definefontfeature[virtualmath] [mathematics] -\definefontfeature[virtualmath-l2r] [mathematics-l2r] -\definefontfeature[virtualmath-r2l] [mathematics-r2l] +\definefontfeature[virtualmath] [mathematics] +% \definefontfeature[virtualmath-l2r] [mathematics-l2r] % obsolete +% \definefontfeature[virtualmath-r2l] [mathematics-r2l] % obsolete -\definefontfeature[math-text] [mathematics] [ssty=no] -\definefontfeature[math-script] [mathematics] [ssty=1,mathsize=yes] -\definefontfeature[math-scriptscript] [mathematics] [ssty=2,mathsize=yes] +\definefontfeature[math-text] [mathematics] % [ssty=no] +\definefontfeature[math-script] [mathematics] [ssty=1,mathsize=yes] +\definefontfeature[math-scriptscript] [mathematics] [ssty=2,mathsize=yes] -\definefontfeature[math-text-l2r] [mathematics-l2r] [ssty=no] -\definefontfeature[math-script-l2r] [mathematics-l2r] [ssty=1,mathsize=yes] -\definefontfeature[math-scriptscript-l2r] [mathematics-l2r] [ssty=2,mathsize=yes] +% \definefontfeature[math-text-l2r] [mathematics-l2r] [ssty=no] % obsolete +% \definefontfeature[math-script-l2r] [mathematics-l2r] [ssty=1,mathsize=yes] % obsolete +% \definefontfeature[math-scriptscript-l2r] [mathematics-l2r] [ssty=2,mathsize=yes] % obsolete -\definefontfeature[math-text-r2l] [mathematics-r2l] [ssty=no] -\definefontfeature[math-script-r2l] [mathematics-r2l] [ssty=1,mathsize=yes] -\definefontfeature[math-scriptscript-r2l] [mathematics-r2l] [ssty=2,mathsize=yes] +% \definefontfeature[math-text-r2l] [mathematics-r2l] [ssty=no] % obsolete +% \definefontfeature[math-script-r2l] [mathematics-r2l] [ssty=1,mathsize=yes] % obsolete +% \definefontfeature[math-scriptscript-r2l] [mathematics-r2l] [ssty=2,mathsize=yes] % obsolete % this will go away: could be a mode in the engine % diff --git a/tex/context/base/mkxl/font-set.mklx b/tex/context/base/mkxl/font-set.mklx index 98e2e96e1..631c4af05 100644 --- a/tex/context/base/mkxl/font-set.mklx +++ b/tex/context/base/mkxl/font-set.mklx @@ -43,10 +43,14 @@ % \clf_resetnullfont % in luatex 0.70 this will also do the previous % \glet\font_preloads_reset_nullfont\relax} +% \def\font_preload_check_mode +% {\doifelsemode{lmmath} +% {\def\m_font_fallback_name{modern-designsize-virtual}}% this will stay +% {\def\m_font_fallback_name{modern-designsize}}% % this might become 'modern' +% \glet\font_preload_check_mode\relax} + \def\font_preload_check_mode - {\doifelsemode{lmmath} - {\def\m_font_fallback_name{modern-designsize-virtual}}% this will stay - {\def\m_font_fallback_name{modern-designsize}}% % this might become 'modern' + {\def\m_font_fallback_name{modern}% \glet\font_preload_check_mode\relax} \def\font_preload_default_fonts diff --git a/tex/context/base/mkxl/lang-def.mkxl b/tex/context/base/mkxl/lang-def.mkxl index 2be05104f..cd5fd4ba3 100644 --- a/tex/context/base/mkxl/lang-def.mkxl +++ b/tex/context/base/mkxl/lang-def.mkxl @@ -284,6 +284,23 @@ \c!leftquotation=\rightguillemot, \c!rightquotation=\leftguillemot, \c!date={\v!day,{.},\space,\v!month,\space,\v!year}] + +\installlanguage + [\s!hy] + [\c!spacing=\v!packed, + \c!leftsentence=\endash, % *sentences not confirmed + \c!rightsentence=\endash, + \c!leftsubsentence=\endash, + \c!rightsubsentence=\endash, + \c!leftquote=\guilsingleleft, + \c!rightquote=\guilsingleright, + \c!leftquotation=\leftguillemot + \c!rightquotation=\rightguillemot + \c!date={\v!day,\space,\v!month,\space,\v!year}, % word + % \c!date={\v!day,{.},\v!month,{.},\v!year}, % numbers + \s!patterns=\s!hy, + \s!lefthyphenmin=2, + \s!righthyphenmin=2] \installlanguage [\s!polish] [\s!pl] \installlanguage [\s!czech] [\s!cs] @@ -292,6 +309,10 @@ \installlanguage [\s!slovenian] [\s!sl] \installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?) \installlanguage [\s!albanian] [\s!sq] +\installlanguage [\s!armenian] [\s!hy] + +\installlanguage [\s!hye] [\s!hy] % Eastern Armenian +\installlanguage [\s!hyw] [\s!hy] % Western Armenian % Cyrillic Languages diff --git a/tex/context/base/mkxl/lang-rep.lmt b/tex/context/base/mkxl/lang-rep.lmt index 6139a03f7..fcaff523a 100644 --- a/tex/context/base/mkxl/lang-rep.lmt +++ b/tex/context/base/mkxl/lang-rep.lmt @@ -181,7 +181,7 @@ local function tonodes(list,template) return head end -local is_punctuation = characters.is_punctuation +local ispunctuation = characters.is_punctuation -- We can try to be clever and use the fact that there is no match to skip -- over to the next word but it is gives fuzzy code so for now I removed @@ -326,7 +326,7 @@ function replacements.handler(head) tree = trees[a] if tree then local char = getchar(current) - local punc = is_punctuation[char] + local punc = ispunctuation[char] if mode == "punc" then if not punc then if root then diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt index d937e3dea..57f5b6037 100644 --- a/tex/context/base/mkxl/lpdf-lmt.lmt +++ b/tex/context/base/mkxl/lpdf-lmt.lmt @@ -238,7 +238,7 @@ lpdf.usedindices = usedindices -- [streamhash][index] -> realindex (can local horizontalmode = true local scalefactor = 1 local threshold = 655360 -local thresfactor = 100 +----- thresfactor = 100 local tjfactor = 100 / 65536 function flushers.updatefontstate(font) @@ -690,7 +690,7 @@ do local trace_threshold = false trackers.register("backends.pdf.threshold", function(v) trace_threshold = v end) - -- local f_skip = formatters["%.2N"] + ----- f_skip = formatters["%.2N"] -- I will redo this mess ... we no longer have the mkiv pdf generator that we used in -- luatex (a precursor to lmtx and also for comparison) but only in lmtx now so ... @@ -776,7 +776,7 @@ do move = calc_pdfpos(pos_h,pos_v) end if move then - local d = tj_delta * scalefactor / f_x_scale + local d = tj_delta * scalefactor / (tmef * f_x_scale) if d <= -0.5 or d >= 0.5 then if mode == "char" then end_charmode() @@ -1504,8 +1504,19 @@ local flushimage do local dim_h = size_h * bpfactor local dim_v = size_v * bpfactor local rule - - if dim_v <= one_bp then + -- + -- this fails for showglyphs so and i have no reason to look into it now and rectangles + -- do a better job anyway + -- + if subtype == outlinerule_code then + local linewidth = getdata(current) + pdf_set_pos_temp(pos_h,pos_v) + if linewidth > 0 then + rule = f_w(linewidth * bpfactor,dim_h,dim_v) + else + rule = f_o(dim_h,dim_v) + end + elseif dim_v <= one_bp then pdf_set_pos_temp(pos_h,pos_v + 0.5 * size_v) rule = f_v(dim_v,dim_h) elseif dim_h <= one_bp then @@ -1513,16 +1524,7 @@ local flushimage do rule = f_h(dim_h,dim_v) else pdf_set_pos_temp(pos_h,pos_v) - if subtype == outlinerule_code then - local linewidth = getdata(current) - if linewidth > 0 then - rule = f_w(linewidth * bpfactor,dim_h,dim_v) - else - rule = f_o(dim_h,dim_v) - end - else - rule = f_f(dim_h,dim_v) - end + rule = f_f(dim_h,dim_v) end b = b + 1 ; buffer[b] = rule diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index 713635583..c18dcda29 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -10,7 +10,7 @@ if not modules then modules = { } end modules ['math-act'] = { -- have been removed (no longer viable) but can be found in the .lua variant. local type, next, tonumber = type, next, tonumber -local fastcopy, copytable, insert, remove = table.fastcopy, table.copy, table.insert, table.remove +local fastcopy, copytable, insert, remove, concat = table.fastcopy, table.copy, table.insert, table.remove, table.concat local formatters = string.formatters local byte = string.byte local setmetatableindex, sortedkeys, sortedhash = table.setmetatableindex, table.sortedkeys, table.sortedhash @@ -24,6 +24,7 @@ local report_math = logs.reporter("mathematics","initializing") local report_mathtweak = logs.reporter("mathematics","tweak") local getfontoffamily = tex.getfontoffamily +local texget = tex.get local fontcharacters = fonts.hashes.characters local chardata = characters.data local extensibles = mathematics.extensibles @@ -245,8 +246,22 @@ end -- a couple of predefined tweaks: -local mathtweaks = { } -mathematics.tweaks = mathtweaks +local datasets = { } +local mathtweaks = { datasets = datasets } +mathematics.tweaks = mathtweaks + +-- can be a common helper: + +local f_u = formatters["%U"] + +local function unicodecharlist(t) + local r = { } + local n = 0 + for u in sortedhash(t) do + n = n + 1 ; r[n] = f_u(u) + end + return concat(r," ") +end local function report_tweak(fmt,target,original,...) if fmt then @@ -269,6 +284,16 @@ local function report_tweak(fmt,target,original,...) end end +local function feedback_tweak(tweak,target,original,done) + if not done or (type(done) == "table" and not next(done)) then +if trace_tweaking then -- for now + report_tweak("no need for %a",target,original,tweak) +end + elseif trace_tweaking then + report_tweak("tweak %a applied to: %s",target,original,tweak,unicodecharlist(done)) + end +end + mathtweaks.subsets = { acenorsuvxz = { 0x1D44E, 0x1D450, 0x1D452, 0x1D45B, 0x1D45C, 0x1D45F, 0x1D460, 0x1D462, 0x1D463, 0x1D465, 0x1D467 }, bhklt = { 0x1D44F, 0x1D455, 0x1D458, 0x1D459, 0x1D461 }, @@ -341,7 +366,7 @@ local detail do c = characters[nxt] nxt = c.next end - c = c.hparts or c.vparts + c = c.parts if c then local index = t[3] if index == "*" then @@ -414,6 +439,12 @@ do t = type(v) end if t == "table" and next(v) then + + local axis = tonumber(v.axis) + if axis then + axis = target.mathparameters.AxisHeight * axis + end + local factor = v.factor if factor then local m = v @@ -490,6 +521,13 @@ do if yoffsetfactor then character.yoffset = yoffsetfactor * total end + + if axis then + character.height = (character.height or 0) - axis + character.depth = (character.depth or 0) + axis + character.yoffset = (character.yoffset or 0) + axis + end + if italicfactor then if italic then character.italic = italicfactor * italic @@ -533,7 +571,7 @@ do if nxt then adapt(list,target,original,targetcharacters,originalcharacters,nxt,v,compact,n) else - local parts = character.hparts + local parts = character.parts if parts then for i=1,#parts do adapt(list,target,original,targetcharacters,originalcharacters,parts[i],v,compact,n) @@ -621,25 +659,24 @@ do -- local originalcharacters = original.characters local count = 0 -- local also = getalso(target,original) - -- local done = { } + local done = false for k, v in sortedhash(list) do local ori = targetcharacters[k] local nxt = ori.next local cnt = v if nxt then - local hpt, vpt + local prt = nil local lst = { } while nxt do local chr = targetcharacters[nxt] lst[#lst+1] = chr nxt = chr.next if not nxt then - hpt = chr.hparts - vpt = chr.vparts + prt = chr.parts break end end - if hpt or vpt then + if prt then count = count + 1 if cnt ~= "*" then if #lst < cnt then @@ -647,15 +684,18 @@ do end ori = lst[cnt] end - ori.hparts = hpt - ori.vparts = vpt - -- ori.next = nil -- so we keep the chain + ori.parts = prt + end + if not trace_tweaking then + done = true + elseif done then + done[k] = true + else + done = { [k] = true } end end end - if trace_tweaking and count > 0 then - report_tweak("%i variants wiped",target,original,count) - end + feedback_tweak("wipevariants",target,original,done) end end @@ -663,7 +703,7 @@ end do - function mathtweaks.replacements(target,original,parameters) + function mathtweaks.replace(target,original,parameters) local list = parameters.list if list then local targetcharacters = target.characters @@ -687,7 +727,7 @@ do end end - function mathtweaks.substitutes(target,original,parameters) + function mathtweaks.substitute(target,original,parameters) local list = parameters.list if list then local targetcharacters = target.characters @@ -707,9 +747,6 @@ do end end - mathtweaks.replace = mathtweaks.replacements - mathtweaks.substitute = mathtweaks.substitutes - end do @@ -721,7 +758,7 @@ do if list then local targetcharacters = target.characters local originalcharacters = original.characters - local count = 0 + local done = false local function add(v,n) local chardata = targetcharacters[mathgaps[n] or n] @@ -735,7 +772,13 @@ do local t = mathgaps[nn] or nn if t then kerns[t] = vv * width - count = count + 1 + if not trace_tweaking then + done = true + elseif done then + done[t] = true + else + done = { [t] = true } + end end end) end @@ -768,9 +811,7 @@ do -- end -- end - if trace_tweaking and count > 0 then - report_tweak("%i kern pairs",target,original,count) - end + feedback_tweak("kernpairs",target,original,done) end end @@ -1038,65 +1079,67 @@ do end -do - - function mathtweaks.fixanchors(target,original,parameters) - local targetcharacters= target.characters - local factor = tonumber(parameters.factor) or 0 - if factor ~= 0 then - local count = 0 - for k, v in next, targetcharacters do - local a = v.topanchor - if a and a > 0 then - v.topanchor = a * factor - count = count + 1 - end - end - if trace_tweaking and count > 0 then - report_tweak("%i top anchors fixed",target,original,count) - end - end - end - - mathtweaks.fixaccents = mathtweaks.fixanchors - -end - -do - - -- actually this should be a an engine feature driven by category because we don't - -- want this in display mode .. only a test for MS and HH +-- do +-- +-- function mathtweaks.fixanchors(target,original,parameters) +-- local targetcharacters= target.characters +-- local factor = tonumber(parameters.factor) or 0 +-- if factor ~= 0 then +-- local done = false +-- for k, v in next, targetcharacters do +-- local a = v.topanchor +-- if a and a > 0 then +-- v.topanchor = a * factor +-- count = count + 1 +-- if not trace_tweaking then +-- done = true +-- elseif done then +-- done[u] = true +-- else +-- done = { [u] = true } +-- end +-- end +-- end +-- end +-- feedback_tweak("fixanchors",target,original,done) +-- end +-- +-- end +-- do +-- +-- -- actually this should be a an engine feature driven by category because we don't +-- -- want this in display mode .. only a test for MS and HH +-- -- local issymbol = characters.is_symbol -- -- function mathtweaks.oldstylemath(target,original,parameters) --- local chardata = characters.data +-- local chardata = characters.data -- local characters = target.characters -- local axis = target.mathparameters.AxisHeight -- local delta = (parameters.factor or .1) * axis -- target.mathparameters.AxisHeight = (axis - delta) -- for k, v in sortedhash(characters) do -- if issymbol[k] then -- quick hack, engine knows --- print("old style math",k,chardata[k].description) -- v.yoffset = -delta -- v.height = (v.height or 0) - delta -- v.depth = (v.depth or 0) - delta -- end -- end -- end - - function mathtweaks.oldstylemath(target,original,parameters) - -- not relevant - end - -end +-- +-- function mathtweaks.oldstylemath(target,original,parameters) +-- -- not relevant +-- end +-- +-- end do function mathtweaks.simplifykerns(target,original,parameters) local characters = target.characters - local simplified = 0 - for k, v in sortedhash(characters) do + local done = false + for u, v in sortedhash(characters) do local mathkerns = v.mathkerns if mathkerns then local k = mathkerns.topleft @@ -1128,25 +1171,28 @@ do end end v.mathkerns = nil - simplified = simplified + 1 + if not trace_tweaking then + done = true + elseif done then + done[u] = true + else + done = { [u] = true } + end end end - if simplified == 0 then - report_tweak("no need to simplify mathkerns",target,original) - elseif trace_tweaking then - report_tweak("%i mathkerns simplified",target,original,simplified) - end + feedback_tweak("simplifykerns",target,original,done) end end do - local function wipe(target,original,parameters,field,move,integrals) + local function wipe(whatever,target,original,parameters,field,move,integrals) local targetcharacters = target.characters local targetdescriptions = target.descriptions local factor = target.parameters.factor local correct = parameters.correct + local done = false local function getllx(u) local d = targetdescriptions[u] if d then @@ -1172,7 +1218,7 @@ do goto smaller end else - local done = false + local okay = false local italic = c.italic if move and not c.advance then -- advance check prevents double move local width = c.width or 0 @@ -1187,39 +1233,41 @@ do if topanchor then c.topanchor = topanchor + llx end - c.bottomleft = (c.bottomleft or 0) - llx - c.topleft = (c.topleft or 0) - llx - done = true + -- too bad (schola e^x): + -- c.bottomleft = (c.bottomleft or 0) - llx + -- c.topleft = (c.topleft or 0) - llx + okay = true end end if italic and italic ~= 0 then c.width = width + italic c.bottomright = - italic - done = true + okay = true else c.width = width end end if italic then c.italic = nil - done = true + okay = true end - if not done then - goto smaller - end - end - if trace_tweaking then - if l then - report_tweak("%s %a in range %a from %C","removing",target,original,field,l,s) + if okay then + if not trace_tweaking then + done = true + elseif done then + done[u] = true + else + done = { [u] = true } + end else - report_tweak("%s %a from %C","removing",target,original,field,s) + goto smaller end end goto smaller ::smaller:: s = c.smaller ::variants:: - -- no italics here anyway butr we could check them some day + -- no italics here anyway but we could check them some day else break end @@ -1262,22 +1310,21 @@ do end end end + feedback_tweak(whatever,target,original,done) end function mathtweaks.wipeanchors(target,original,parameters) - wipe(target,original,parameters,"topanchor") + wipe("wipeanchors",target,original,parameters,"topanchor") end - mathtweaks.wipeaccents = mathtweaks.wipeanchors - function mathtweaks.wipeitalics(target,original,parameters) if not checkitalics then - wipe(target,original,parameters,"italic") + wipe("wipeitalics",target,original,parameters,"italic") end end function mathtweaks.moveitalics(target,original,parameters) - wipe(target,original,parameters,"italic",true) + wipe("moveitalics",target,original,parameters,"italic",true) end -- function mathtweaks.fixdigits(target,original,parameters) @@ -1292,7 +1339,8 @@ do local characters = target.characters local list = parameters.list if list then - for k, v in sortedhash(list) do + local done = false + for u, v in sortedhash(list) do local c = characters[k] if c then local w = c.width @@ -1301,15 +1349,20 @@ do if trace_tweaking then -- todo end + if not trace_tweaking then + done = true + elseif done then + done[u] = true + else + done = { [u] = true } + end end end end - -- todo: small + feedback_tweak("topanchors",target,original,done) end end - mathtweaks.topaccents = mathtweaks.topanchors - function mathtweaks.movelimits(target,original,parameters) local characters = target.characters local list = parameters.list @@ -1346,6 +1399,27 @@ do if n then relocate(n,factor) end + -- Kind of tricky: we configure the engine to use the vitalic + -- so when we tweak we need to set that to zero. + local parts = c.parts + local italic = c.partsitalic + if parts and italic then + if italic ~= 0 then + local tchar = characters[parts[#parts].glyph] + local bchar = characters[parts[1].glyph] + local width = tchar.width or 0 + local half = (italic/2) * factor + tchar.topanchor = width + half + bchar.bottomanchor = width - half + bchar.bottomright = - italic + if trace_tweaking then + -- todo + end + tchar.italic = nil + bchar.italic = nil + end + c.vitalic = nil + end if also then local a = also[u] if a then @@ -1365,9 +1439,7 @@ do relocate(k,tonumber(v) or factor) end end - if not next(done) then - report_tweak("no need to move limits",target,original) - end + feedback_tweak("movelimits",target,original,done) end end @@ -1544,6 +1616,8 @@ do }, } + datasets.accentdimensions = candidates + local function adapt(c,factor,baseheight,basedepth) -- if not c.tweaked then local height = c.height or 0 @@ -1593,7 +1667,7 @@ do nv = nv + 1 nc = c.next if not nc then - local hv = c.hparts + local hv = c.parts if hv then for i=1,#hv do local c = characters[hv[i].glyph] @@ -1656,7 +1730,7 @@ do -- depth = 0, -- unicode = 0x203E, -- commands = { { "rule", height, width } }, - -- hparts = { + -- parts = { -- { advance = width, ["end"] = step, glyph = 0x203E, start = 0 }, -- { advance = width, ["end"] = 0, glyph = 0x203E, start = step, extender = 1 }, -- } @@ -1668,7 +1742,7 @@ do -- yoffset = -depth, -- unicode = 0x0332, -- commands = { { "rule", height, width } }, - -- hparts = { + -- parts = { -- { advance = width, ["end"] = step, glyph = 0x0332, start = 0 }, -- { advance = width, ["end"] = 0, glyph = 0x0332, start = step, extender = 1 }, -- } @@ -1687,7 +1761,7 @@ do yoffset = - thickness / 2, unicode = 0x203E, commands = { { "rule", thickness, width } }, - hparts = { + parts = { { advance = width, ["end"] = step, glyph = 0x203E, start = 0 }, { advance = width, ["end"] = 0, glyph = 0x203E, start = step, extender = 1 }, } @@ -1714,7 +1788,7 @@ do depth = double, unicode = 0x23B4, commands = { { "rule", thickness, width } }, - hparts = { + parts = { { advance = thickness, glyph = tpiece, ["end"] = 0, start = half }, { advance = width, glyph = 0x203E, ["end"] = step, start = step, extender = 1 }, { advance = thickness, glyph = tpiece, ["end"] = half, start = 0 }, @@ -1735,7 +1809,7 @@ do depth = half, unicode = 0x23B5, commands = { { "rule", thickness, width } }, - hparts = { + parts = { { advance = thickness, glyph = bpiece, ["end"] = 0, start = half }, { advance = width, glyph = 0x203E, ["end"] = step, start = step, extender = 1 }, { advance = thickness, glyph = bpiece, ["end"] = half, start = 0 }, @@ -1776,13 +1850,12 @@ do while chardata.next do chardata = characters[chardata.next] end --- if chardata and (force or not chardata.hparts) then - if chardata and (force or overloads[unicode] == false or not chardata.hparts) then + if chardata and (force or overloads[unicode] == false or not chardata.parts) then if not list then - chardata.hparts = nil -- when we test + chardata.parts = nil -- when we test else local overload = overloads[unicode] - local hparts = { } + local parts = { } for i=1,#list do local part = list[i] local glyph = part.glyph or unicode @@ -1797,7 +1870,7 @@ do local width = characters[glyph].width local step = width/2 if part.extensible then - hparts[#hparts+1] = { + parts[#parts+1] = { advance = width, glyph = glyph, ["end"] = step, @@ -1805,7 +1878,7 @@ do extender = 1, } else - hparts[#hparts+1] = { + parts[#parts+1] = { advance = width, glyph = glyph, ["end"] = 0, @@ -1813,8 +1886,8 @@ do } end end - if #hparts == #list then - chardata.hparts = hparts + if #parts == #list then + chardata.parts = parts end end end @@ -1886,6 +1959,8 @@ do } end + datasets.addarrows = { } + function mathtweaks.addarrows(target,original,parameters) local overloads = parameters.list or { } -- { [unicode] = { left = .1, right = .1 } } local left = parameters.left or 0.05 @@ -1896,6 +1971,10 @@ do for unicode, list in sortedhash(arrows) do create(target,unicode,list,overloads) end + datasets.addarrows = sortedkeys(arrows) + if trace_tweaking then + report_tweak("arrows added",target,original) + end end end @@ -1915,7 +1994,7 @@ do -- this could be combined with the previous local sequence = data.sequence local horizontal = data.horizontal if sequence then - local parts = horizontal and source.hparts or source.vparts + local parts = source.parts if parts then local p = { } for i=1,#sequence do @@ -1943,7 +2022,7 @@ do -- this could be combined with the previous end end if #p > 0 then - target[horizontal and "hparts" or "vparts"] = p + target.parts = p end end end @@ -1982,6 +2061,8 @@ do { 0x205F, "s", 1/2 }, -- math thinspace } + datasets.checkspacing = list + function mathtweaks.checkspacing(target,original,parameters) local characters = target.characters local parameters = target.parameters @@ -2073,6 +2154,32 @@ do end end + local function fix(target,original,characters,u,l) + local data = characters[u] + if data then + data.innerlocation = l.location == "right" and 2 or 1 + data.innerxoffset = (l.hfactor or 1) * (data.width or 0) + data.inneryoffset = (l.vfactor or 1) * ((data.height or 0) + (data.depth or 0)) + end + end + + function mathtweaks.radicaldegreeanchors(target,original,parameters) + local list = parameters.list + if list then + local characters = target.characters + for unicode, l in sortedhash(list) do -- resolve variants + local u = detail(characters,unicode) or unicode + if type(u) == "table" then + for i=1,#u do + fix(target,original,characters,u[i],l) + end + else + fix(target,original,characters,u,l) + end + end + end + end + end do @@ -2137,15 +2244,48 @@ do done = nil end + -- After the next one I rewarded myself by (again) watching Joe Parrish interpretation + -- of Shostakovich 10 Mvmt. II - Metal several times (video on yt, track on bandcamp) + -- ... timestamp: awaiting the new Albion (Official) single; their work comes in parts. + + function mathtweaks.fixintegrals(target,original,parameters) + local characters = target.characters + local integral = characters[0x222B] + if integral and not integral.parts then + local top = characters[0x2320] + local mid = characters[0x23AE] + local bot = characters[0x2321] + if top and mid and bot then + top = top.height + mid = mid.height + bot = bot.height + integral.partsitalic = integral.italic + integral.parts = { + { advance = bot, ["end"] = bot/3, glyph = 0x2321, start = bot/3 }, + { advance = mid, ["end"] = mid/2, glyph = 0x23AE, start = mid/2, extender = 1 }, + { advance = top, ["end"] = top/3, glyph = 0x2320, start = top/3 }, + } + if trace_tweaking then + report_tweak("fixing the integral extensible",target,original) + end + end + else + report_tweak("no need to fix the integral extensible",target,original) + end + end + end do local list = { 0x2061, 0x2062, 0x2063, 0x2064 } + datasets.wipecues = list + function mathtweaks.wipecues(target,original,parameters) local characters = target.characters local tobewiped = parameters.list or list + local done = false for i=1,#tobewiped do local unicode = tobewiped[i] characters[unicode] = { @@ -2154,10 +2294,15 @@ do depth = 0, unicode = unicode, } - if trace_tweaking then - report_tweak("character %U has been wiped",target,original,unicode) + if not trace_tweaking then + done = true + elseif done then + done[unicode] = true + else + done = { [unicode] = true } end end + feedback_tweak("wipecues",target,original,done) end end @@ -2168,48 +2313,62 @@ do [0x002F] = 0x2044, } + datasets.fixslashes = mapping + function mathtweaks.fixslashes(target,original,parameters) local characters = target.characters + -- local done = false for normal, weird in sortedhash(mapping) do local normalone = characters[normal] local weirdone = characters[weird] if normalone and weirdone and not normalone.next then normalone.next = weirdone.next - if trace_tweaking then - report_tweak("extensibles from %U used for %U",target,original,weird,normal) - end + -- if not trace_tweaking then + -- done = true + -- elseif done then + -- done[normal] = true + -- else + -- done = { [normal] = true } + -- end end weirdone = copytable(normalone) characters[weird] = weirdone weirdone.unicode = weird end - end + -- feedback_tweak("fixslashes",target,original,done) + if trace_tweaking then + report_tweak("slashes fixed",target,original) + end + end end do -- see pagella for an extensive example + local nps = fonts.helpers.newprivateslot + local mapping = { - [0x0300] = { 0x0060, false }, -- aliases can be a table - [0x0308] = { 0x00A8, false }, - [0x0304] = { 0x00AF, false }, - [0x0301] = { 0x00B4, false }, - [0x0302] = { 0x02C6, true }, - [0x030C] = { 0x02C7, true }, - [0x0306] = { 0x02D8, false }, - [0x0307] = { 0x02D9, false }, - [0x030A] = { 0x02DA, false }, - [0x0303] = { 0x02DC, true }, - [0x20DB] = { 0x20DB, false }, + [0x0300] = { 0x0060, false, nps("flat 0x0060 1") }, + [0x0308] = { 0x00A8, false, nps("flat 0x00A8 1") }, + [0x0304] = { 0x00AF, false, nps("flat 0x00AF 1") }, + [0x0301] = { 0x00B4, false, nps("flat 0x00B4 1") }, + [0x0302] = { 0x02C6, true, nps("flat 0x02C6 1") }, + [0x030C] = { 0x02C7, true, nps("flat 0x02C7 1") }, + [0x0306] = { 0x02D8, false, nps("flat 0x02D8 1") }, + [0x0307] = { 0x02D9, false, nps("flat 0x02D9 1") }, + [0x030A] = { 0x02DA, false, nps("flat 0x02DA 1") }, + [0x0303] = { 0x02DC, true, nps("flat 0x02DC 1") }, + [0x20DB] = { 0x20DB, false, nps("flat 0x20DB 1") }, } -local hat = fonts.helpers.newprivateslot("hat 0x0302") -- todo other sizes + datasets.fixaccents = mapping + datasets.extendaccents = mapping + datasets.flattenaccents = mapping + datasets.copyaccents = mapping function mathtweaks.fixaccents(target,original,parameters) local characters = target.characters - -characters[hat] = copytable(characters[0x0302]) -- TODO - + local done = false for stretching, entry in sortedhash(mapping) do local alias = entry[1] local stretchingdata = characters[stretching] @@ -2218,23 +2377,43 @@ characters[hat] = copytable(characters[0x0302]) -- TODO local width = -topanchor topanchor = width/2 stretchingdata.width = width + stretchingdata.advance = 0 stretchingdata.topanchor = topanchor stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] } - if trace_tweaking then - report_tweak("width of initial extensible accent %U set",target,original,stretching) + if not trace_tweaking then + done = true + elseif done then + done[stretching] = true + else + done = { [stretching] = true } end end end + feedback_tweak("fixaccents",target,original,done) end + -- all true|number false + function mathtweaks.extendaccents(target,original,parameters) local characters = target.characters + local all = parameters.all + local count = tonumber(all) + local done = false for stretching, entry in sortedhash(mapping) do local extend = entry[2] - local stretchingdata = characters[stretching] if extend then - local last = stretchingdata + local last = characters[stretching] + local cnt = 1 + local okay = false while last do + if all or (count and cnt > count) then + last.extensible = true + local flataccent = last.flataccent + if flataccent then + characters[flataccent].extensible = true + okay = true + end + end local n = last.next if n then last = characters[n] @@ -2243,16 +2422,72 @@ characters[hat] = copytable(characters[0x0302]) -- TODO local flataccent = last.flataccent if flataccent then characters[flataccent].extensible = true + okay = true end break end + cnt = cnt + 1 + end + if okay then + if not trace_tweaking then + done = true + elseif done then + done[stretching] = true + else + done = { [stretching] = true } + end + end + end + end + feedback_tweak("extendaccents",target,original,done) + end + + -- force true false + -- height factor 0.8 + -- offset factor 0.9|calculated + -- squeeze factor 0.1|calculated + + function mathtweaks.flattenaccents(target,original,parameters) + local characters = target.characters + local force = parameters.force + local squeeze = parameters.squeeze or 0.8 + local ofactor = parameters.offset or (squeeze/2) + local hfactor = parameters.height or (1 - ofactor) + local done = false + for stretching, entry in sortedhash(mapping) do + local last = characters[stretching] + while last do + if force or not last.flataccent then + local slot = entry[3] + local data = copytable(last) + local height = data.height or 0 + data.effect = { squeeze = squeeze } + data.height = hfactor * height + data.yoffset = ofactor * height + characters[slot] = data + last.flataccent = slot + if not trace_tweaking then + done = true + elseif done then + done[stretching] = true + else + done = { [stretching] = true } + end + end + local n = last.next + if n then + last = characters[n] + else + break end end end + feedback_tweak("flattenaccents",target,original,done) end function mathtweaks.copyaccents(target,original,parameters) local characters = target.characters + local done = false for stretching, entry in sortedhash(mapping) do local alias = entry[1] if alias ~= stretching then @@ -2266,15 +2501,20 @@ characters[hat] = copytable(characters[0x0302]) -- TODO next = stretchingdata.next, commands = { charcommand[stretching] }, topanchor = stretchingdata.topanchor, - -- unicode = stretching, -- when we aliasize to combiners + -- unicode = stretching, -- when we alias to combiners unicode = alias, -- when we keep the original } - if trace_tweaking then - report_tweak("extensibles accent %U copied to %U",target,original,stretching,alias) + if not trace_tweaking then + done = true + elseif done then + done[stretching] = true + else + done = { [stretching] = true } end end end end + feedback_tweak("copyaccents",target,original,done) end end @@ -2335,8 +2575,8 @@ do local parameters = target.parameters local linewidth = target.MathConstants.RadicalRuleThickness -- make option local basechar = characters[radical] - local baseheight = basechar.height/2 - local basedepth = basechar.depth/2 + local baseheight = (basechar.height or 0)/2 + local basedepth = (basechar.depth or 0)/2 local basetotal = baseheight + basedepth local used = baseheight -- @@ -2364,7 +2604,7 @@ do downcommand[basedepth], { "rule", basetotal, linewidth }, }, - vparts = { + parts = { { advance = basetotal, ["end"] = used, @@ -2408,7 +2648,7 @@ do upcommand[baseheight-4*linewidth], { "rule", 4*linewidth, linewidth }, }, - vparts = { + parts = { { advance = basetotal, ["end"] = used, @@ -2489,7 +2729,7 @@ do commands = { scale == 1 and charcommand[basecode] or { "slot", 0, basecode, scale, scale }, }, - vparts = { + parts = { { advance = used, ["end"] = used, @@ -2553,13 +2793,13 @@ do -- local used = 0.8*height local used = 1.2*height -- large overlap because no smaller pieces local total = height + depth - characters[single].vparts = extensible(single,total,used) + characters[single].parts = extensible(single,total,used) characters[double] = { unicode = double, width = 2*width - 1*advance, height = height, depth = depth, - vparts = extensible(double,total,used), + parts = extensible(double,total,used), callback = "devirtualize", commands = { charcommand[single], @@ -2787,16 +3027,10 @@ do elseif trace_tweaking then report_tweak("skipping mirror %U (%s)",target,original,unicode,what) end - local hparts = data.hparts - if hparts then - for i=1,#hparts do - add(target,original,characters,hparts[i],"hpart") - end - end - local vparts = data.vparts - if vparts then - for i=1,#vparts do - add(target,original,characters,vparts[i],"vpart") + local parts = data.parts + if parts then + for i=1,#parts do + add(target,original,characters,parts[i],"hpart") end end local smaller = data.smaller @@ -2907,7 +3141,7 @@ do if setlist or resetlist then local properties = target.properties local codes = tex.mathcontrolcodes - local oldcontrol = tex.get("mathfontcontrol") + local oldcontrol = texget("mathfontcontrol") local newcontrol = oldcontrol -- todo: reset if resetlist then @@ -2989,15 +3223,13 @@ do local features = target.specification.features.normal local definedfont = fonts.definers.internal local copiedglyph = fonts.handlers.vf.math.copy_glyph --- does a deep copy, including parts and so + -- does a deep copy, including parts and so local getsubstitution = fonts.handlers.otf.getsubstitution local fontdata = fonts.hashes.identifiers -- local fonts = target.fonts local size = target.size local characters = target.characters --- local descriptions = target.descriptions - -- compact: size = 655360 if not fonts then fonts = { } target.fonts = fonts @@ -3019,8 +3251,7 @@ do local firstsource = sourcerange.first local lastsource = sourcerange.last or firstsource if firstsource and firsttarget then - local offset = firsttarget - firstsource - local topovershoot = entry.topovershoot + local offset = firsttarget - firstsource if filename then local rscale = entry.rscale or 1 -- todo size = size * rscale -- maybe use scale in vf command @@ -3047,11 +3278,10 @@ do if feature then sourceunicode = getsubstitution(dropin,sourceunicode,feature,true,"math","dflt") or sourceunicode end - if trace_tweaking then - report_tweak("copying %s %U from file %a to %s %U",target,original,thesource,sourceunicode,filename,thetarget,targetunicode) - end +-- if trace_tweaking then +-- report_tweak("copying %s %U from file %a to %s %U",target,original,thesource,sourceunicode,filename,thetarget,targetunicode) +-- end characters[targetunicode] = copiedglyph(target,characters,chars,sourceunicode,index) --- description end end elseif feature then @@ -3062,11 +3292,10 @@ do local variant = getsubstitution(original,sourceunicode,feature,true,"math","dflt") local data = characters[variant] if data then - if trace_tweaking then - report_tweak("copying %s %U from feature %a to %s %U",target,original,thesource,sourceunicode,feature,thetarget,targetunicode) - end +-- if trace_tweaking then +-- report_tweak("copying %s %U from feature %a to %s %U",target,original,thesource,sourceunicode,feature,thetarget,targetunicode) +-- end characters[targetunicode] = copytable(data) --- description end end else @@ -3075,13 +3304,12 @@ do local sourceunicode = mathgaps[s] or s local targetunicode = mathgaps[t] or t if sourceunicode ~= targetunicode then - local data = characters[sourceunicode] + local data = characters[sourceunicode] if data then - if trace_tweaking then - report_tweak("copying %s %U to %s %U",target,original,thesource,sourceunicode,thetarget,targetunicode) - end +-- if trace_tweaking then +-- report_tweak("copying %s %U to %s %U",target,original,thesource,sourceunicode,thetarget,targetunicode) +-- end characters[targetunicode] = copytable(data) --- description end end end @@ -3184,21 +3412,23 @@ local function applytweaks(when,target,original) end end +local function tweakable(target) + local mathparameters = target.mathparameters +-- local features = target.specification.features +-- local mathscript = features and features.normal and features.normal.script == "math" +-- return mathparameters and mathscript -- and target,properties.hasmath + return mathparameters +end + function mathematics.tweakbeforecopyingfont(target,original) - if use_math_goodies then - local mathparameters = target.mathparameters -- why not hasmath - if mathparameters then - applytweaks("beforecopying",target,original) - end + if use_math_goodies and tweakable(target) then + applytweaks("beforecopying",target,original) end end function mathematics.tweakaftercopyingfont(target,original) - if use_math_goodies then - local mathparameters = target.mathparameters -- why not hasmath - if mathparameters then - applytweaks("aftercopying",target,original) - end + if use_math_goodies and tweakable(target) then + applytweaks("aftercopying",target,original) end end @@ -3232,8 +3462,7 @@ do local reported = table.setmetatableindex("table") function mathematics.checkaftercopyingfont(target,original) - local mathparameters = target.mathparameters -- why not hasmath - if mathparameters then + if tweakable(target) then local chardata = characters.data local characters = target.characters -- @@ -3300,11 +3529,8 @@ do end function mathematics.beforepassingfonttotex(target) - if use_math_goodies then - local mathparameters = target.mathparameters -- why not hasmath - if mathparameters then - applytweaks("beforepassing",target,target) - end + if tweakable(target) then + applytweaks("beforepassing",target,target) end end @@ -3352,15 +3578,7 @@ local function extensiblecode(font,unicode) if not char then return unknown end - if character.hparts then - if character.vparts then - return { e_mixed, code, character } - else - local m = char.mathextensible - local e = m and extensibles[m] - return e and { e, code, character } or unknown - end - elseif character.vparts then + if character.parts then local m = char.mathextensible local e = m and extensibles[m] return e and { e, code, character } or unknown @@ -3402,19 +3620,19 @@ local function horizontalcode(family,unicode) local loffset = 0 local roffset = 0 if kind == e_left then - local charlist = data[3].hparts + local charlist = data[3].parts if charlist then local left = charlist[1] loffset = abs((left["start"] or 0) - (left["end"] or 0)) end elseif kind == e_right then - local charlist = data[3].hparts + local charlist = data[3].parts if charlist then local right = charlist[#charlist] roffset = abs((right["start"] or 0) - (right["end"] or 0)) end elseif kind == e_horizontal then - local charlist = data[3].hparts + local charlist = data[3].parts if charlist then local left = charlist[1] local right = charlist[#charlist] @@ -3444,3 +3662,52 @@ interfaces.implement { -- can be public with two times "integerargument" context(kind) end } + +function mathematics.variantcode(unicode,variant) + local data = fontcharacters[getfontoffamily(texget("fam"))] + local char = data and data[unicode] + if char then + for i=1,variant do + local next = char.next + if next then + unicode = next + char = data[next] + else + break + end + end + end + return unicode +end + +function mathematics.variantcount(unicode) + local data = fontcharacters[getfontoffamily(texget("fam"))] + local char = data and data[unicode] + local count = 0 + if char then + while true do + local next = char.next + if next then + count = count + 1 + char = data[next] + else + break + end + end + end + return count +end + +interfaces.implement { + name = "mathvariantcode", + public = true, + arguments = { "integer", "integer" }, + actions = { mathematics.variantcode, context }, +} + +interfaces.implement { + name = "mathvariantcount", + public = true, + arguments = "integer", + actions = { mathematics.variantcount, context }, +} diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl index af6b48cee..8a29f4f9d 100644 --- a/tex/context/base/mkxl/math-ali.mkxl +++ b/tex/context/base/mkxl/math-ali.mkxl @@ -2871,11 +2871,11 @@ %D Usage \type {\sum _ {\mstack {i \in V_{0}, i \neq j}}}, documented by Mikael: -\permanent\protected\def\mstack#1% +\permanent\protected\def\mstack#1% todo: make it configurable {\begingroup \scratchtoks\emptytoks \setcharstrut(\relax - \processcommalist[#1]{\iftok\scratchtoks\emptytoks\else\toksapp\scratchtoks{\strut\NR}\fi\toksapp\scratchtoks}% - \expandafter\startsubstack\the\scratchtoks\strut\stopsubstack + \processcommalist[#1]{\iftok\scratchtoks\emptytoks\else\toksapp\scratchtoks{\mathstrut\NR}\fi\toksapp\scratchtoks}% + \expandafter\startsubstack\the\scratchtoks\mathstrut\stopsubstack \endgroup} %D Similar to simplecases: diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl index b3c85070f..d8cbf4e76 100644 --- a/tex/context/base/mkxl/math-fen.mkxl +++ b/tex/context/base/mkxl/math-fen.mkxl @@ -54,6 +54,8 @@ \c!height=\zeropoint, \c!depth=\zeropoint, \c!distance=\zerocount, + \c!topspace=\zeropoint, + \c!bottomspace=\zeropoint, \c!factor=\v!auto] \appendtoks @@ -83,6 +85,17 @@ %D $ a + \fenced[bar] {\frac {b} {c}} + d $ %D \stoptyping +% \startbuffer +% $ \left( \frac{1}{x}^{2} \right)$ +% $ \left( x \right)$ +% $ \left( x^2 \right)$ +% $ \left( \frac{1}{x} \right)$ +% $ \left( \frac{1}{x}^2 \right)$ +% \stopbuffer +% +% \getbuffer\blank +% {\setupmathfence[topspace=-2pt,bottomspace=-1pt]\getbuffer\blank} + % todo : class -> number \newconditional\c_math_fenced_mirror \settrue \c_math_fenced_mirror @@ -205,6 +218,10 @@ \fi \s!source \numexpr\namedboxanchor{\mathfenceparameter#4}\relax + % + \s!top \mathfenceparameter\c!topspace + \s!bottom \mathfenceparameter\c!bottomspace + % \math_fenced_trace \ifx\p_fence\v!none \Udelimiter\mathghostcode\fam\zerocount diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index c1beb071c..259fd360e 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -111,6 +111,8 @@ +\analyzescriptnucleusboxmathcontrolcode +\accenttopskewwithoffsetmathcontrolcode % +\ignorekerndimensionsmathcontrolcode % xits needs this (bad depth of fences) + % +\ignoreflataccentsmathcontrolcode + +\extendaccentsmathcontrolcode \relax % \mathpenaltiesmode\plusone @@ -891,7 +893,6 @@ % Now we redefine \type {\mathematics} and \type {\m}: \pushoverloadmode - \permanent\protected\def\mathematics{\doifelsenextoptionalcs\math_m_yes\math_m_nop} \aliased\let\m \mathematics % we keep the simple versions @@ -3723,6 +3724,54 @@ \definemathtext[mathsplitbi][mathsplit][\c!style=\bi] \definemathtext[mathsplitbs][mathsplit][\c!style=\bs] +% \startbuffer +% $ +% { x\! \neq x!} \quad {\ss x\! \neq x!} \qquad +% {\it x\! \neq x!} \quad {\ss \it x\! \neq x!} \qquad +% {\fi x\! \neq x!} \quad {\ss \fi x\! \neq x!} \qquad +% {\bi x\! \neq x!} \quad {\ss \bi x\! \neq x!} +% $ +% \stopbuffer +% +% \startTEXpage[offset=1dk] +% \getbuffer \par \automathtext \getbuffer +% \stopTEXpage + +\newconditional\c_mathtextauto % we need aproper key: \settrue\c_mathtextauto + +\permanent\protected\def\automathtext{\settrue\c_mathtextauto} + +\let\currentmathalphabet \s!rm +\let\currentmathfontstyle\s!tf + +\permanent\protected\def\mathtextauto#1#2% + {\ifconditional\c_mathtextauto + \mathortext + {\mathpunct + {\begincsname\currentmathalphabet\endcsname + \begincsname mathtext\currentmathfontstyle\endcsname + {#1}}}% + {#1}% + \else + #2% + \fi} + +%D Actually in spac-hor.mkxl we defined them using \suggestedalias which redefines +%D these so basically we now make that sort of obsolete. +%D +%D \starttyping +%D $x\, x$\quad\automathtext$x\, x$ +%D \stoptyping + +\pushoverloadmode + \permanent\protected\def\.{\mathtextauto{.}{.}} + \permanent\protected\def\,{\mathtextauto{,}{\thinspace }} + \permanent\protected\def\:{\mathtextauto{:}{\medspace }} + \permanent\protected\def\;{\mathtextauto{;}{\thickspace}} + \permanent\protected\def\!{\mathtextauto{!}{\negthinspace}} + \permanent\protected\def\?{\mathtextauto{?}{?}} +\popoverloadmode + \appendtoks \reinstatecatcodecommand\barasciicode \obeydiscretionaries @@ -4294,13 +4343,21 @@ %D Just to be sure: -\immutable\integerdef\c_math_glyph_options\numexpr +\immutable\integerdef\c_math_glyph_options_default\numexpr \noexpansionglyphoptioncode +\noprotrusionglyphoptioncode \relax +\immutable\integerdef\c_math_glyph_options_hz\numexpr + \noprotrusionglyphoptioncode +\relax + \appendtoks - \glyphoptions\c_math_glyph_options + \ifcstok{\mathematicsparameter\v!hz}\v!yes + \glyphoptions\c_math_glyph_options_hz + \else + \glyphoptions\c_math_glyph_options_default + \fi \to \everymathematics %D Bonus for testing: diff --git a/tex/context/base/mkxl/math-lop.mkxl b/tex/context/base/mkxl/math-lop.mkxl index 8be8fc98d..327d663e8 100644 --- a/tex/context/base/mkxl/math-lop.mkxl +++ b/tex/context/base/mkxl/math-lop.mkxl @@ -67,7 +67,9 @@ \ifchkdim\mathoperatorparameter\c!size\or \s!depth \mathoperatorparameter\c!size \s!height\mathoperatorparameter\c!size - \s!axis + \s!axis % variants + \s!noaxis % extensibles (assumes also axis) + \s!exact % make sure we don't overshoot when there are no variants and extensibles \orelse\ifcstok{\mathoperatorparameter\c!size}\v!auto \s!auto \fi @@ -118,9 +120,10 @@ \setupmathematics[\c!integral=nolimits] -\definemathoperator [integral] [integrals] [\c!left="222B] % these might go unless we decide -\definemathoperator [iintegral] [integrals] [\c!left="222C] % to have verbose parents but who -\definemathoperator [iiintegral] [integrals] [\c!left="222D] % will use them +\definemathoperator [integral] [integrals] [\c!left="222B] % these might go unless we decide +\definemathoperator [iintegral] [integrals] [\c!left="222C] % to have verbose parents but who +\definemathoperator [iiintegral] [integrals] [\c!left="222D] % will use them +\definemathoperator [iiiintegral] [integrals] [\c!left="2A0C] \definemathoperator [int] [integrals] [\c!left="222B] % INTEGRAL \definemathoperator [iint] [integrals] [\c!left="222C] % DOUBLE INTEGRAL diff --git a/tex/context/base/mkxl/math-map.lmt b/tex/context/base/mkxl/math-map.lmt index d0a1410a1..98cc59c89 100644 --- a/tex/context/base/mkxl/math-map.lmt +++ b/tex/context/base/mkxl/math-map.lmt @@ -46,6 +46,8 @@ local setmetatableindex = table.setmetatableindex local texgetattribute = tex.getattribute local texsetattribute = tex.setattribute +local setmacro = tokens.setters.macro + local texgetmode = tex.getmode local mathmode_code = tex.modelevels.math @@ -711,9 +713,19 @@ implement { protected = true, actions = function(alphabet,style) if texgetmode() == mathmode_code then - local data = alphabets[alphabet] or regular - data = data[style] or data.tf - texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet]) + local data = alphabets[alphabet] + if not data then + alphabet = "regular" + data = regular + end + local used = data[style] + if not used then + style = "tf" + used = data.tf + end + setmacro("currentmathalphabet",alphabet == "regular" and "rm" or alphabet) + setmacro("currentmathfontstyle",style) + texsetattribute(mathalphabet,used and used.attribute or texattribute[mathalphabet]) end end } @@ -728,6 +740,7 @@ implement { local r = mathremap[texgetattribute(mathalphabet)] local alphabet = r and r.alphabet or "regular" local data = alphabets[alphabet][style] + setmacro("currentmathfontstyle",style) texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet]) end end diff --git a/tex/context/base/mkxl/math-vfu.lmt b/tex/context/base/mkxl/math-vfu.lmt index 86d1fca0d..c1d45551b 100644 --- a/tex/context/base/mkxl/math-vfu.lmt +++ b/tex/context/base/mkxl/math-vfu.lmt @@ -85,7 +85,7 @@ local shared = { } local function brace(main,characters,id,size,unicode,first,rule,left,right,rule,last) if not characters[unicode] then characters[unicode] = { - hparts = { + parts = { { extender = 0, glyph = first }, { extender = 1, glyph = rule }, { extender = 0, glyph = left }, @@ -123,7 +123,7 @@ local function extension(main,characters,id,size,unicode,first,middle,last) if lw == 0 then lw = 1 end - chr.hparts = { + chr.parts = { { extender = 0, glyph = first, ["end"] = fw/2, start = 0, advance = fw }, { extender = 1, glyph = middle, ["end"] = mw/2, start = mw/2, advance = mw }, { extender = 0, glyph = last, ["end"] = 0, start = lw/2, advance = lw }, @@ -133,7 +133,7 @@ end local function parent(main,characters,id,size,unicode,first,rule,last) if not characters[unicode] then characters[unicode] = { - hparts = { + parts = { { extender = 0, glyph = first }, { extender = 1, glyph = rule }, { extender = 0, glyph = last }, @@ -668,13 +668,13 @@ local function copy_glyph(main,target,original,unicode,slot) break -- safeguard (when testing stuff) end end - local hv = olddata.hparts - if hv then - hv = fastcopy(hv) - newdata.hparts = hv - for i=1,#hv do - local hvi = hv[i] - local oldglyph = hvi.glyph + local pv = olddata.parts + if pv then + pv = fastcopy(pv) + newdata.parts = pv + for i=1,#hp do + local pvi = pv[i] + local oldglyph = pvi.glyph local olddata = original[oldglyph] local newdata = { width = olddata.width, @@ -683,25 +683,7 @@ local function copy_glyph(main,target,original,unicode,slot) tounicode = olddata.tounicode, commands = { { "slot", slot, oldglyph } }, } - hvi.glyph = addprivate(main,formatters["M-H-%H"](oldglyph),newdata) - end - end - local vv = olddata.vparts - if vv then - vv = fastcopy(vv) - newdata.vparts = vv - for i=1,#vv do - local vvi = vv[i] - local oldglyph = vvi.glyph - local olddata = original[oldglyph] - local newdata = { - width = olddata.width, - height = olddata.height, - depth = olddata.depth, - tounicode = olddata.tounicode, - commands = { { "slot", slot, oldglyph } }, - } - vvi.glyph = addprivate(main,formatters["M-V-%H"](oldglyph),newdata) + pvi.glyph = addprivate(main,formatters["M-P-%H"](oldglyph),newdata) end end local smaller = olddata.smaller @@ -1029,30 +1011,18 @@ function vfmath.define(specification,set,goodies) if n then t.next = offset + n elseif variants_done then - local vv = fci.vparts - if vv then - t.vparts = vv - end - local hv = fci.hparts - if hv then - t.hparts = hv + local v = fci.parts + if v then + t.parts = v end else - local vv = fci.vparts - if vv then - for i=1,#vv do - local vvi = vv[i] - vvi.glyph = vvi.glyph + offset - end - t.vparts = vv - end - local hv = fci.hparts - if hv then - for i=1,#hv do - local hvi = hv[i] - hvi.glyph = hvi.glyph + offset + local v = fci.parts + if v then + for i=1,#v do + local vi = v[i] + vi.glyph = vi.glyph + offset end - t.hparts = hv + t.parts = v end end characters[offset + index] = t diff --git a/tex/context/base/mkxl/meta-imp-glyphs.mkxl b/tex/context/base/mkxl/meta-imp-glyphs.mkxl new file mode 100644 index 000000000..96f7aecd3 --- /dev/null +++ b/tex/context/base/mkxl/meta-imp-glyphs.mkxl @@ -0,0 +1,65 @@ +%D \module +%D [ file=meta-imp-glyphs, +%D version=2022.10.26, % moved from test files by MS and HH +%D title=\METAPOST\ Graphics, +%D subtitle=Glyph Shape Manipulations, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startMPdefinitions + + def LoadGlyph(expr tag, filename, unicode) = + glyphshape_start(filename,unicode) ; + expandafter picture scantokens(tag & "char"); + expandafter path scantokens(tag & "bbox") ; + expandafter numeric scantokens(tag & "accent") ; + expandafter numeric scantokens(tag & "italic") ; + scantokens(tag & "char") := image (draw for i=1 upto glyphshape_n : glyphshape_path(i) && endfor cycle ;) ; + scantokens(tag & "bbox") := glyphshape_usedbox ; + scantokens(tag & "accent") := glyphshape_accent ; + scantokens(tag & "italic") := xpart urcorner glyphshape_usedbox - glyphshape_italic ; + glyphshape_stop ; + enddef ; + + def ScaleGlyph(expr tag, s) = + scantokens(tag & "char") := scantokens(tag & "char") scaled s ; + scantokens(tag & "bbox") := scantokens(tag & "bbox") scaled s ; + scantokens(tag & "accent") := s * scantokens(tag & "accent") ; + scantokens(tag & "italic") := s * scantokens(tag & "italic") ; + enddef ; + + def ShiftGlyph(expr tag, dx, dy) = + scantokens(tag & "char") := scantokens(tag & "char") shifted (dx, dy) ; + scantokens(tag & "bbox") := scantokens(tag & "bbox") shifted (dx, dy) ; + scantokens(tag & "accent") := scantokens(tag & "accent") + dx ; + scantokens(tag & "italic") := scantokens(tag & "italic") + dx ; + enddef ; + + def DrawGlyph(expr tag) = + draw scantokens(tag & "char") withpen pencircle scaled 1 ; + draw scantokens(tag & "bbox") withcolor "darkyellow" ; + draw (scantokens(tag & "accent"), (ypart urcorner scantokens(tag & "bbox"))) withcolor "darkmagenta" withpen pencircle scaled 5 ; + draw (scantokens(tag & "italic"), .5(ypart urcorner scantokens(tag & "bbox"))) withcolor "orange" withpen pencircle scaled 5 ; + enddef ; + +\stopMPdefinitions + +\startMPdefinitions + + def ShowShape(expr font, slot) = + glyphshape_start(font, slot) ; + draw for i=1 upto glyphshape_n : glyphshape_path(i) && endfor cycle ; + draw glyphshape_boundingbox withcolor red ; + draw glyphshape_usedline withcolor green ; + draw glyphshape_usedbox withcolor blue ; + draw (glyphshape_accent,glyphshape_depth) withcolor "orange" withpen pencircle scaled 5 ; + draw (glyphshape_italic,glyphshape_depth) withcolor "orange" withpen pencircle scaled 5 ; + glyphshape_stop ; + enddef; + +\stopMPdefinitions diff --git a/tex/context/base/mkxl/mlib-ctx.mkxl b/tex/context/base/mkxl/mlib-ctx.mkxl index 384650a45..7c88585e9 100644 --- a/tex/context/base/mkxl/mlib-ctx.mkxl +++ b/tex/context/base/mkxl/mlib-ctx.mkxl @@ -29,6 +29,7 @@ \registerctxluafile{mlib-pos}{autosuffix} \registerctxluafile{mlib-cnt}{autosuffix} \registerctxluafile{mlib-svg}{autosuffix} +\registerctxluafile{mlib-fnt}{autosuffix} % outline fun \unprotect diff --git a/tex/context/base/mkxl/mlib-fnt.lmt b/tex/context/base/mkxl/mlib-fnt.lmt new file mode 100644 index 000000000..e53ded38a --- /dev/null +++ b/tex/context/base/mkxl/mlib-fnt.lmt @@ -0,0 +1,548 @@ +if not modules then modules = { } end modules ['font-mps'] = { + version = 1.001, + comment = "companion to font-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local type, tonumber, tostring = type, tonumber, tostring +local concat, insert, remove = table.concat, table.insert, table.remove +local formatters, match = string.formatters, string.match +local utfbyte = utf.byte + +-- QP0 [QP1] QP2 => CP0 [CP1 CP2] CP3 + +-- CP0 = QP0 +-- CP3 = QP2 +-- +-- CP1 = QP0 + 2/3 *(QP1-QP0) +-- CP2 = QP2 + 2/3 *(QP1-QP2) + +fonts = fonts or { } +local metapost = fonts.metapost or { } +fonts.metapost = metapost + +local f_moveto = formatters["(%N,%N)"] +local f_lineto = formatters["--(%N,%N)"] +local f_curveto = formatters["..controls(%N,%N)and(%N,%N)..(%N,%N)"] +local s_cycle = "--cycle" + +local f_nofill = formatters["nofill %s;"] +local f_dofill = formatters["fill %s;"] + +local f_draw_trace = formatters["drawpathonly %s;"] +local f_draw = formatters["draw %s;"] + +local f_rectangle = formatters["((%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle)"] +local f_line = formatters["((%N,%N)--(%N,%N))"] + +function metapost.boundingbox(d,factor) + local bounds = d.boundingbox + local factor = factor or 1 + local llx = factor*bounds[1] + local lly = factor*bounds[2] + local urx = factor*bounds[3] + local ury = factor*bounds[4] + return f_rectangle(llx,lly,urx,lly,urx,ury,llx,ury) +end + +function metapost.baseline(d,factor) + local bounds = d.boundingbox + local factor = factor or 1 + local llx = factor*bounds[1] + local urx = factor*bounds[3] + return f_line(llx,0,urx,0) +end + +function metapost.widthline(d,factor) + local bounds = d.boundingbox + local factor = factor or 1 + local lly = factor*bounds[2] + local ury = factor*bounds[4] + local width = factor*d.width + return f_line(width,lly,width,ury) +end + +function metapost.zeroline(d,factor) + local bounds = d.boundingbox + local factor = factor or 1 + local lly = factor*bounds[2] + local ury = factor*bounds[4] + return f_line(0,lly,0,ury) +end + +function metapost.paths(d,xfactor,yfactor) + local sequence = d.sequence + local segments = d.segments + local list = { } + local path = { } -- recycled + local size = 0 + local xfactor = xfactor or 1 + local yfactor = yfactor or xfactor + if sequence then + local i = 1 + local n = #sequence + while i < n do + local operator = sequence[i] + if operator == "m" then -- "moveto" + if size > 0 then + size = size + 1 + path[size] = s_cycle + list[#list+1] = concat(path,"",1,size) + size = 1 + else + size = size + 1 + end + path[size] = f_moveto(xfactor*sequence[i+1],yfactor*sequence[i+2]) + i = i + 3 + elseif operator == "l" then -- "lineto" + size = size + 1 + path[size] = f_lineto(xfactor*sequence[i+1],yfactor*sequence[i+2]) + i = i + 3 + elseif operator == "c" then -- "curveto" + size = size + 1 + path[size] = f_curveto(xfactor*sequence[i+1],yfactor*sequence[i+2],xfactor*sequence[i+3],yfactor*sequence[i+4],xfactor*sequence[i+5],yfactor*sequence[i+6]) + i = i + 7 + elseif operator =="q" then -- "quadraticto" + size = size + 1 + -- first is always a moveto + local l_x = xfactor*sequence[i-2] + local l_y = yfactor*sequence[i-1] + local m_x = xfactor*sequence[i+1] + local m_y = yfactor*sequence[i+2] + local r_x = xfactor*sequence[i+3] + local r_y = yfactor*sequence[i+4] + path[size] = f_curveto ( + l_x + 2/3 * (m_x-l_x), + l_y + 2/3 * (m_y-l_y), + r_x + 2/3 * (m_x-r_x), + r_y + 2/3 * (m_y-r_y), + r_x, r_y + ) + i = i + 5 + else + -- weird + i = i + 1 + end + end + elseif segments then +-- inspect(segments) + for i=1,#segments do + local segment = segments[i] + local operator = segment[#segment] + if operator == "m" then -- "moveto" + if size > 0 then + size = size + 1 + path[size] = s_cycle + list[#list+1] = concat(path,"",1,size) + size = 1 + else + size = size + 1 + end + path[size] = f_moveto(xfactor*segment[1],yfactor*segment[2]) + elseif operator == "l" then -- "lineto" + size = size + 1 + path[size] = f_lineto(xfactor*segment[1],yfactor*segment[2]) + elseif operator == "c" then -- "curveto" + size = size + 1 + path[size] = f_curveto(xfactor*segment[1],yfactor*segment[2],xfactor*segment[3],yfactor*segment[4],xfactor*segment[5],yfactor*segment[6]) + elseif operator == "q" then -- "quadraticto" + size = size + 1 + -- first is always a moveto + local prev = segments[i-1] + local l_x = xfactor*prev[#prev-2] + local l_y = yfactor*prev[#prev-1] + local m_x = xfactor*segment[1] + local m_y = yfactor*segment[2] + local r_x = xfactor*segment[3] + local r_y = yfactor*segment[4] + path[size] = f_curveto ( + l_x + 2/3 * (m_x-l_x), + l_y + 2/3 * (m_y-l_y), + r_x + 2/3 * (m_x-r_x), + r_y + 2/3 * (m_y-r_y), + r_x, r_y + ) + else + -- weird + end + end + else + return + end + if size > 0 then + size = size + 1 + path[size] = s_cycle + list[#list+1] = concat(path,"",1,size) + end + return list +end + +function metapost.fill(paths) + local r = { } + local n = #paths + for i=1,n do + if i < n then + r[i] = f_nofill(paths[i]) + else + r[i] = f_dofill(paths[i]) + end + end + return concat(r) +end + +function metapost.draw(paths,trace) + local r = { } + local n = #paths + for i=1,n do + if trace then + r[i] = f_draw_trace(paths[i]) + else + r[i] = f_draw(paths[i]) + end + end + return concat(r) +end + +function metapost.maxbounds(data,index,factor) + local maxbounds = data.maxbounds + local factor = factor or 1 + local glyphs = data.glyphs + local glyph = glyphs[index] + local boundingbox = glyph.boundingbox + local xmin, ymin, xmax, ymax + if not maxbounds then + xmin = 0 + ymin = 0 + xmax = 0 + ymax = 0 + for i=1,#glyphs do + local d = glyphs[i] + if d then + local b = d.boundingbox + if b then + if b[1] < xmin then xmin = b[1] end + if b[2] < ymin then ymin = b[2] end + if b[3] > xmax then xmax = b[3] end + if b[4] > ymax then ymax = b[4] end + end + end + end + maxbounds = { xmin, ymin, xmax, ymax } + data.maxbounds = maxbounds + else + xmin = maxbounds[1] + ymin = maxbounds[2] + xmax = maxbounds[3] + ymax = maxbounds[4] + end + local llx = boundingbox[1] + local lly = boundingbox[2] + local urx = boundingbox[3] + local ury = boundingbox[4] + local width = glyph.width + if llx > 0 then + llx = 0 + end + if width > urx then + urx = width + end + return f_rectangle( + factor*llx,factor*ymin, + factor*urx,factor*ymin, + factor*urx,factor*ymax, + factor*llx,factor*ymax + ) +end + +-- This is a nice example of tex, metapost and lua working in tandem. Each kicks in at the +-- right time. It's probably why I like watching https://www.youtube.com/watch?v=c5FqpddnJmc +-- so much: precisely (and perfectly) timed too. + +local texgetbox = tex.getbox + +local nodecodes = nodes.nodecodes -- no nuts yet +local rulecodes = nodes.rulecodes + +local rule_code = nodecodes.rule + +local normalrule_code = rulecodes.normal +local outlinerule_code = rulecodes.outline +local userrule_code = rulecodes.user +local emptyrule_code = rulecodes.empty + +local nuts = nodes.nuts +local getwhd = nuts.getwhd +local getexpansion = nuts.getexpansion +local getscales = nuts.getscales +local isglyph = nuts.isglyph + +local fonthashes = fonts.hashes +local fontcharacters = fonthashes.characters +local fontparameters = fonthashes.parameters +local fontshapes = fonthashes.shapes +local fontdescriptions = fonthashes.descriptions + +local topaths = metapost.paths + +local f_text = formatters["mfun_do_outline_text_flush(%q,%i,%N,%N,%q)(%,t);"] +local f_rule = formatters["mfun_do_outline_rule_flush(%q,%N,%N,%N,%N);"] +local f_bounds = formatters["checkbounds(%N,%N,%N,%N);"] +local s_nothing = "(origin scaled 10)" + +local sc = 10 +local fc = number.dimenfactors.bp + +local function glyph(kind,font,char,advance,shift,ex,s, sx,sy) + local character = fontcharacters[font][char] + if character then + local index = character.index + if index then + local shapedata = fontshapes[font] + local glyphs = shapedata.glyphs + if glyphs then + local glyf = glyphs[index] + if glyf then + local units = 1000 -- factor already takes shapedata.units into account + local yfactor = (sc/units) * fontparameters[font].factor / 655.36 + local xfactor = yfactor + local shift = shift or 0 + local advance = advance or 0 + local exfactor = ex or 0 + local wfactor = 1 + local detail = kind == "p" and tostring(char) or "" + if exfactor ~= 0 then + wfactor = (1+(ex/units)/1000) + xfactor = xfactor * wfactor + end + if s then + xfactor = (s/1000) * ((sx or 1000)/1000) * xfactor + yfactor = (s/1000) * ((sy or 1000)/1000) * yfactor + end + local paths = topaths(glyf,xfactor,yfactor) + if paths then + return f_text(kind,#paths,advance,shift,detail,paths) -- , character.width * fc * wfactor + end + end + end + end + end +end + +metapost.glyph = glyph + +local kind = "" +local buffer = { } +local b = 0 + +local function reset() + buffer = { } + b = 0 +end + +local function flushcharacter(current, pos_h, pos_v, pod_r, font, char) + local char, font = isglyph(current) + local s, sx, sy = getscales(current) + local code = glyph(kind,font,char,pos_h*fc,pos_v*fc,getexpansion(current),s,sx,sy) + if code then + b = b + 1 + buffer[b] = code + end +end + +local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v, subtype) + if subtype == normalrule_code then + b = b + 1 + buffer[b] = f_rule(kind,pos_h*fc,pos_v*fc,size_h*fc,size_v*fc) + elseif subtype == outlinerule_code then + b = b + 1 + buffer[b] = f_rule("d",pos_h*fc,pos_v*fc,size_h*fc,size_v*fc) + elseif subtype == userrule_code then + -- print("USER RULE") + -- b = b + 1 + -- buffer[b] = f_rule("d",size_h*fc,size_v*fc,pos_h*fc,pos_v*fc) + elseif subtype == emptyrule_code then + -- ignore + else + -- b = b + 1 + -- buffer[b] = f_rule("f",pos_h*fc,pos_v*fc,size_h*fc,size_v*fc) + end +end + +local function flushsimplerule(pos_h, pos_v, pos_r, size_h, size_v) + flushrule(false,pos_h,pos_v,pos_r,size_h,size_v,normalrule_code) +end + +local function flushspecialrule(pos_h, pos_v, pos_r, w, h, d, l, outline) + flushrule(false,pos_h,pos_v-d,pos_r,w,h+d,outline and outlinerule_code or normalrule_code) +end + +-- installer + +drivers.install { + name = "mpo", + actions = { + initialize = function() + reset() + end, + finalize = function(driver,details) + local bb = details.boundingbox + local llx = bb[1] * fc + local lly = bb[2] * fc + local urx = bb[3] * fc + local ury = bb[4] * fc + b = b + 1 + buffer[b] = f_bounds(llx,lly,urx,ury) + -- inspect(buffer) + end, + }, + flushers = { + updatefontstate = updatefontstate, + character = flushcharacter, + rule = flushrule, + simplerule = flushsimplerule, + specialrule = flushspecialrule, + } +} + +function metapost.boxtomp(n,k) + kind = k + nodes.handlers.finalizebox(n) + drivers.converters.lmtx(drivers.instances.mpo,texgetbox(n),"box",1) + local result = concat(buffer,";") + reset() + return result +end + +-- This is a new set of commands: + +local loaded = table.setmetatableindex(function(t,k) + local v = fonts.definers.internal({ name = k } ,"") + t[k] = v + return v +end) + +local mpdata = 0 +local mpstack = { } + +function mp.lmt_glyphshape_start(id,character) + if type(id) == "string" then + id = loaded[id] + end + local fontid = (id and id ~= 0 and id) or font.current() + local shapedata = fontshapes [fontid] -- by index + local characters = fontcharacters [fontid] -- by unicode + local descriptions = fontdescriptions[fontid] -- by unicode + local mathgaps = mathematics.gaps -- not yet loaded + local shapeglyphs = shapedata.glyphs or { } + if type(character) == "string" and character ~= "" then + local hex = match(character,"^0x(.+)") + if hex then + character = tonumber(hex,16) + else + character = utfbyte(character) + end + else + character = tonumber(character) + end + local unicode = mathgaps[character] or character + local chardata = characters[unicode] + local descdata = descriptions[unicode] + if chardata then + glyph = shapeglyphs[chardata.index] + if glyph then + mpdata = glyph.mpdata + if not mpdata then + if glyph.segments or glyph.sequence then + local units = shapedata.units or 1000 + local factor = 100/units + local width = (descdata.width or 0) * factor + local height = descdata.boundingbox[4] * factor + local depth = descdata.boundingbox[2] * factor + local math = descdata.math + local italic = (math and math.italic or 0) * factor + local accent = (math and math.accent or 0) * factor + mpdata = { + paths = metapost.paths(glyph,factor), + boundingbox = metapost.boundingbox(glyph,factor), + baseline = metapost.baseline(glyph,factor), + width = width, + height = height, + depth = depth, + italic = italic, + accent = accent, + usedbox = f_rectangle(0,depth,width,depth,width,height,0,height), + usedline = f_line(0,0,width,0), + } + glyph.mpdata = mpdata + else + print("CHECK 1",id,character) + end + end + end + else + print("CHECK 2",id,character) + end + insert(mpstack, mpdata) +end + +local mpprint = mp.print +local injectpair = mp.inject.pair +local injectnumeric = mp.inject.numeric + +function mp.lmt_glyphshape_stop() + mpdata = remove(mpstack) +end + +function mp.lmt_glyphshape_n() + if mpdata then + mpprint(#mpdata.paths) + else + injectnumeric(0) + end +end + +function mp.lmt_glyphshape_path(i) + if mpdata then + mpprint(mpdata.paths[i]) + else + injectpair(0,0) + end +end + +function mp.lmt_glyphshape_boundingbox() + if mpdata then + mpprint(mpdata.boundingbox) + else + injectpair(0,0) + end +end +function mp.lmt_glyphshape_usedbox() + if mpdata then + mpprint(mpdata.usedbox) + else + injectpair(0,0) + end +end + +function mp.lmt_glyphshape_baseline() + if mpdata then + mpprint(mpdata.baseline) + else + injectpair(0,0) + end +end +function mp.lmt_glyphshape_usedline() + if mpdata then + mpprint(mpdata.usedline) + else + injectpair(0,0) + end +end + +function mp.lmt_glyphshape_width () injectnumeric(mpdata and mpdata.width or 0) end +function mp.lmt_glyphshape_depth () injectnumeric(mpdata and mpdata.depth or 0) end +function mp.lmt_glyphshape_height() injectnumeric(mpdata and mpdata.height or 0) end +function mp.lmt_glyphshape_italic() injectnumeric(mpdata and mpdata.italic or 0) end +function mp.lmt_glyphshape_accent() injectnumeric(mpdata and mpdata.accent or 0) end diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl index 636c15363..f04418e43 100644 --- a/tex/context/base/mkxl/mult-sys.mkxl +++ b/tex/context/base/mkxl/mult-sys.mkxl @@ -45,6 +45,9 @@ \definesystemconstant {afrikaans} \definesystemconstant {af} \definesystemconstant {albanian} \definesystemconstant {sq} +\definesystemconstant {armenian} \definesystemconstant {hy} + \definesystemconstant {hye} + \definesystemconstant {hyw} \definesystemconstant {ancientgreek} \definesystemconstant {agr} \definesystemconstant {ancientlatin} \definesystemconstant {ala} \definesystemconstant {arabic} \definesystemconstant {ar} diff --git a/tex/context/base/mkxl/node-cmp.lmt b/tex/context/base/mkxl/node-cmp.lmt index 8f805abd9..887020351 100644 --- a/tex/context/base/mkxl/node-cmp.lmt +++ b/tex/context/base/mkxl/node-cmp.lmt @@ -202,12 +202,8 @@ local iszeroglue = direct.iszeroglue local getglue = direct.getglue local setglue = direct.setglue -function node.iszeroglue(n) return iszeroglue(todirect(n)) end -function node.getglue (n) return getglue (todirect(n)) end -function node.setglue (n) return setglue (todirect(n)) end - -node.family_font = tex.getfontoffamily - --- node.get_glue = node.getglue --- node.set_glue = node.setglue +function node.iszeroglue(n) return iszeroglue(todirect(n)) end +function node.getglue (n) return getglue (todirect(n)) end +function node.setglue (n,...) return setglue (todirect(n),...) end +node.family_font = tex.getfontoffamily diff --git a/tex/context/base/mkxl/node-res.lmt b/tex/context/base/mkxl/node-res.lmt index e023499e5..daf0187e8 100644 --- a/tex/context/base/mkxl/node-res.lmt +++ b/tex/context/base/mkxl/node-res.lmt @@ -8,6 +8,7 @@ if not modules then modules = { } end modules ['node-res'] = { local type, next, rawset = type, next, rawset local gmatch, format = string.gmatch, string.format +local round = math.round --[[ldx--

The next function is not that much needed but in we use @@ -381,7 +382,7 @@ function nutpool.outlinerule(width,height,depth,line) -- w/h/d == nil will let t setwhd(n,width,height,depth) end if line then - setruledata(n,line) + setruledata(n,round(line)) -- has to be an integer end return n end diff --git a/tex/context/base/mkxl/spac-chr.lmt b/tex/context/base/mkxl/spac-chr.lmt index 554dc0400..a71c4a0e1 100644 --- a/tex/context/base/mkxl/spac-chr.lmt +++ b/tex/context/base/mkxl/spac-chr.lmt @@ -28,6 +28,9 @@ local nodes, node = nodes, node local nuts = nodes.nuts +local getid = nuts.getid +local getsubtype = nuts.getsubtype +local setsubtype = nuts.setsubtype local getboth = nuts.getboth local getnext = nuts.getnext local getprev = nuts.getprev @@ -37,7 +40,6 @@ local getlanguage = nuts.getlanguage local setchar = nuts.setchar local setattrlist = nuts.setattrlist local getfont = nuts.getfont -local setsubtype = nuts.setsubtype local isglyph = nuts.isglyph local setcolor = nodes.tracers.colors.set @@ -60,10 +62,12 @@ local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes local glyph_code = nodecodes.glyph +local glue_code = nodecodes.glue local spaceskip_code = gluecodes.spaceskip local chardata = characters.data -local is_punctuation = characters.is_punctuation +local ispunctuation = characters.is_punctuation +local canhavespace = characters.can_have_space local typesetters = typesetters @@ -182,16 +186,28 @@ local methods = { -- maybe also 0x0008 : backspace + [0x001E] = function(head,current) -- kind of special + local next = getnext(current) + head, current = remove_node(head,current,true) + if next and getid(next) == glue_code and getsubtype(next) == spaceskip_code then + local nextnext = getnext(next) + if nextnext then + local char, font = isglyph(nextnext) + if char and not canhavespace[char] then + remove_node(head,next,true) + end + end + end + end, + [0x001F] = function(head,current) -- kind of special local next = getnext(current) if next then local char, font = isglyph(next) - if char then - head, current = remove_node(head,current,true) - if not is_punctuation[char] then - local p = fontparameters[font] - head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink)) - end + head, current = remove_node(head,current,true) + if char and not ispunctuation[char] then + local p = fontparameters[font] + head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink)) end end end, diff --git a/tex/context/base/mkxl/spac-chr.mkxl b/tex/context/base/mkxl/spac-chr.mkxl index 82c8be0ec..a7d339019 100644 --- a/tex/context/base/mkxl/spac-chr.mkxl +++ b/tex/context/base/mkxl/spac-chr.mkxl @@ -66,7 +66,8 @@ \popoverloadmode -\immutable\chardef\optionalspace"1F % will be space unless before punctuation +\immutable\chardef\optionalspace "1F % will be space unless before punctuation +\immutable\chardef\autoinsertedspace"1E % a more clever \autoinsertspace % Shortcuts: diff --git a/tex/context/base/mkxl/spac-hor.lmt b/tex/context/base/mkxl/spac-hor.lmt index d32684448..a4a8f0ade 100644 --- a/tex/context/base/mkxl/spac-hor.lmt +++ b/tex/context/base/mkxl/spac-hor.lmt @@ -10,24 +10,14 @@ local chardata = characters.data local peekchar = tokens.scanners.peekchar local ctx_space = context.space -local can_have_space = table.tohash { - "lu", "ll", "lt", "lm", "lo", -- letters - -- "mn", "mc", "me", -- marks - "nd", "nl", "no", -- numbers - "ps", "pi", -- initial - -- "pe", "pf", -- final - -- "pc", "pd", "po", -- punctuation - "sm", "sc", "sk", "so", -- symbols - -- "zs", "zl", "zp", -- separators - -- "cc", "cf", "cs", "co", "cn", -- others -} +local can_have_space = characters.can_have_space interfaces.implement { name = "autoinsertnextspace", protected = true, public = true, actions = function() - local char = peekchar() + local char = peekchar() -- nil means space command if char then local d = chardata[char] if d and can_have_space[d.category] then diff --git a/tex/context/base/mkxl/spac-hor.mkxl b/tex/context/base/mkxl/spac-hor.mkxl index c4c806a40..4c153931b 100644 --- a/tex/context/base/mkxl/spac-hor.mkxl +++ b/tex/context/base/mkxl/spac-hor.mkxl @@ -1073,6 +1073,8 @@ \definehspace[2] [.2222\emwidth] % med \definehspace[3] [.2777\emwidth] % thick +% These will be redefined anyway in math-ini: + \suggestedalias \, \thinspace \suggestedalias \: \medspace \suggestedalias \; \thickspace diff --git a/tex/context/base/mkxl/strc-mat.mkxl b/tex/context/base/mkxl/strc-mat.mkxl index 71676c9ec..90321a627 100644 --- a/tex/context/base/mkxl/strc-mat.mkxl +++ b/tex/context/base/mkxl/strc-mat.mkxl @@ -2010,6 +2010,20 @@ \fi \to \everysetupformula +%D Also new, handy for articles and manuals: + +% \starttext +% \showmakeup[line] +% \input tufte \startformula e = mc^2 \stopformula +% \input tufte \startformula[bodyfont=10pt] e = mc^2 \stopformula +% \input tufte \startformula[bodyfont=24pt] e = mc^2 \stopformula +% \input tufte +% \stoptext + +\prependtoks + \usebodyfontparameter\formulaparameter +\to \everymathematics + \protect \endinput % \abovedisplayshortskip0pt \belowdisplayshortskip0pt \abovedisplayskip0pt \belowdisplayskip0pt \forgetall diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl index 851984bea..91ee0262a 100644 --- a/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/tex/context/base/mkxl/tabl-tbl.mkxl @@ -3060,6 +3060,9 @@ %D \stoptabulate %D \stoptyping +% Not okay yet as we loose alignment in later columns .. weird .. do +% we miss a tab? + \installcorenamespace{tabulatespanb} \installcorenamespace{tabulatespana} @@ -3076,7 +3079,9 @@ \noaligned\tolerant\def\tabl_tabulate_NS[#1]#*[#2]% {\NC\loopcs{#1}\tabl_tabulate_span - \gdef\tabl_tabulate_kooh{\begincsname\??tabulatespana#2\endcsname}% + \gdef\tabl_tabulate_kooh + {\begincsname\??tabulatespana#2\endcsname + \glet\tabl_tabulate_kooh\relax}% \begincsname\??tabulatespanb#2\endcsname \ignorepars} % \ignorespaces diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt index e2c79022a..09c0e020c 100644 --- a/tex/context/base/mkxl/trac-vis.lmt +++ b/tex/context/base/mkxl/trac-vis.lmt @@ -41,6 +41,7 @@ local setattr = nuts.setattr local setwidth = nuts.setwidth local setshift = nuts.setshift local setoffsets = nuts.setoffsets +local getglyphdimensions = nuts.getglyphdimensions local getid = nuts.getid local getfont = nuts.getfont @@ -922,22 +923,27 @@ local ruledglyph do -- local ligature_code = 0x8000 + nodes.glyphcodes.ligature ruledglyph = function(head,current,previous) -- wrong for vertical glyphs - local wd = getwidth(current) + local wd, ht, dp = getglyphdimensions(current) if wd ~= 0 then - local wd, ht, dp = getwhd(current) local next = getnext(current) local prev = previous setboth(current) local linewidth = emwidth/(2*fraction) local x_offset, y_offset, l_margin, r_margin, raise = getoffsets(current) - local info = setlink((dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule { - width = wd, - height = ht, - depth = dp, - line = linewidth, - type = "box", - },new_kern(-wd)) - -- if getsubtype(n) == ligature_code then +-- local info = setlink((dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule { +-- width = wd, +-- height = ht, +-- depth = dp, +-- line = linewidth, +-- type = "box", +-- },new_kern(-wd)) +local info = (dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule { + width = wd, + height = ht, + depth = dp, + line = linewidth, + type = "box", +} local c, f = isglyph(current) local char = chardata[f][c] if char and type(char.unicode) == "table" then -- hackery test diff --git a/tex/context/base/mkxl/type-imp-euler.mkxl b/tex/context/base/mkxl/type-imp-euler.mkxl index c0a3f73f6..a2e066f6b 100644 --- a/tex/context/base/mkxl/type-imp-euler.mkxl +++ b/tex/context/base/mkxl/type-imp-euler.mkxl @@ -11,6 +11,10 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% Instead of euler.otf we now use euler-math.otf which is a copy of the version +% that Daniel Flipo maintains now. We will also make an euler-regular.otf for +% text usage (which might have slighty different metrics then). + \loadtypescriptfile[texgyre] \loadtypescriptfile[dejavu] @@ -21,11 +25,11 @@ \starttypescript [\s!serif] [eulernova] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [\s!file:euler.otf] [\s!features=\s!default] + \definefontsynonym [\s!Serif] [\s!file:euler-math.otf] [\s!features=\s!default] \stoptypescript \starttypescript [\s!math] [eulernova] [\s!name] - \definefontsynonym [\s!MathRoman] [\s!file:euler.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=euler-math] + \definefontsynonym [\s!MathRoman] [\s!file:euler-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=euler-math] \stoptypescript \starttypescript [pagella-eulernova] @@ -47,7 +51,7 @@ \stoptypescript \starttypescript [\s!math] [pagellaovereuler] [\s!name] - \definefontsynonym [\s!MathRoman] [\s!file:euler.otf] [\s!features={\s!math\mathsizesuffix,pagellaovereuler,mathextra},\s!fallbacks=pagellaovereuler,\s!goodies=euler-math] + \definefontsynonym [\s!MathRoman] [\s!file:euler-math.otf] [\s!features={\s!math\mathsizesuffix,pagellaovereuler,mathextra},\s!fallbacks=pagellaovereuler,\s!goodies=euler-math] \stoptypescript \starttypescript [pagella-with-euler,euleroverpagella] diff --git a/tex/context/base/mkxl/type-set.mkxl b/tex/context/base/mkxl/type-set.mkxl index ae07bd914..7eec5cc60 100644 --- a/tex/context/base/mkxl/type-set.mkxl +++ b/tex/context/base/mkxl/type-set.mkxl @@ -31,7 +31,7 @@ \loadfoundtypescriptfile\empty{type-lua.mkxl} \loadfoundtypescriptfile\empty{type-siz.mkxl} \loadfoundtypescriptfile\empty{type-fbk.mkxl} - \loadfoundtypescriptfile\empty{type-imp-latinmodern.mkiv} + \loadfoundtypescriptfile\empty{type-imp-latinmodern.mkiv} % maybe no longer % and not: @@ -54,19 +54,19 @@ \usetypescriptfile[fbk] \usetypescriptfile[lua] \usetypescriptfile[siz] - \usetypescriptfile[latinmodern] + \usetypescriptfile[latinmodern] % maybe no longer \usetypescriptfile[loc] \fi +\definefilesynonym [type-imp-modern.mkiv] [type-imp-latinmodern.mkiv] \definefilesynonym [type-imp-latin-modern.mkiv] [type-imp-latinmodern.mkiv] \definefilesynonym [type-imp-modern-latin.mkiv] [type-imp-modernlatin.mkiv] \definefilesynonym [type-imp-less-modern-latin.mkiv] [type-imp-modernlatin.mkiv] -%definefilesynonym [type-imp-lucida.mkiv] [type-imp-lucida-typeone.mkiv] -\definefilesynonym [type-imp-lucida.mkiv] [type-imp-lucida-opentype.mkiv] -\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida-opentype.mkiv] -\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida-opentype.mkiv] +\definefilesynonym [type-imp-lucida-opentype.mkiv] [type-imp-lucida.mkiv] +\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida.mkiv] +\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida.mkiv] \definefilesynonym [type-imp-dejavu-condensed.mkiv] [type-imp-dejavu.mkiv] @@ -148,4 +148,24 @@ \definefilesynonym [type-imp-gentiumplus.mkiv] [type-imp-gentium.mkiv] \definefilesynonym [type-imp-gentiumbook.mkiv] [type-imp-gentium.mkiv] +%D These \type {*-nt} variants come in handy when we want top compare with non-tweaked math. + +\definefilesynonym [type-imp-bonum-nt.mkiv] [type-imp-texgyre.mkiv] +\definefilesynonym [type-imp-schola-nt.mkiv] [type-imp-texgyre.mkiv] +\definefilesynonym [type-imp-pagella-nt.mkiv] [type-imp-texgyre.mkiv] +\definefilesynonym [type-imp-termes-nt.mkiv] [type-imp-texgyre.mkiv] +\definefilesynonym [type-imp-dejavu-nt.mkiv] [type-imp-dejavu.mkiv] +\definefilesynonym [type-imp-cambria-nt.mkiv] [type-imp-cambria.mkiv] +\definefilesynonym [type-imp-lucidaot-nt.mkiv] [type-imp-lucida-opentype.mkiv] +\definefilesynonym [type-imp-lucida-nt.mkiv] [type-imp-lucida-opentype.mkiv] +\definefilesynonym [type-imp-modern-nt.mkiv] [type-imp-latinmodern.mkiv] +\definefilesynonym [type-imp-stix-nt.mkiv] [type-imp-stix.mkiv] +\definefilesynonym [type-imp-stixtwo-nt.mkiv] [type-imp-stix.mkiv] +\definefilesynonym [type-imp-libertinus-nt.mkiv] [type-imp-libertinus.mkiv] +\definefilesynonym [type-imp-ebgaramond-nt.mkiv] [type-imp-ebgaramond.mkiv] +\definefilesynonym [type-imp-erewhon-nt.mkiv] [type-imp-erewhon.mkiv] +\definefilesynonym [type-imp-kpfonts-nt.mkiv] [type-imp-kpfonts.mkiv] +\definefilesynonym [type-imp-concrete-nt.mkiv] [type-imp-concrete.mkiv] +\definefilesynonym [type-imp-xcharter-nt.mkiv] [type-imp-xcharter.mkiv] + \protect \endinput diff --git a/tex/context/base/mkxl/typo-chr.lmt b/tex/context/base/mkxl/typo-chr.lmt index 745a35a14..160981ab7 100644 --- a/tex/context/base/mkxl/typo-chr.lmt +++ b/tex/context/base/mkxl/typo-chr.lmt @@ -31,7 +31,7 @@ local flushnode = nodes.flushnode local flushlist = nodes.flushlist local settexattribute = tex.setattribute -local punctuation = characters.is_punctuation +local ispunctuation = characters.is_punctuation local variables = interfaces.variables local v_all = variables.all @@ -51,7 +51,7 @@ local function pickup() local list = texgetnest() if list then local tail = list.tail - if tail and tail.id == glyph_code and punctuation[tail.char] then + if tail and tail.id == glyph_code and ispunctuation[tail.char] then local prev = tail.prev list.tail = prev if prev then diff --git a/tex/context/base/mkxl/typo-itc.lmt b/tex/context/base/mkxl/typo-itc.lmt index f0b6980f4..c26d4a824 100644 --- a/tex/context/base/mkxl/typo-itc.lmt +++ b/tex/context/base/mkxl/typo-itc.lmt @@ -72,7 +72,7 @@ local italicsdata = fonthashes.italics local exheights = fonthashes.exheights local chardata = fonthashes.characters -local is_punctuation = characters.is_punctuation +local ispunctuation = characters.is_punctuation local implement = interfaces.implement @@ -217,7 +217,7 @@ local function domath(head,current) if glyph and getid(glyph) == glyph_code then -- [math: ] : we remove the correction when we have -- punctuation - if is_punctuation[char] then + if ispunctuation[char] then local a = getattr(glyph,a_mathitalics) if a then local i = getkern(kern) @@ -257,7 +257,7 @@ local function domath(head,current) -- if glyph and getid(glyph) == glyph_code then -- -- [math: ] : we add the correction when we have -- -- no punctuation - -- if not is_punctuation[char] then + -- if not ispunctuation[char] then -- local a = getattr(glyph,a_mathitalics) -- if a and (a < 100 or a > 100) then -- if a > 100 then diff --git a/tex/context/fonts/mkiv/asana-math.lfg b/tex/context/fonts/mkiv/asana-math.lfg deleted file mode 100644 index 970d031ea..000000000 --- a/tex/context/fonts/mkiv/asana-math.lfg +++ /dev/null @@ -1,107 +0,0 @@ -local common = fonts.goodies.load("common-math.lfg") -local presets = common.mathematics.tweaks.presets - -return { - name = "asana-math", - version = "1.00", - comment = "Goodies that complement asana.", - author = "Hans Hagen & Mikael Sundqvist", - copyright = "ConTeXt development team", - mathematics = { - parameters = { - -- StackBottomDisplayStyleShiftDown = less, - -- StackBottomShiftDown = less, - -- StackDisplayStyleGapMin = less, - -- StackGapMin = less, - -- StackTopDisplayStyleShiftUp = less, - -- StackTopShiftUp = less, - -- StretchStackBottomShiftDown = less, - -- StretchStackGapAboveMin = less, - -- StretchStackGapBelowMin = less, - -- StretchStackTopShiftUp = less, - NoLimitSupFactor = 200, - NoLimitSubFactor = 1200, - AccentBaseDepth = 300, - RadicalDegreeBottomRaisePercent = 70, - RadicalRuleThickness = 66, -- 59 in font - DelimiterPercent = 90, - DelimiterShortfall = 400, - DisplayOperatorMinHeight = 1800, -- 1250 in font - }, - tweaks = { - aftercopying = { - { - tweak = "version", - expected = "Version 000.958", - message = "this font is not supported", - }, - { - tweak = "addmirrors", - }, - presets.scripttocalligraphic { }, - presets.rsfstoscript { }, - presets.rsfsuprighttoscript { }, - presets.moderntocalligraphic { }, - presets.eulertocalligraphic { }, - presets.xitsarabic { }, - presets.fallbacks { }, - presets.moveitalics { correct = true }, - presets.moveitalics { correct = true, letters = true }, - presets.moveintegrals { factor = 2 }, - presets.wipeitalics { }, - { - tweak = "dimensions", - list = { - -- nothing yet - } - }, - -- { - -- tweak = "kerns", - -- list = { - -- [0x2F] = { - -- topleft = -0.2, - -- bottomleft = 0, - -- topright = 0, - -- bottomright = -0.2, - -- }, - -- }, - -- }, - -- { - -- tweak = "fixprimes", - -- factor = 0.85, - -- scale = 0.65, - -- smaller = true, - -- }, - { - tweak = "checkspacing", - }, - { - tweak = "addscripts", - }, - { - tweak = "accentdimensions", - }, - { - tweak = "addrules", - }, - { - tweak = "fixellipses", - }, - { - tweak = "setoptions", - set = { "ignorekerndimensions" } - }, - -- this is the mkiv section - { - tweak = "emulatelmtx", - feature = "emulatelmtx", - comment = "this is for mkiv", - }, - }, - }, - bigslots = { - 1, 2, 3, 4 - }, - } -} - diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index e5d764aff..cc7ae23dc 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -2,8 +2,8 @@ local common = fonts.goodies.load("common-math.lfg") local presets = common.mathematics.tweaks.presets local integral_variants = { bottomright = -0.20 } -local integral_top = { topright = 0.05 } -local integral_bottom = { bottomright = -0.30 } +local integral_top = { topright = 0 } +local integral_bottom = { bottomright = -0.10 } -- if too big it looks bad with triple integrals return { name = "bonum-math", @@ -13,14 +13,14 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, AccentTopShiftUp = -15, FlattenedAccentTopShiftUp = -15, -- AccentExtendMargin = 50, AccentBaseDepth = 50, - RadicalDegreeBottomRaisePercent = 60, - RadicalRuleThickness = 66, -- 72 in font + -- RadicalDegreeBottomRaisePercent = 60, +-- RadicalRuleThickness = 66, -- 72 in font DelimiterPercent = 90, DelimiterShortfall = 400, DisplayOperatorMinHeight = 1900, -- 1250 in font @@ -131,15 +131,19 @@ return { [0x27EB] = { topright = -0.1, bottomright = -0.1 }, ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- - [0x222B] = integral_variants, ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - [0x222C] = integral_variants, ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - [0x222D] = integral_variants, ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - [0x222E] = integral_variants, ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - [0x222F] = integral_variants, ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - [0x2230] = integral_variants, ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - [0x2231] = integral_variants, ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - [0x2232] = integral_variants, ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - [0x2233] = integral_variants, ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + -- [0x222B] = integral_variants, ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, + ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int + ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint + ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint + ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint + -- [0x222C] = integral_variants, ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, + -- [0x222D] = integral_variants, ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- [0x222E] = integral_variants, ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- [0x222F] = integral_variants, ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- [0x2230] = integral_variants, ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- [0x2231] = integral_variants, ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- [0x2232] = integral_variants, ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- [0x2233] = integral_variants, ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, }, }, -- Accents are a mess. We migrate the extensibles from the combiners to the base accent @@ -148,6 +152,30 @@ return { { tweak = "extendaccents", }, +{ + tweak = "flattenaccents", + squeeze = 0.8, + height = 0.9, + offset = 0.1, +}, + +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = .1, vfactor = .3 }, + ["0x221A.variants.*"] = { location = "left", hfactor = .1, vfactor = .625 }, + ["0x221A.variants.1"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .1, vfactor = 1.15 }, + } +}, + { tweak = "fixaccents", }, diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg index 9cece8369..8feb94bcf 100644 --- a/tex/context/fonts/mkiv/cambria-math.lfg +++ b/tex/context/fonts/mkiv/cambria-math.lfg @@ -9,15 +9,15 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 1000, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 1000, -- AccentTopShiftUp = 0, -- FlattenedAccentTopShiftUp = 0, -- AccentExtendMargin = 50, AccentBaseDepth = 300, - RadicalDegreeBottomRaisePercent = 65, - RadicalKernAfterDegree = -900, - RadicalRuleThickness = 128, -- 133 in font + -- RadicalDegreeBottomRaisePercent = 65, + -- RadicalKernAfterDegree = -900, + -- RadicalRuleThickness = 128, -- 133 in font DelimiterPercent = 90, DelimiterShortfall = 400, DisplayOperatorMinHeight = 2800, -- 2500 in font @@ -76,6 +76,7 @@ return { }, -- Keep as example. not needed in cambria (after all it is the reference): + [0x2A0C] = { bottomright = -0.1 }, -- iiiint does not have any ic -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, -- ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, @@ -95,6 +96,22 @@ return { { tweak = "extendaccents", }, +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = -0.15, vfactor = .75 }, + ["0x221A.variants.*"] = { location = "left", hfactor = -0.1, vfactor = .15 }, + ["0x221A.variants.1"] = { location = "left", hfactor = -0.1, vfactor = .55 }, + ["0x221A.variants.2"] = { location = "left", hfactor = -0.1, vfactor = .375 }, + ["0x221A.variants.3"] = { location = "left", hfactor = -0.1, vfactor = .275 }, + ["0x221A.variants.4"] = { location = "left", hfactor = -0.1, vfactor = .22 }, + ["0x221A.variants.5"] = { location = "left", hfactor = -0.1, vfactor = .175 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = -0.1, vfactor = 0.95 }, + } +}, { tweak = "fixaccents", }, @@ -182,6 +199,9 @@ return { { tweak = "addactuarian", }, + { + tweak = "addequals", + }, { tweak = "addfourier", variant = 1, diff --git a/tex/context/fonts/mkiv/common-math.lfg b/tex/context/fonts/mkiv/common-math.lfg index c2c690bf1..85915c26a 100644 --- a/tex/context/fonts/mkiv/common-math.lfg +++ b/tex/context/fonts/mkiv/common-math.lfg @@ -56,13 +56,13 @@ return { { source = "uppercasescript", target = "uppercasecalligraphic", - filename = "euler.otf", + filename = "euler-math.otf", rscale = parameters.rscale, }, { source = "uppercaseboldscript", target = "uppercaseboldcalligraphic", - filename = "euler.otf", + filename = "euler-math.otf", rscale = parameters.rscale, }, }, diff --git a/tex/context/fonts/mkiv/concrete-math.lfg b/tex/context/fonts/mkiv/concrete-math.lfg index 68d686593..31ee4f1b9 100644 --- a/tex/context/fonts/mkiv/concrete-math.lfg +++ b/tex/context/fonts/mkiv/concrete-math.lfg @@ -9,8 +9,8 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, DelimiterPercent = 90, DelimiterShortfall = 400, -- DisplayOperatorMinHeight = 1800, -- 1400 in font (one size) @@ -19,12 +19,15 @@ return { aftercopying = { { tweak = "fixprimes", - factor = 0.9, + factor = 0.8, }, -- there are circular variants -- { -- tweak = "addmirrors", -- }, +{ + tweak = "fixintegrals", +}, presets.scripttocalligraphic { }, presets.rsfstoscript { }, presets.rsfsuprighttoscript { }, @@ -41,6 +44,23 @@ return { [0x002F] = { topleft = -0.2, bottomright = -0.2 }, }, }, + +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = .1, vfactor = .3 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = .1, vfactor = .625 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.075 }, + } +}, { tweak = "fixellipses", }, diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg index 70eecb27e..728a5f2fc 100644 --- a/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/tex/context/fonts/mkiv/dejavu-math.lfg @@ -1,8 +1,8 @@ local common = fonts.goodies.load("common-math.lfg") local presets = common.mathematics.tweaks.presets -local integral_variants = { bottomright = -0.20 } -local integral_bottom = { bottomright = -0.25 } +local integral_variants = { bottomright = -0.20 } +local integral_bottom = { bottomright = -0.25 } return { name = "dejavu-math", @@ -12,15 +12,15 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, FractionRuleThickness = 60, AccentTopShiftUp = -25, FlattenedAccentTopShiftUp = -25, -- AccentExtendMargin = 50, AccentBaseDepth = 30, - RadicalDegreeBottomRaisePercent = 62, - RadicalRuleThickness = 46, -- 52 in font + -- RadicalDegreeBottomRaisePercent = 62, + -- RadicalRuleThickness = 46, -- 52 in font DelimiterPercent = 90, DelimiterShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1333 in font @@ -33,11 +33,17 @@ return { tweak = "version", expected = "Version 1.106", }, - { +-- { +-- tweak = "fixprimes", +-- scale = 0.85, +-- -- smaller = true, +-- factor = 1, +-- }, + { tweak = "fixprimes", - scale = 0.85, + scale = 1, -- smaller = true, - factor = 1, + factor = 0.8, }, { tweak = "addmirrors", @@ -53,6 +59,18 @@ return { presets.moveitalics { correct = true, letters = true }, presets.moveintegrals { factor = 1.5 }, -- we need to check this presets.wipeitalics { }, + -- We don't have italic correction in for instance math italic f which means that + -- we also didn't fix it. Therefore we need at least some reasonable kerns. Using + -- a dimension tweak before the above (e.g. 0.2 italic and 0.8 width) doesn't work + -- because once the advance is set the move is blocked and the ic stil wiped. So, + -- we kern. Actually the upright (ascii) f has italic correction. + { + tweak = "kerns", + list = { + [0x1D453] = { bottomright = -.2 }, + } + }, + -- { tweak = "kerns", list = { @@ -71,15 +89,20 @@ return { [0x27EB] = { topright = -0.1, bottomright = -0.1 }, ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- - ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + + ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int + ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint + ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint + ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint + -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, + -- ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, + -- ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, }, }, @@ -89,6 +112,24 @@ return { { tweak = "extendaccents", }, + + +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = .1, vfactor = .65 }, + ["0x221A.variants.*"] = { location = "left", hfactor = .1, vfactor = .6 }, + ["0x221A.variants.1"] = { location = "left", hfactor = .1, vfactor = .65 }, + ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .1, vfactor = 1.1 }, + } +}, { tweak = "fixaccents", }, @@ -127,12 +168,6 @@ return { { tweak = "copyaccents", }, - { - tweak = "fixprimes", - -- scale = 0.9, - -- smaller = true, - factor = 0.8, - }, { tweak = "checkspacing", }, @@ -176,11 +211,11 @@ return { bigslots = { 1, 3, 5, 7 }, - -- - -- experimental fixes for mkiv: - -- - dimensions = dimensions, - kerns = kerns, + -- -- + -- -- experimental fixes for mkiv: + -- -- + -- dimensions = dimensions, + -- kerns = kerns, }, } diff --git a/tex/context/fonts/mkiv/ebgaramond-math.lfg b/tex/context/fonts/mkiv/ebgaramond-math.lfg new file mode 100644 index 000000000..555b79bc1 --- /dev/null +++ b/tex/context/fonts/mkiv/ebgaramond-math.lfg @@ -0,0 +1,336 @@ +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +return { + name = "ebgaramond", + version = "1.00", + comment = "Goodies that complement ebgaramond.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + parameters = { + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 1200, + FractionRuleThickness = 60, + OverbarRuleThickness = 60, + UnderbarRuleThickness = 60, + AccentTopShiftUp = -75, + FlattenedAccentTopShiftUp = -75, + -- AccentExtendMargin = 50, + -- AccentBaseHeight = 0, + AccentBaseDepth = 75, + -- RadicalRuleThickness = 50, -- 50 in font + DelimiterPercent = 90, + DelimiterShortfall = 400, + -- DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) + PrimeRaisePercent = 85, -- 50 default + -- PrimeRaiseComposedPercent = 25, -- 25 default + }, + tweaks = { + aftercopying = { + { + tweak = "version", + expected = "Version 2019-08-16", + }, + { + tweak = "fixprimes", + scale = 0.95, + -- smaller = true, + factor = 0.95, + -- fake = 0.75, + }, + { + tweak = "addmirrors", + }, + presets.scripttocalligraphic { }, + presets.rsfstoscript { rscale = 0.95 }, + presets.rsfsuprighttoscript { rscale = 0.95 }, + presets.moderntocalligraphic { rscale = 0.95 }, + presets.eulertocalligraphic { rscale = 0.95 }, + presets.xitsarabic { rscale = 0.80 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { factor = 1.5 }, + presets.wipeitalics { }, + { + tweak = "simplifykerns", + }, + { + tweak = "topanchors", + list = { + [0x1D453] = 0.88, -- italic f + }, + }, + { + tweak = "dimensions", + list = { + -- for older entries, see bottom of file + [0x1D453] = { width = 1.1 }, -- italic f + }, + }, + { + tweak = "kerns", + list = { + [0x002F] = { topleft = -0.2, bottomright = -0.2 }, + ["0x7D.parts.top"] = { topright = -0.15, }, -- right brace top + ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom + ["0x7D.variants.*"] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants + ["0x29.parts.top"] = { topright = -0.25, }, -- right parenthesis top + ["0x29.parts.bottom"] = { bottomright = -0.25 }, -- right parenthesis bottom + ["0x29.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants + ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top + ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants -- angle + [0x27E9] = { topright = -0.1, bottomright = -0.1 }, + ["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 }, + [0x27EB] = { topright = -0.1, bottomright = -0.1 }, + ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, + }, + }, + { + -- to be considered + -- tweak = "kernpairs", + list = { + [mathematics.tweaks.subsets.gjqy] = { + [mathematics.tweaks.subsets.f] = -.1, + [0x1D70C] = -.1, -- italic \rho + }, + [mathematics.tweaks.subsets.bhklt] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + [mathematics.tweaks.subsets.d] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + [mathematics.tweaks.subsets.f] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + [mathematics.tweaks.subsets.gjqy] = -.25, + [mathematics.tweaks.subsets.bhklt] = -.1, + [mathematics.tweaks.subsets.d] = -.25, + [mathematics.tweaks.subsets.i] = -.25, + [mathematics.tweaks.subsets.mw] = -.25, + [mathematics.tweaks.subsets.p] = -.25, + [mathematics.tweaks.subsets.acenorsuvxz] = -.25, + [mathematics.tweaks.subsets.dotless] = -.25, + }, + [mathematics.tweaks.subsets.i] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + [mathematics.tweaks.subsets.mw] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + [mathematics.tweaks.subsets.p] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + [mathematics.tweaks.subsets.acenorsuvxz] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + [mathematics.tweaks.subsets.dotless] = { + [mathematics.tweaks.subsets.f] = -.25, + [0x1D70C] = -.25, -- italic \rho + }, + -- ["uppercaseitalic"] = { + -- [mathematics.tweaks.subsets.f] = -.25, + -- [0x1D70C] = -.25, -- italic \rho + -- }, + }, + }, + -- Accents are a mess. We migrate the extensibles from the combiners to the base accent + -- and then need to tweak the width (which is auto set because it was zero with a large + -- accent anchor offset). First we copy and fix. + { + tweak = "extendaccents", + -- all = true, +-- all = 5, + }, +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = .1, vfactor = .3 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = .1, vfactor = .625 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.0 }, + } +}, + -- { + -- tweak = "fixanchors", + -- }, + -- First we set the dimensions of the initial accent which started out as zero but we want + -- a proper width. + { + tweak = "dimensions", + list = { + -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + }, + }, + -- Then we deal with all offsets and heights in one go. So we treat the initial accent + -- as well as the variants here. + { + tweak = "dimensions", + list = { + -- here we want to apply to all + -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 + -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 + -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 + -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC + -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 + -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA + -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 + + -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF + + -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 + -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 + -- [0x020DB] = { yoffset = -0.015, height = .95, all = true }, -- widedddot : 0x20DB (self) + }, + }, + -- We now copy these to the not wide slots so that we can set these to stretch as well, + -- if only because it is less confusing and more consistent. + { + tweak = "copyaccents", + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + { + tweak = "accentdimensions", + }, + { + tweak = "addrules", + }, + { + tweak = "addbars", + advance = 0.6, + }, + { + tweak = "addactuarian", + }, + { + tweak = "addequals", + }, + { + tweak = "addfourier", + variant = 1, + }, + -- this is the mkiv section + { + tweak = "emulatelmtx", + feature = "emulatelmtx", + comment = "this is for mkiv", + }, + { + tweak = "diagnose", + }, + }, + }, + alternates = { + partial = { feature = 'ss02', value = 1, comment = "Curved partial" }, + semibold = { feature = 'ss04', value = 1, comment = "Semibold" }, + extrabold = { feature = 'ss05', value = 1, comment = "Extrabold" }, + hbar = { feature = 'ss06', value = 1, comment = "Horizontal bar for h-bar" }, + integral = { feature = 'ss07', value = 1, comment = "A more slanted integral sign" }, + tilde = { feature = 'ss09', value = 1, comment = "A tilde variant" }, + outbendingh = { feature = 'ss10', value = 1, comment = "Out-bending h" }, + largeoperators = { feature = 'ss11', value = 1, comment = "Larger operators" }, + }, + bigslots = { + 1, 3, 5, 7 + }, + }, +} + +-- For now we keep these commented as they show where we came from. + +-- { +-- tweak = "dimensions", +-- list = { +-- -- offset width italic +-- -- -- [0x00060] = { yoffset = -0.1 }, -- grave +-- -- -- [0x000B4] = { yoffset = -0.1 }, -- acute +-- -- [0x002C6] = { yoffset = -0.1 }, -- hat +-- -- [0x002DC] = { yoffset = -0.1 }, -- tilde +-- -- -- [0x000AF] = { yoffset = -0.1 }, -- bar +-- -- [0x002D8] = { yoffset = -0.15 }, -- breve +-- -- [0x002D9] = { yoffset = -0.15 }, -- dot +-- -- -- [0x000A8] = { yoffset = -0.1 }, -- ddot +-- -- [0x020DB] = { yoffset = -0.115 }, -- dddot +-- -- [0x002C7] = { yoffset = -0.1 }, -- check +-- -- [0x020D7] = { yoffset = -0.1 }, -- vec + +-- -- [0x00300] = { yoffset = -0.12 , all = true }, -- widegrave +-- -- [0x00301] = { yoffset = -0.12 , all = true }, -- wideacute +-- -- [0x00302] = { yoffset = -0.12 , all = true }, -- widehat +-- -- [0x00303] = { yoffset = -0.12 , all = true }, -- widetilde +-- -- [0x00304] = { yoffset = -0.12 , all = true }, -- widebar +-- -- [0x00306] = { yoffset = -0.12 , all = true }, -- widebreve +-- -- [0x00307] = { yoffset = -0.12 , all = true }, -- widedot +-- -- [0x00308] = { yoffset = -0.12 , all = true }, -- wideddot +-- -- -- [0x020DB] = { yoffset = -0.1 , all = true }, -- widedddot +-- -- [0x0030A] = { yoffset = -0.12 , all = true }, -- widering +-- -- [0x0030C] = { yoffset = -0.12 , all = true }, -- widecheck + +-- -- [0x002C6] = { scale =.85, yoffset = .1, width = .85, height = .935 }, -- hat +-- [0x00393] = { xoffset = 0.05, width = 1.05, italic = 0.075 }, -- \Gamma +-- -- [0x003A6] = { xoffset = 0.05, width = 1.05, italic = 0 }, -- \Phi difficult! +-- [0x003A8] = { xoffset = 0.05, width = 1.05, italic = 0.075 }, -- \Psi +-- [0x02113] = { width = 1, italic = 0.075 }, -- \ell +-- [0x1D436] = { width = 1, italic = 0.05 }, -- C +-- [0x1D43D] = { xoffset = 0.3, width = 1.4, italic = 0.1 }, -- J +-- [0x1D44B] = { width = 1, italic = 0.05 }, -- X +-- [0x1D44F] = { width = 1, italic = 0, }, -- b +-- [0x1D450] = { width = 1.1, italic = 0 }, -- c +-- [0x1D451] = { width = 1, italic = 0.05, }, -- d +-- [0x1D452] = { width = 1.1, italic = 0.05 }, -- e +-- [0x00066] = { width = 1.4, italic = 0.0, }, -- f +-- [0x1D453] = { xoffset = 0.15, width = 1.15, italic = 0.1, }, -- f +-- [0x1D454] = { xoffset = 0.1, width = 1.2, italic = 0.1 }, -- g +-- [0x0210E] = { width = 1.1, italic = 0, }, -- h +-- [0x1D457] = { xoffset = 0.2, width = 1.25, italic = 0.05 }, -- j +-- [0x1D458] = { width = 1, italic = 0, }, -- k +-- [0x1D459] = { width = 1, italic = 0.05 }, -- l +-- [0x1D45D] = { xoffset = 0.15, width = 1.15, italic = 0, }, -- p +-- [0x1D45E] = { width = 1.05, italic = 0 }, -- q +-- [0x1D45F] = { width = 1.05, italic = 0 }, -- r +-- [0x1D461] = { width = 1, italic = 0.1 }, -- t +-- [0x1D465] = { xoffset = 0.05, width = 1.1, italic = 0.05 }, -- x +-- [0x1D466] = { xoffset = 0.2, width = 1.2, italic = 0, }, -- y +-- [0x1D6FD] = { xoffset = 0.05, width = 1.1, italic = 0.05 }, -- \beta +-- [0x1D6FE] = { width = 1.05, italic = 0 }, -- \gamma +-- [0x1D6FF] = { width = 1, italic = 0.1 }, -- \delta +-- [0x1D716] = { width = 1.1, italic = 0 }, -- \epsilon +-- [0x1D700] = { width = 1.1, italic = 0 }, -- \varepsilon +-- [0x1D701] = { width = 1, italic = 0.15 }, -- \zeta +-- [0x1D703] = { width = 1, italic = 0.1 }, -- \theta +-- [0x1D705] = { width = 1, italic = 0.1 }, -- \kappa +-- [0x1D706] = { xoffset = 0.05, width = 1.1, italic = 0 }, -- \lambda +-- [0x1D707] = { xoffset = 0.05, width = 1.05, italic = 0 }, -- \mu +-- [0x1D708] = { width = 1.1, italic = 0 }, -- \nu +-- [0x1D709] = { width = 1.1, italic = 0 }, -- \xi +-- [0x1D70B] = { width = 1.05, italic = 0 }, -- \pi +-- [0x1D70C] = { xoffset = 0.2, width = 1.2, italic = 0 }, -- \rho +-- [0x1D70E] = { width = 1, italic = 0.1 }, -- \sigma +-- [0x1D70F] = { xoffset = 0.05, width = 1.05, italic = 0.1 }, -- \tau +-- [0x1D712] = { xoffset = 0.15, width = 1.2, italic = 0.05 }, -- \chi +-- [0x1D713] = { xoffset = 0.05, width = 1.05, italic = 0.05 }, -- \psi +-- }, +-- }, diff --git a/tex/context/fonts/mkiv/erewhon-math.lfg b/tex/context/fonts/mkiv/erewhon-math.lfg index e366ee12e..89b788b3f 100644 --- a/tex/context/fonts/mkiv/erewhon-math.lfg +++ b/tex/context/fonts/mkiv/erewhon-math.lfg @@ -12,13 +12,13 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, - AccentBaseHeight = 0, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, + -- AccentBaseHeight = 0, AccentBaseDepth = 60, - RadicalDegreeBottomRaisePercent = 55, - RadicalKernAfterDegree = -600, - RadicalRuleThickness = 45, -- 55 in font + -- RadicalDegreeBottomRaisePercent = 55, + -- RadicalKernAfterDegree = -600, + -- RadicalRuleThickness = 45, -- 55 in font DelimiterPercent = 90, DelimiterShortfall = 400, -- DisplayOperatorMinHeight = 1800, -- 1300 in font (one size) @@ -27,12 +27,23 @@ return { aftercopying = { { tweak = "fixprimes", + -- smaller = true, -- replace multiples factor = 0.9, - scale = 0.9, + scale = 1.0, + fake = 0.85, -- replace multiples with this width proportion }, { tweak = "addmirrors", }, +{ + tweak = "dimensions", + list = { + ["0x222B.variants.*"] = { axis = .15 }, + }, +}, +{ + tweak = "fixintegrals", +}, presets.scripttocalligraphic { }, presets.rsfstoscript { }, presets.rsfsuprighttoscript { }, @@ -63,6 +74,23 @@ return { ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, }, }, +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = .1, vfactor = .3 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = .1, vfactor = .625 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .1, vfactor = 1.025 }, + } +}, + { tweak = "checkspacing", }, @@ -83,7 +111,7 @@ return { }, { tweak = "setoptions", - set = { "ignorekerndimensions" } +-- set = { "ignorekerndimensions" } }, -- this is the mkiv section -- { diff --git a/tex/context/fonts/mkiv/garamond-math.lfg b/tex/context/fonts/mkiv/garamond-math.lfg deleted file mode 100644 index 9537f52b9..000000000 --- a/tex/context/fonts/mkiv/garamond-math.lfg +++ /dev/null @@ -1,318 +0,0 @@ -local common = fonts.goodies.load("common-math.lfg") -local presets = common.mathematics.tweaks.presets - -return { - name = "ebgaramond", - version = "1.00", - comment = "Goodies that complement ebgaramond.", - author = "Hans Hagen & Mikael Sundqvist", - copyright = "ConTeXt development team", - mathematics = { - parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 1200, - FractionRuleThickness = 60, - OverbarRuleThickness = 60, - UnderbarRuleThickness = 60, - AccentTopShiftUp = -75, - FlattenedAccentTopShiftUp = -75, - -- AccentExtendMargin = 50, - -- AccentBaseHeight = 0, - AccentBaseDepth = 75, - -- RadicalRuleThickness = 50, -- 50 in font - DelimiterPercent = 90, - DelimiterShortfall = 400, - -- DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) - PrimeRaisePercent = 85, -- 50 default - -- PrimeRaiseComposedPercent = 25, -- 25 default - }, - tweaks = { - aftercopying = { - { - tweak = "version", - expected = "Version 2019-08-16", - }, - { - tweak = "fixprimes", - scale = 0.95, - -- smaller = true, - factor = 0.95, - -- fake = 0.75, - }, - { - tweak = "addmirrors", - }, - presets.scripttocalligraphic { }, - presets.rsfstoscript { rscale = 0.95 }, - presets.rsfsuprighttoscript { rscale = 0.95 }, - presets.moderntocalligraphic { rscale = 0.95 }, - presets.eulertocalligraphic { rscale = 0.95 }, - presets.xitsarabic { rscale = 0.80 }, - presets.fallbacks { }, - presets.moveitalics { correct = true }, - presets.moveitalics { correct = true, letters = true }, - presets.moveintegrals { factor = 1.5 }, - presets.wipeitalics { }, - { - tweak = "simplifykerns", - }, - { - tweak = "topanchors", - list = { - [0x1D453] = 0.88, -- italic f - }, - }, - { - tweak = "dimensions", - list = { - -- for older entries, see bottom of file - [0x1D453] = { width = 1.1 }, -- italic f - }, - }, - { - tweak = "kerns", - list = { - [0x002F] = { topleft = -0.2, bottomright = -0.2 }, - ["0x7D.parts.top"] = { topright = -0.15, }, -- right brace top - ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom - ["0x7D.variants.*"] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants - ["0x29.parts.top"] = { topright = -0.25, }, -- right parenthesis top - ["0x29.parts.bottom"] = { bottomright = -0.25 }, -- right parenthesis bottom - ["0x29.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants - ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top - ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom - ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants -- angle - [0x27E9] = { topright = -0.1, bottomright = -0.1 }, - ["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 }, - [0x27EB] = { topright = -0.1, bottomright = -0.1 }, - ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, - }, - }, - { - -- to be considered - -- tweak = "kernpairs", - list = { - [mathematics.tweaks.subsets.gjqy] = { - [mathematics.tweaks.subsets.f] = -.1, - [0x1D70C] = -.1, -- italic \rho - }, - [mathematics.tweaks.subsets.bhklt] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - [mathematics.tweaks.subsets.d] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - [mathematics.tweaks.subsets.f] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - [mathematics.tweaks.subsets.gjqy] = -.25, - [mathematics.tweaks.subsets.bhklt] = -.1, - [mathematics.tweaks.subsets.d] = -.25, - [mathematics.tweaks.subsets.i] = -.25, - [mathematics.tweaks.subsets.mw] = -.25, - [mathematics.tweaks.subsets.p] = -.25, - [mathematics.tweaks.subsets.acenorsuvxz] = -.25, - [mathematics.tweaks.subsets.dotless] = -.25, - }, - [mathematics.tweaks.subsets.i] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - [mathematics.tweaks.subsets.mw] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - [mathematics.tweaks.subsets.p] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - [mathematics.tweaks.subsets.acenorsuvxz] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - [mathematics.tweaks.subsets.dotless] = { - [mathematics.tweaks.subsets.f] = -.25, - [0x1D70C] = -.25, -- italic \rho - }, - -- ["uppercaseitalic"] = { - -- [mathematics.tweaks.subsets.f] = -.25, - -- [0x1D70C] = -.25, -- italic \rho - -- }, - }, - }, - -- Accents are a mess. We migrate the extensibles from the combiners to the base accent - -- and then need to tweak the width (which is auto set because it was zero with a large - -- accent anchor offset). First we copy and fix. - { - tweak = "extendaccents", - }, - { - tweak = "fixanchors", - }, - -- First we set the dimensions of the initial accent which started out as zero but we want - -- a proper width. - { - tweak = "dimensions", - list = { - -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, - -- Then we deal with all offsets and heights in one go. So we treat the initial accent - -- as well as the variants here. - { - tweak = "dimensions", - list = { - -- here we want to apply to all - -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 - -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 - -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 - -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC - -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 - -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA - -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 - - -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF - - -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 - -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 - -- [0x020DB] = { yoffset = -0.015, height = .95, all = true }, -- widedddot : 0x20DB (self) - }, - }, - -- We now copy these to the not wide slots so that we can set these to stretch as well, - -- if only because it is less confusing and more consistent. - { - tweak = "copyaccents", - }, - { - tweak = "checkspacing", - }, - { - tweak = "addscripts", - }, - { - tweak = "accentdimensions", - }, - { - tweak = "addrules", - }, - { - tweak = "addbars", - advance = 0.6, - }, - { - tweak = "addactuarian", - }, - { - tweak = "addequals", - }, - { - tweak = "addfourier", - variant = 1, - }, - -- this is the mkiv section - { - tweak = "emulatelmtx", - feature = "emulatelmtx", - comment = "this is for mkiv", - }, - { - tweak = "diagnose", - }, - }, - }, - alternates = { - partial = { feature = 'ss02', value = 1, comment = "Curved partial" }, - semibold = { feature = 'ss04', value = 1, comment = "Semibold" }, - extrabold = { feature = 'ss05', value = 1, comment = "Extrabold" }, - hbar = { feature = 'ss06', value = 1, comment = "Horizontal bar for h-bar" }, - integral = { feature = 'ss07', value = 1, comment = "A more slanted integral sign" }, - tilde = { feature = 'ss09', value = 1, comment = "A tilde variant" }, - outbendingh = { feature = 'ss10', value = 1, comment = "Out-bending h" }, - largeoperators = { feature = 'ss11', value = 1, comment = "Larger operators" }, - }, - bigs = { - 1, 3, 5, 7 - }, - }, -} - --- For now we keep these commented as they show where we came from. - --- { --- tweak = "dimensions", --- list = { --- -- offset width italic --- -- -- [0x00060] = { yoffset = -0.1 }, -- grave --- -- -- [0x000B4] = { yoffset = -0.1 }, -- acute --- -- [0x002C6] = { yoffset = -0.1 }, -- hat --- -- [0x002DC] = { yoffset = -0.1 }, -- tilde --- -- -- [0x000AF] = { yoffset = -0.1 }, -- bar --- -- [0x002D8] = { yoffset = -0.15 }, -- breve --- -- [0x002D9] = { yoffset = -0.15 }, -- dot --- -- -- [0x000A8] = { yoffset = -0.1 }, -- ddot --- -- [0x020DB] = { yoffset = -0.115 }, -- dddot --- -- [0x002C7] = { yoffset = -0.1 }, -- check --- -- [0x020D7] = { yoffset = -0.1 }, -- vec - --- -- [0x00300] = { yoffset = -0.12 , all = true }, -- widegrave --- -- [0x00301] = { yoffset = -0.12 , all = true }, -- wideacute --- -- [0x00302] = { yoffset = -0.12 , all = true }, -- widehat --- -- [0x00303] = { yoffset = -0.12 , all = true }, -- widetilde --- -- [0x00304] = { yoffset = -0.12 , all = true }, -- widebar --- -- [0x00306] = { yoffset = -0.12 , all = true }, -- widebreve --- -- [0x00307] = { yoffset = -0.12 , all = true }, -- widedot --- -- [0x00308] = { yoffset = -0.12 , all = true }, -- wideddot --- -- -- [0x020DB] = { yoffset = -0.1 , all = true }, -- widedddot --- -- [0x0030A] = { yoffset = -0.12 , all = true }, -- widering --- -- [0x0030C] = { yoffset = -0.12 , all = true }, -- widecheck - --- -- [0x002C6] = { scale =.85, yoffset = .1, width = .85, height = .935 }, -- hat --- [0x00393] = { xoffset = 0.05, width = 1.05, italic = 0.075 }, -- \Gamma --- -- [0x003A6] = { xoffset = 0.05, width = 1.05, italic = 0 }, -- \Phi difficult! --- [0x003A8] = { xoffset = 0.05, width = 1.05, italic = 0.075 }, -- \Psi --- [0x02113] = { width = 1, italic = 0.075 }, -- \ell --- [0x1D436] = { width = 1, italic = 0.05 }, -- C --- [0x1D43D] = { xoffset = 0.3, width = 1.4, italic = 0.1 }, -- J --- [0x1D44B] = { width = 1, italic = 0.05 }, -- X --- [0x1D44F] = { width = 1, italic = 0, }, -- b --- [0x1D450] = { width = 1.1, italic = 0 }, -- c --- [0x1D451] = { width = 1, italic = 0.05, }, -- d --- [0x1D452] = { width = 1.1, italic = 0.05 }, -- e --- [0x00066] = { width = 1.4, italic = 0.0, }, -- f --- [0x1D453] = { xoffset = 0.15, width = 1.15, italic = 0.1, }, -- f --- [0x1D454] = { xoffset = 0.1, width = 1.2, italic = 0.1 }, -- g --- [0x0210E] = { width = 1.1, italic = 0, }, -- h --- [0x1D457] = { xoffset = 0.2, width = 1.25, italic = 0.05 }, -- j --- [0x1D458] = { width = 1, italic = 0, }, -- k --- [0x1D459] = { width = 1, italic = 0.05 }, -- l --- [0x1D45D] = { xoffset = 0.15, width = 1.15, italic = 0, }, -- p --- [0x1D45E] = { width = 1.05, italic = 0 }, -- q --- [0x1D45F] = { width = 1.05, italic = 0 }, -- r --- [0x1D461] = { width = 1, italic = 0.1 }, -- t --- [0x1D465] = { xoffset = 0.05, width = 1.1, italic = 0.05 }, -- x --- [0x1D466] = { xoffset = 0.2, width = 1.2, italic = 0, }, -- y --- [0x1D6FD] = { xoffset = 0.05, width = 1.1, italic = 0.05 }, -- \beta --- [0x1D6FE] = { width = 1.05, italic = 0 }, -- \gamma --- [0x1D6FF] = { width = 1, italic = 0.1 }, -- \delta --- [0x1D716] = { width = 1.1, italic = 0 }, -- \epsilon --- [0x1D700] = { width = 1.1, italic = 0 }, -- \varepsilon --- [0x1D701] = { width = 1, italic = 0.15 }, -- \zeta --- [0x1D703] = { width = 1, italic = 0.1 }, -- \theta --- [0x1D705] = { width = 1, italic = 0.1 }, -- \kappa --- [0x1D706] = { xoffset = 0.05, width = 1.1, italic = 0 }, -- \lambda --- [0x1D707] = { xoffset = 0.05, width = 1.05, italic = 0 }, -- \mu --- [0x1D708] = { width = 1.1, italic = 0 }, -- \nu --- [0x1D709] = { width = 1.1, italic = 0 }, -- \xi --- [0x1D70B] = { width = 1.05, italic = 0 }, -- \pi --- [0x1D70C] = { xoffset = 0.2, width = 1.2, italic = 0 }, -- \rho --- [0x1D70E] = { width = 1, italic = 0.1 }, -- \sigma --- [0x1D70F] = { xoffset = 0.05, width = 1.05, italic = 0.1 }, -- \tau --- [0x1D712] = { xoffset = 0.15, width = 1.2, italic = 0.05 }, -- \chi --- [0x1D713] = { xoffset = 0.05, width = 1.05, italic = 0.05 }, -- \psi --- }, --- }, diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg index a4eff599f..8f2153077 100644 --- a/tex/context/fonts/mkiv/kpfonts-math.lfg +++ b/tex/context/fonts/mkiv/kpfonts-math.lfg @@ -12,11 +12,11 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, -- AccentBaseHeight = 0, AccentBaseDepth = 30, - RadicalDegreeBottomRaisePercent = 70, + -- RadicalDegreeBottomRaisePercent = 70, -- RadicalRuleThickness = 50, -- 50 in font DelimiterPercent = 90, DelimiterShortfall = 400, @@ -52,14 +52,14 @@ return { }, }, - -- { - -- tweak = "fixprimes", - -- factor = 0.85, -- accent base height - -- smaller = true, -- replace multiples - -- scale = 0.75, -- glyph scale - -- fake = 0.75, -- replace multiples with this width proportion - -- -- keep = true, -- keep the text size prime (aka minute) - -- }, + { + tweak = "fixprimes", + factor = 1.4, -- accent base height + smaller = true, -- replace multiples + scale = 1, -- glyph scale + fake = 0.8, -- replace multiples with this width proportion + -- keep = true, -- keep the text size prime (aka minute) + }, { tweak = "addmirrors", }, @@ -99,6 +99,24 @@ return { { tweak = "checkspacing", }, + +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = .0, vfactor = .75 }, + ["0x221A.variants.*"] = { location = "left", hfactor = .0, vfactor = .55 }, + ["0x221A.variants.1"] = { location = "left", hfactor = .0, vfactor = .6 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 0.65 }, + } +}, + { tweak = "addscripts", }, diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg index 5a1cbd088..71863fb59 100644 --- a/tex/context/fonts/mkiv/libertinus-math.lfg +++ b/tex/context/fonts/mkiv/libertinus-math.lfg @@ -17,8 +17,8 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 1000, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 1000, FractionRuleThickness = 50, OverbarRuleThickness = 50, -- RadicalRuleThickness = 50, @@ -28,8 +28,8 @@ return { -- AccentExtendMargin = 50, -- AccentTopShiftUp = 0, AccentBaseDepth = 10, - RadicalDegreeBottomRaisePercent = 60, - RadicalKernAfterDegree = -425, + -- RadicalDegreeBottomRaisePercent = 60, + -- RadicalKernAfterDegree = -425, -- RadicalRuleThickness = 40, -- 40 in font DelimiterPercent = 90, DelimiterShortfall = 400, @@ -47,6 +47,16 @@ return { { tweak = "addmirrors", }, +-- we have a weird middle integral piece +{ + tweak = "dimensions", + list = { + [0x23AE] = { xoffset = -.19 }, + }, +}, +{ + tweak = "fixintegrals", +}, presets.scripttocalligraphic { }, presets.rsfstoscript { rscale = 0.97 }, presets.rsfsuprighttoscript { rscale = 0.97 }, @@ -126,11 +136,31 @@ return { tweak = "copyaccents", }, -- So far for the accents. +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = .0, vfactor = .625 }, + ["0x221A.variants.*"] = { location = "left", hfactor = .0, vfactor = .5 }, + ["0x221A.variants.1"] = { location = "left", hfactor = .0, vfactor = .55 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.15 }, + } +}, + + + { tweak = "fixprimes", scale = 0.9, -- smaller = true, factor = 0.9, + fake = 0.8, }, { tweak = "checkspacing", @@ -159,6 +189,7 @@ return { variant = 1, }, { + -- needed for integrals (bad axis) and (less prominent) fences tweak = "setoptions", set = { "ignorekerndimensions" } }, diff --git a/tex/context/fonts/mkiv/lm.lfg b/tex/context/fonts/mkiv/lm.lfg index 984038d58..13023214a 100644 --- a/tex/context/fonts/mkiv/lm.lfg +++ b/tex/context/fonts/mkiv/lm.lfg @@ -1,8 +1,5 @@ -- In order to be able to use beta math fonts, we use our own file name and --- always remap. - -local common = fonts.goodies.load("common-math.lfg") -local presets = common.mathematics.tweaks.presets +-- always remap (as there is no development we no longer do this). return { name = "latin modern", @@ -10,419 +7,16 @@ return { comment = "Goodies that complement latin modern.", author = "Hans Hagen & Mikael Sundqvist", copyright = "ConTeXt development team", - mathematics = { - parameters = { - FractionNumeratorDisplayStyleShiftUp = 600, -- used to be a function - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, - AccentTopShiftUp = -60, - FlattenedAccentTopShiftUp = -60, - -- AccentExtendMargin = 50, - -- AccentBaseHeight = 0, - -- AccentBaseDepth = 0, - -- AccentTopOvershoot = 66, - AccentSuperscriptDrop = 100, -- drop the superscripts if accents are present. Amount in percentage of height of accent(?) - AccentSuperscriptPercent = 0, - DelimiterPercent = 90, - DelimiterShortfall = 400, - -- DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) - PrimeRaisePercent = 60, - PrimeRaiseComposedPercent = 15, - -- SubSuperscriptGapMin = 160, -- 160 in font - SuperscriptBaselineDropMax = 250, -- 250 in font - -- SuperscriptBottomMaxWithSubscript = 344, -- 344 in font - -- SuperscriptBottomMin = 108, -- 108 in font - SuperscriptShiftUp = 363, -- 363 in font - SuperscriptShiftUpCramped = 89, -- 289 in font - }, - tweaks = { - aftercopying = { - { - tweak = "version", - expected = "Version 1.958", - }, - { - tweak = "addmirrors", - }, - presets.scripttocalligraphic { }, - presets.rsfstoscript { }, - presets.rsfsuprighttoscript { }, - presets.moderntocalligraphic { }, - presets.eulertocalligraphic { }, - presets.xitsarabic { rscale = 0.80 }, - presets.fallbacks { }, - presets.moveitalics { correct = true }, - presets.moveitalics { correct = true, letters = true }, - presets.moveintegrals { factor = 1.4 }, - presets.wipeanchors { }, - presets.wipeitalics { }, - -- these will become moveanchors - { - tweak = "dimensions", - list = { - -- [0x1D483] = { anchor = 1.15 }, -- bold italic b - -- [0x1D485] = { anchor = 0.8 }, -- bold italic d - [0x1D487] = { anchor = 0.9 }, -- bold italic f - [0x1D489] = { anchor = 1.2 }, -- bold italic h - [0x1D48C] = { anchor = 1.2 }, -- bold italic k - [0x1D48F] = { anchor = 1.1 }, -- bold italic n - [0x1D491] = { anchor = 1.2 }, -- bold italic p - [0x1D492] = { anchor = 0.9 }, -- bold italic q - [0x1D49B] = { anchor = 0.9 }, -- bold italic z - - [0x1D736] = { anchor = 0.9 }, -- bold italic alpha - [0x1D737] = { anchor = 0.9 }, -- bold italic beta - [0x1D738] = { anchor = 1.1 }, -- bold italic gamma - [0x1D740] = { anchor = 1.2 }, -- bold italic lambda - [0x1D744] = { anchor = 1.2 }, -- bold italic omicron - - [0x1D6FE] = { anchor = 1.1 }, -- italic gamma - [0x1D702] = { anchor = 1.1 }, -- italic eta - -- [0x1D70A] = { anchor = 1.2 }, -- italic omicron -- no difference - -- [0x1D70D] = { anchor = 1.2 }, -- italic varsigma -- no difference - - [0x1D44F] = { anchor = 1.15 }, -- italic b - [0x1D451] = { anchor = 0.8, }, -- italic d - [0x1D455] = { anchor = 1.15 }, -- italic h - -- [0x1D456] = { anchor = 1.15 }, -- italic i (wrong code?) - [0x1D458] = { anchor = 1.15 }, -- italic k - [0x1D45B] = { anchor = 1.1 }, -- italic n - [0x1D45D] = { anchor = 1.1 }, -- italic p - [0x1D45E] = { anchor = 0.9 }, -- italic q - [0x1D467] = { anchor = 0.9 }, -- italic z - - [0x1D6FE] = { anchor = 1.2 }, -- italic gamma - [0x1D706] = { anchor = 1.2 }, -- italic lambda - [0x1D70A] = { anchor = 1.1 }, -- italic omikron - [0x1D70D] = { anchor = 1.1 }, -- italic varsigma - - [0x1D46A] = { anchor = 0.75 }, -- bold italic C - [0x1D46B] = { anchor = 1.1 }, -- bold italic D - [0x1D46E] = { anchor = 0.75 }, -- bold italic G - [0x1D479] = { anchor = 1.2 }, -- bold italic R - [0x1D47A] = { anchor = 0.8 }, -- bold italic S - - -- uppercaseboldscript could be improved - - [0x1D435] = { anchor = 1.05 }, -- italic B - [0x1D436] = { anchor = 0.7 }, -- italic C - [0x1D437] = { anchor = 1.05 }, -- italic D - [0x1D43A] = { anchor = 0.8 }, -- italic G - [0x1D443] = { anchor = 1.1 }, -- italic P - [0x1D445] = { anchor = 1.05 }, -- italic R - [0x1D446] = { anchor = 0.85 }, -- italic S - - [0x1D49C] = { anchor = 0.9 }, -- script A - [0x1D49D] = { anchor = 0.95 }, -- script B - [0x1D49E] = { anchor = 0.8 }, -- script C - [0x1D49F] = { anchor = 0.95 }, -- script D - [0x1D4A0] = { anchor = 0.85 }, -- script E - [0x1D4A1] = { anchor = 0.75 }, -- script F - [0x1D4A2] = { anchor = 0.9 }, -- script G - [0x1D4A3] = { anchor = 0.85 }, -- script H - [0x1D4A4] = { anchor = 0.8 }, -- script I - [0x1D4A5] = { anchor = 0.8 }, -- script J - [0x1D4A6] = { anchor = 0.85 }, -- script K - [0x1D4A7] = { anchor = 0.75 }, -- script L - [0x1D4A8] = { anchor = 0.9 }, -- script M - [0x1D4A9] = { anchor = 0.85 }, -- script N - [0x1D4AA] = { anchor = 0.95 }, -- script O - [0x1D4AB] = { anchor = 0.95 }, -- script P - [0x1D4AC] = { anchor = 0.95 }, -- script Q - [0x1D4AD] = { anchor = 0.95 }, -- script R - [0x1D4AE] = { anchor = 0.9 }, -- script S - [0x1D4AF] = { anchor = 0.75 }, -- script T - [0x1D4B0] = { anchor = 0.9, }, -- script U - [0x1D4B1] = { anchor = 0.95 }, -- script V - [0x1D4B2] = { anchor = 0.95 }, -- script W - [0x1D4B3] = { anchor = 0.95 }, -- script X - [0x1D4B4] = { anchor = 0.9 }, -- script Y - [0x1D4B5] = { anchor = 1 }, -- script Z - - -- [984874] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - -- [984881] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - -- [984888] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - -- [984895] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - -- [984902] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - -- [984909] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - -- [984916] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, - - -- ["0x7C.variants.*"] = { squeeze = 0.75, height = 0.75, depth = 0.75, extend = 1.15, width = 1.15 }, -- squeeze: glyph, height, depth: bbox - -- ["0x7C.variants.*"] = { squeeze = 0.75, height = 0.8, depth = 0.8, extend = 1.1, width = 1.1 }, -- squeeze: glyph, height, depth: bbox - - ["0x7C.variants.1"]={ squeeze = 0.90, height = 0.90, depth = 0.90 }, - ["0x7C.variants.2"]={ squeeze = 0.85, height = 0.85, depth = 0.85 }, - ["0x7C.variants.3"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.4"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.5"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.6"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - ["0x7C.variants.7"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, - - -- [utf.byte("1")] = { - -- original = utf.byte("2"), - -- mode = 1, - -- scale = 2, - -- }, - - -- ["lowercasegreeksansserifbolditalic"] = { - -- delta = 0x003B1 - 0x1D7AA, - -- slant = 0.4, - -- slant = -0.2, - -- line = 0.1, - -- mode = 1, - -- width = 1.25, - -- width = 0.95, - -- scale = 0.975, - -- }, - }, - }, - - -- Accents are a mess. We migrate the extensibles from the combiners to the base accent - -- and then need to tweak the width (which is auto set because it was zero with a large - -- accent anchor offset). First we copy and fix. - { - tweak = "extendaccents", - }, - { - tweak = "fixaccents", - }, - -- First we set the dimensions of the initial accent which started out as zero but we want - -- a proper width. - { - tweak = "dimensions", - list = { - -- [0x00300] = { width = 0.8 }, -- widegrave - -- [0x00301] = { width = 0.9 }, -- wideacute - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - -- [0x0030A] = { width = 0.9, xoffset = -.0 }, -- widering - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, - -- Then we deal with all offsets and heights in one go. So we treat the initial accent - -- as well as the variants here. - { - tweak = "dimensions", - list = { - -- here we want to apply to all - -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 - -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 - -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 - -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC - -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 - -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA - -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 - -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF - -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 - -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 - [0x020DB] = { yoffset = -0.015, height = .95, all = true }, -- widedddot : 0x20DB (self) - }, - }, - -- We now copy these to the not wide slots so that we can set these to stretch as well, - -- if only because it is less confusing and more consistent. - { - tweak = "copyaccents", - }, - -- So far for the accents. - - { - -- Here we modify "corner kerns". - -- We started with 0x2F, the solidus - -- to have the 2 in x^2/5 a bit over the slash - tweak = "kerns", - list = { - [0x0002F] = { topleft = -0.2, bottomright = -0.2 }, -- solidus - -- - [0x1D49C] = { bottomright = -0.05, }, -- script A - [0x1D49D] = { bottomright = -0.05, }, -- script B - [0x1D49E] = { bottomright = -0.25, }, -- script C - [0x1D49F] = { bottomright = -0.11, }, -- script D - [0x1D4A0] = { bottomright = -0.18, }, -- script E - [0x1D4A1] = { bottomright = -0.30, }, -- script F - [0x1D4A2] = { bottomright = -0.11, }, -- script G - [0x1D4A3] = { bottomright = -0.18, }, -- script H - [0x1D4A4] = { bottomright = -0.25, }, -- script I - [0x1D4A5] = { bottomright = -0.25, }, -- script J - [0x1D4A6] = { bottomright = -0.11, }, -- script K - [0x1D4A7] = { bottomright = -0.05, }, -- script L - [0x1D4A8] = { bottomright = -0.11, }, -- script M - [0x1D4A9] = { bottomright = -0.18, }, -- script N - [0x1D4AA] = { bottomright = -0.05, }, -- script O - [0x1D4AB] = { bottomright = -0.25, }, -- script P - [0x1D4AC] = { bottomright = -0.05, }, -- script Q - [0x1D4AD] = { bottomright = -0.05, }, -- script R - [0x1D4AE] = { bottomright = -0.11, }, -- script S - [0x1D4AF] = { bottomright = -0.33, }, -- script T - [0x1D4B0] = { bottomright = -0.11, }, -- script U - [0x1D4B1] = { bottomright = -0.25, }, -- script V - [0x1D4B2] = { bottomright = -0.25, }, -- script W - [0x1D4B3] = { bottomright = -0.11, }, -- script X - [0x1D4B4] = { bottomright = -0.18, }, -- script Y - [0x1D4B5] = { bottomright = -0.05, }, -- script Z - -- - ["0x7D.parts.top"] = { topright = -0.25 }, -- right brace top - ["0x7D.parts.bottom"] = { bottomright = -0.25 }, -- right brace bottom - ["0x7D.variants.*"] = { topright = -0.25, bottomright = -0.25 }, -- right brace variants - ["0x29.parts.top"] = { topright = -0.3, }, -- right parenthesis top - ["0x29.parts.bottom"] = { bottomright = -0.3 }, -- right parenthesis bottom - ["0x29.variants.*"] = { topright = -0.25, bottomright = -0.25 }, -- right parenthesis variants - ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top - ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom - ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants - [0x27E9] = { topright = -0.2, bottomright = -0.2 }, -- angles - ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, - [0x27EB] = { topright = -0.2, bottomright = -0.2 }, - ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, - - }, - }, - -- { - -- tweak = "staircase", - -- list = { - -- }, - -- }, - { - -- This one fakes margins to get larger/smaller accents - -- with for example \widetilde. - tweak = "margins", - list = { - [0x1D487] = { left = -.2, right = -.2 }, -- bold italic f - [0x1D489] = { left = -.2, right = -.2 }, -- bold italic h - [0x1D496] = { left = -.1, right = -.1 }, -- bold italic u - [0x1D499] = { left = -.1, right = -.1 }, -- bold italic x - - [0x1D711] = { left = -.1, right = -.1 }, -- italic varphi - [0x1D713] = { left = -.1, right = -.1 }, -- italic psi - - [0x1D659] = { left = -.1, right = -.1 }, -- sans bold italic d - [0x1D65C] = { left = -.1, right = -.1 }, -- sans bold italic g - - [0x1D409] = { left = .1, right = .1 }, -- bold upright J - [0x1D412] = { left = .1, right = .1 }, -- bold upright S - - [0x1D509] = { left = .1, right = .1 }, -- fraktur F - [0x1D50C] = { left = .1, right = .1 }, -- fraktur I - [0x1D50D] = { left = .1, right = .1 }, -- fraktur J - [0x1D51D] = { left = .1, right = .1 }, -- fraktur Z - - [0x1D538] = { left = .1, right = .1 }, -- doublestruck A - [0x1D539] = { left = .1, right = .1 }, -- doublestruck B - [0x1D53C] = { left = .1, right = .1 }, -- doublestruck E - [0x1D53D] = { left = .1, right = .1 }, -- doublestruck F - [0x1D541] = { left = .1, right = .1 }, -- doublestruck J - [0x1D542] = { left = .1, right = .1 }, -- doublestruck K - [0x1D543] = { left = .1, right = .1 }, -- doublestruck L - [0x1D547] = { left = .1, right = .1 }, -- doublestruck P - [0x1D549] = { left = .1, right = .1 }, -- doublestruck R - [0x1D54A] = { left = .1, right = .1 }, -- doublestruck S - [0x1D54B] = { left = .1, right = .1 }, -- doublestruck T - [0x1D54D] = { left = .1, right = .1 }, -- doublestruck V - [0x1D550] = { left = .1, right = .1 }, -- doublestruck Y - - [0x1D506] = { left = .1, right = .1 }, -- fraktur C - - [0x00393] = { left = .1, right = .1 }, -- upfight Gamma - [0x00396] = { left = .1, right = .1 }, -- upfight Zeta - - [0x1D5D8] = { left = .1, right = .1 }, -- sans bold E - [0x1D5D9] = { left = .1, right = .1 }, -- sans bold F - -- [0x1D5DD] = { left = .2, right = .2 }, -- sans bold J -- nope - [0x1D5DF] = { left = .1, right = .1 }, -- sans bold L - [0x1D5E6] = { left = .1, right = .1 }, -- sans bold S - - [0x1D61A] = { left = .1, right = .1 }, -- sans italic S - - [0x1D5A2] = { left = .1, right = .1 }, -- sans C - [0x1D5A4] = { left = .1, right = .1 }, -- sans E - [0x1D5A5] = { left = .1, right = .1 }, -- sans F - -- [0x1D5AB] = { left = .1, right = .1 }, -- sans L -- nope - [0x1D5AF] = { left = .1, right = .1 }, -- sans P - [0x1D5B2] = { left = .1, right = .1 }, -- sans S - [0x1D5B9] = { left = .1, right = .1 }, -- sans Z - - [0x1D4A0] = { left = .1, right = .1 }, -- script E - [0x1D4AE] = { left = .1, right = .1 }, -- script S - [0x1D4B4] = { left = .1, right = .1 }, -- script Y - - -- [0x0004A] = { left = .2, right = .2 }, -- J - [0x0004C] = { left = .1, right = .1 }, -- L - [0x00053] = { left = .1, right = .1 }, -- S - [0x0005A] = { left = .1, right = .1 }, -- Z - - [0x1D43D] = { left = -.1, right = -.1 }, -- italic J - [0x1D409] = { left = -.1, right = -.1 }, -- bold J - [0x1D471] = { left = -.1, right = -.1 }, -- bold italic J - [0x1D4D9] = { left = -.05, right = -.05 }, -- bold script J - }, - }, - { - tweak = "fixprimes", - factor = 1.05, - -- smaller = true, - scale = 0.9, - -- fake = 0.6, - }, - { - tweak = "checkspacing", - }, - { - tweak = "fixradicals", - }, - { - tweak = "addprivates", - }, - { - tweak = "addscripts", - }, - { - tweak = "accentdimensions", - }, - { - tweak = "addrules", - }, - { - tweak = "addbars", - advance = 0.52, - }, - { - tweak = "addactuarian", - }, - { - tweak = "addfourier", - variant = 1, - }, - { - tweak = "addequals", - }, - -- { - -- tweak = "wipevariants", - -- list = { - -- 0x7C, - -- }, - -- }, - -- this is the mkiv section - { - tweak = "emulatelmtx", - feature = "emulatelmtx", - comment = "this is for mkiv", - }, - }, - }, - bigslots = { - 1, 3, 5, 7 -- In fact, 6 is the last one. - }, - }, - filenames = { - ["latinmodern-math-regular.otf"] = { - "latinmodern-math.otf", -- the beta - "lmmath-regular.otf", - "latinmodernmath-regular.otf", - "lmmath-regular.otf", - "lmodernmath-regular.otf", - "lmodern-math.otf", - }, - }, + -- filenames = { + -- ["latinmodern-math-regular.otf"] = { + -- "latinmodern-math.otf", -- the beta + -- "lmmath-regular.otf", + -- "latinmodernmath-regular.otf", + -- "lmmath-regular.otf", + -- "lmodernmath-regular.otf", + -- "lmodern-math.otf", + -- }, + -- }, designsizes = { ["LMMathRoman-Regular"] = { ["4pt"] = "LMMath5-Regular@lmroman5-math", @@ -610,92 +204,3 @@ return { } } --- For now we keep these commented as they show where we came from. - --- [0x00060] = { yoffset = -0.05 }, -- grave --- [0x000B4] = { yoffset = -0.05 }, -- acute --- [0x002C6] = { yoffset = -0.05 }, -- hat --- [0x002DC] = { yoffset = -0.05 }, -- tilde --- [0x000AF] = { yoffset = -0.075 }, -- bar --- [0x002D8] = { yoffset = -0.05 }, -- breve --- [0x002D9] = { yoffset = -0.05 }, -- dot --- [0x000A8] = { yoffset = -0.05 }, -- ddot --- [0x020DB] = { yoffset = 0.2 }, -- dddot (done below!) --- [0x002DA] = { width = 0 }, -- ring (bounding box is wrong) --- [0x002C7] = { yoffset = -0.05 }, -- check --- [0x020D7] = { yoffset = -0.05 }, -- vec - --- [0x00300] = { yoffset = -0.03, all = true }, -- widegrave --- [0x00301] = { yoffset = -0.03, all = true }, -- wideacute --- [0x00302] = { yoffset = -0.075, all = true }, -- widehat --- [0x00303] = { yoffset = -0.05, all = true }, -- widetilde --- [0x00304] = { yoffset = -0.02, all = true }, -- widebar --- [0x00306] = { yoffset = -0.05, all = true }, -- widebreve --- [0x00307] = { yoffset = -0.027, all = true }, -- widedot --- [0x00308] = { yoffset = -0.027, all = true }, -- wideddot --- [0x020DB] = { yoffset = -0.065, all = true }, -- widedddot --- [0x0030C] = { yoffset = -0.05, all = true }, -- widecheck --- [0x0030A] = { yoffset = -0.025, all = true }, -- widering - --- [0x0212C] = { width = 0.95, italic = 0.05 }, -- script B --- [0x1D49E] = { width = 0.8, italic = 0.25 }, -- script C --- [0x1D49F] = { width = 0.9, italic = 0.11 }, -- script D --- [0x02130] = { width = 0.85, italic = 0.18 }, -- script E --- [0x02131] = { width = 0.75, italic = 0.3 }, -- script F --- [0x1D4A2] = { width = 0.9, italic = 0.11 }, -- script G --- [0x0210B] = { width = 0.85, italic = 0.18 }, -- script H --- [0x02110] = { width = 0.8, italic = 0.25 }, -- script I --- [0x1D4A5] = { width = 0.8, italic = 0.25 }, -- script J --- [0x1D4A6] = { width = 0.9, italic = 0.11 }, -- script K --- [0x02112] = { width = 0.95, italic = 0.05 }, -- script L --- [0x02133] = { width = 0.9, italic = 0.11 }, -- script M --- [0x1D4A9] = { width = 0.85, italic = 0.18 }, -- script N --- [0x1D4AA] = { width = 0.95, italic = 0.05 }, -- script O --- [0x1D4AB] = { width = 0.8, italic = 0.25 }, -- script P --- [0x1D4AB] = { width = 0.95, italic = 0.05 }, -- script Q --- [0x0211B] = { width = 0.95, italic = 0.05 }, -- script R --- [0x1D4AE] = { width = 0.9, italic = 0.11 }, -- script S --- [0x1D4AF] = { width = 0.75, italic = 0.33 }, -- script T --- [0x1D4B0] = { width = 0.9, italic = 0.11 }, -- script U --- [0x1D4B1] = { width = 0.8, italic = 0.25 }, -- script V --- [0x1D4B2] = { width = 0.8, italic = 0.25 }, -- script W --- [0x1D4B3] = { width = 0.9, italic = 0.11 }, -- script X --- [0x1D4B4] = { width = 0.85, italic = 0.18 }, -- script Y --- [0x1D4B5] = { width = 0.95, italic = 0.05 }, -- script Z - --- Setting anchors to shift the location of accents --- Note: Many non-italic alphabets are wiped below --- Todo: Check the less common italic alphabets - --- { --- -- For non-italic alphabets we --- -- remove italic correction. --- tweak = "wipeitalics", --- list = { --- -- "digitsbold", --- -- "digitsdoublestruck", --- -- "digitsmonospace", --- -- "digitsnormal", --- -- "digitssansserifbold", --- -- "digitssansserifnormal", --- -- "lowercasebold", --- -- "lowercaseboldfraktur", --- -- "lowercasedoublestruck", --- -- "lowercasefraktur", --- "lowercasemonospace", --- -- "lowercasenormal", --- -- "lowercasesansserifbold", --- -- "lowercasesansserifnormal", --- -- "lowercasegreeknormal", --- "uppercasebold", --- -- "uppercaseboldfraktur", --- -- "uppercasedoublestruck", --- -- "uppercasefraktur", --- -- "uppercasegreekbold", --- -- "uppercasegreeknormal", --- -- "uppercasegreeksansserifbold", --- "uppercasemonospace", --- "uppercasesansserifbold", --- "uppercasesanserifnormal", --- }, --- }, diff --git a/tex/context/fonts/mkiv/lucida-math.lfg b/tex/context/fonts/mkiv/lucida-math.lfg new file mode 100644 index 000000000..6842d505b --- /dev/null +++ b/tex/context/fonts/mkiv/lucida-math.lfg @@ -0,0 +1,290 @@ +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +local integral_variants = { bottomright = -0.20 } +----- integral_top = { topright = 0.05 } +local integral_bottom = { bottomright = -0.45 } + +return { + name = "lucida-opentype-math", + version = "1.00", + comment = "Goodies that complement lucida opentype.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + parameters = { + -- RadicalDisplayStyleVerticalGap = 100, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, + FractionRuleThickness = 55, + -- AccentTopShiftUp = 0, + -- FlattenedAccentTopShiftUp = 0, + -- AccentExtendMargin = 50, + -- AccentBaseHeight = 650, + AccentBaseDepth = 250, + -- RadicalDegreeBottomRaisePercent = 50, + -- RadicalKernAfterDegree = -600, + -- RadicalRuleThickness = 35, -- 40 in font (46 in demi) + DelimiterPercent = 90, + DelimiterShortfall = 400, + -- DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) + PrimeRaisePercent = 60, -- 50 default + PrimeRaiseComposedPercent = 50, -- 25 default + AxisHeight = 325, -- we keep the old fonts as they are (also for demos) + }, + tweaks = { + aftercopying = { + { + tweak = "version", + expected = "Version 1.803", + }, + { + tweak = "fixoldschool", + version = "Version 1.802", + }, + -- { + -- tweak = "showinfo", + -- version = "Version 1.803", + -- }, + { + tweak = "addmirrors", + }, + presets.scripttocalligraphic { }, + presets.rsfstoscript { rscale = 1 }, + presets.rsfsuprighttoscript { rscale = 1 }, + presets.moderntocalligraphic { rscale = 1 }, + presets.eulertocalligraphic { rscale = 1 }, + presets.xitsarabic { rscale = 1.05 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { factor = 1.5 }, + presets.wipeitalics { }, + { + tweak = "replacealphabets", + list = { + { + source = "uppercasescript", + target = "uppercasecalligraphic", + feature = "ss04", + }, + { + source = "lowercasescript", + target = "lowercasecalligraphic", + feature = "ss04", + }, + { + source = "uppercaseboldscript", + target = "uppercaseboldcalligraphic", + feature = "ss04", + }, + -- No lowercase bold calligraphic/script in font + }, + }, + { + tweak = "dimensions", + version = "Version 1.802", + list = { + -- The < and > are slightly too small. We scale them by 867/795 + ["0x003C"] = { scale = 1.09057, width = 1.09057, height = 1.09057 }, + ["0x003E"] = { scale = 1.09057, width = 1.09057, height = 1.09057 }, + -- The = is too big if in ss03. We scale it by 795/867 (not working like this) + -- ["0x003D.ss03"] = { scale = 0.916955, width = 0.916955, height = 0.916955 }, + }, + }, + { + tweak = "dimensions", + version = "Version 1.802", + list = { + -- these we fix here. Remove when we have new version of Lucida + ["0x23DC.parts.1"] = { xoffset = -0.075, height = .4, yoffset = -0.6 }, + ["0x23DC.parts.2"] = { height = .4, yoffset = -0.6 }, + ["0x23DC.parts.3"] = { xoffset = 0.075, height = .4, yoffset = -0.6 }, + ["0x23DD.parts.1"] = { xoffset = -0.075, depth = .8, yoffset = 0.2 }, + ["0x23DD.parts.2"] = { depth = .8, yoffset = 0.2 }, + ["0x23DD.parts.3"] = { xoffset = 0.075, depth = .8, yoffset = 0.2 }, + -- these are done later using the AccentBase* parameters + -- [0x23DC] = { height = .2, yoffset = -0.8 }, + -- [0x23DD] = { depth = .6, yoffset = 0.4 }, + -- + -- ["0x7C.variants.1"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, + -- ["0x7C.variants.2"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, + -- ["0x7C.variants.3"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, + -- ["0x7C.variants.4"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, + -- going zero makes them be ignored + ["0x7C.variants.3"] = { squeeze = 0.90, height = 0.90, depth = 0.90 }, + ["0x7C.variants.4"] = { squeeze = 0.80, height = 0.80, depth = 0.80 }, + }, + }, + -- Accents are a mess. We migrate the extensibles from the combiners to the base accent + -- and then need to tweak the width (which is auto set because it was zero with a large + -- accent anchor offset). First we copy and fix. + { + tweak = "extendaccents", + }, +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = .05, vfactor = .675 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = .05, vfactor = .6 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = .05, vfactor = .65 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + ["0x221A.variants.3"] = { location = "left", hfactor = 0, vfactor = .55 }, + ["0x221A.variants.4"] = { location = "left", hfactor = 0, vfactor = .50 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0, vfactor = .85 }, + } +}, + { + tweak = "fixaccents", + }, + -- First we set the dimensions of the initial accent which started out as zero but we want + -- a proper width. +-- { +-- tweak = "dimensions", +-- list = { +-- -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat +-- -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde +-- -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve +-- -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck +-- }, +-- }, + -- Then we deal with all offsets and heights in one go. So we treat the initial accent + -- as well as the variants here. +-- { +-- tweak = "dimensions", +-- list = { +-- -- here we want to apply to all +-- -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 +-- -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 +-- -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 +-- -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC +-- -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 +-- -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA +-- -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 +-- -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF +-- -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 +-- -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 +-- -- [0x020DB] = { yoffset = -0.015, height = .95, all = true }, -- widedddot : 0x20DB (self) +-- }, +-- }, + -- We now copy these to the not wide slots so that we can set these to stretch as well, + -- if only because it is less confusing and more consistent. + { + tweak = "copyaccents", + }, + -- So far for the accents. + + { + tweak = "fixslashes", + }, + -- { + -- tweak = "fixellipses", + -- }, + { + tweak = "addbreve", + }, + { + tweak = "kerns", + list = { + [0x002F] = { topleft = -0.2, bottomright = -0.2 }, + ["0x7D.parts.top"] = { topright = -0.15 }, -- right brace top + ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom + ["0x7D.variants.*"] = { topright = -0.15, bottomright = -0.15 }, -- right brace variants + ["0x29.parts.top"] = { topright = -0.25 }, -- right parenthesis top + ["0x29.parts.bottom"] = { bottomright = -0.25 }, -- right parenthesis bottom + ["0x29.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants + ["0x221A.parts.top"] = { topright = 0.2 }, -- right radical top + ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants + [0x27E9] = { topright = -0.2, bottomright = -0.2 }, -- angle + ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, + [0x27EB] = { topright = -0.2, bottomright = -0.2 }, + ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, + -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, + -- ["0x222C.variants.*"] = integral_variants, -- ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, + -- ["0x222D.variants.*"] = integral_variants, -- ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- ["0x222E.variants.*"] = integral_variants, -- ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- ["0x222F.variants.*"] = integral_variants, -- ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- ["0x2230.variants.*"] = integral_variants, -- ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- ["0x2231.variants.*"] = integral_variants, -- ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- ["0x2232.variants.*"] = integral_variants, -- ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- ["0x2233.variants.*"] = integral_variants, -- ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + + }, + }, + { + tweak = "fixprimes", + factor = 0.8, -- accent base height + -- smaller = true, -- replace multiples + scale = 1.1, -- glyph scale + fake = 0.65, -- replace multiples with this width proportion + -- keep = true, -- keep the text size prime (aka minute) + }, + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + { + tweak = "accentdimensions", + }, + { + tweak = "addrules", + }, + { + tweak = "addactuarian", + }, + { + tweak = "addfourier", + -- scale = 1.5, + variant = 1, + }, + { + tweak = "addarrows", + left = 0.1, + right = 0.1, + slack = 0.20, + list = { + [0x21A9] = false, + [0x21AA] = false, + [0x2190] = false, + [0x2192] = false, + [0x219E] = false, + [0x21A0] = false, + -- [0x21A6] = false, + -- [0x21CB] = false, + -- [0x21CC] = false, + } + }, + -- this is the mkiv section + { + tweak = "emulatelmtx", + feature = "emulatelmtx", + comment = "this is for mkiv", + }, + }, + }, + alternates = { + textitalic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, + arrow = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Smaller Arrows" }, + operator = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Smaller Operators" }, + calligraphic = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, + zero = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Zero" }, + multipledots = { feature = 'ss06', value = 1, comment = "Mathematical Alternative Multiple Dots" }, + ldots = { feature = 'ss07', value = 1, comment = "Mathematical Alternative Ellipsis" }, + }, + bigslots = { + 1, 2, 3, 4 + }, + -- + -- experimental fixes for mkiv: + -- + dimensions = dimensions, + kerns = kerns, + }, +} diff --git a/tex/context/fonts/mkiv/lucida-opentype-math.lfg b/tex/context/fonts/mkiv/lucida-opentype-math.lfg deleted file mode 100644 index 6a5f5ab36..000000000 --- a/tex/context/fonts/mkiv/lucida-opentype-math.lfg +++ /dev/null @@ -1,274 +0,0 @@ -local common = fonts.goodies.load("common-math.lfg") -local presets = common.mathematics.tweaks.presets - -local integral_variants = { bottomright = -0.20 } ------ integral_top = { topright = 0.05 } -local integral_bottom = { bottomright = -0.45 } - -return { - name = "lucida-opentype-math", - version = "1.00", - comment = "Goodies that complement lucida opentype.", - author = "Hans Hagen & Mikael Sundqvist", - copyright = "ConTeXt development team", - mathematics = { - parameters = { - RadicalDisplayStyleVerticalGap = 100, - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, - FractionRuleThickness = 55, - -- AccentTopShiftUp = 0, - -- FlattenedAccentTopShiftUp = 0, - -- AccentExtendMargin = 50, - -- AccentBaseHeight = 650, - AccentBaseDepth = 150, - RadicalDegreeBottomRaisePercent = 50, - RadicalKernAfterDegree = -600, - -- RadicalRuleThickness = 35, -- 40 in font (46 in demi) - DelimiterPercent = 90, - DelimiterShortfall = 400, - -- DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) - PrimeRaisePercent = 60, -- 50 default - PrimeRaiseComposedPercent = 50, -- 25 default - -- AxisHeight = 325, -- we keep the old fonts as they are (also for demos) - }, - tweaks = { - aftercopying = { - { - tweak = "version", - expected = "Version 1.803", - }, - { - tweak = "fixoldschool", - version = "Version 1.802", - }, - -- { - -- tweak = "showinfo", - -- version = "Version 1.803", - -- }, - { - tweak = "addmirrors", - }, - presets.scripttocalligraphic { }, - presets.rsfstoscript { rscale = 1 }, - presets.rsfsuprighttoscript { rscale = 1 }, - presets.moderntocalligraphic { rscale = 1 }, - presets.eulertocalligraphic { rscale = 1 }, - presets.xitsarabic { rscale = 1.05 }, - presets.fallbacks { }, - presets.moveitalics { correct = true }, - presets.moveitalics { correct = true, letters = true }, - presets.moveintegrals { factor = 1.5 }, - presets.wipeitalics { }, - { - tweak = "replacealphabets", - list = { - { - source = "uppercasescript", - target = "uppercasecalligraphic", - feature = "ss04", - }, - { - source = "lowercasescript", - target = "lowercasecalligraphic", - feature = "ss04", - }, - { - source = "uppercaseboldscript", - target = "uppercaseboldcalligraphic", - feature = "ss04", - }, - -- No lowercase bold calligraphic/script in font - }, - }, - { - tweak = "dimensions", - version = "Version 1.802", - list = { - -- The < and > are slightly too small. We scale them by 867/795 - ["0x003C"] = { scale = 1.09057, width = 1.09057, height = 1.09057 }, - ["0x003E"] = { scale = 1.09057, width = 1.09057, height = 1.09057 }, - -- The = is too big if in ss03. We scale it by 795/867 (not working like this) - -- ["0x003D.ss03"] = { scale = 0.916955, width = 0.916955, height = 0.916955 }, - }, - }, - { - tweak = "dimensions", - version = "Version 1.802", - list = { - -- these we fix here. Remove when we have new version of Lucida - ["0x23DC.parts.1"] = { xoffset = -0.075, height = .4, yoffset = -0.6 }, - ["0x23DC.parts.2"] = { height = .4, yoffset = -0.6 }, - ["0x23DC.parts.3"] = { xoffset = 0.075, height = .4, yoffset = -0.6 }, - ["0x23DD.parts.1"] = { xoffset = -0.075, depth = .8, yoffset = 0.2 }, - ["0x23DD.parts.2"] = { depth = .8, yoffset = 0.2 }, - ["0x23DD.parts.3"] = { xoffset = 0.075, depth = .8, yoffset = 0.2 }, - -- these are done later using the AccentBase* parameters - -- [0x23DC] = { height = .2, yoffset = -0.8 }, - -- [0x23DD] = { depth = .6, yoffset = 0.4 }, - -- - -- ["0x7C.variants.1"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, - -- ["0x7C.variants.2"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, - -- ["0x7C.variants.3"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, - -- ["0x7C.variants.4"] = { squeeze = 0.75, height = 0.75, depth = 0.75 }, - -- going zero makes them be ignored - ["0x7C.variants.3"] = { squeeze = 0.90, height = 0.90, depth = 0.90 }, - ["0x7C.variants.4"] = { squeeze = 0.80, height = 0.80, depth = 0.80 }, - }, - }, - -- Accents are a mess. We migrate the extensibles from the combiners to the base accent - -- and then need to tweak the width (which is auto set because it was zero with a large - -- accent anchor offset). First we copy and fix. - { - tweak = "extendaccents", - }, - { - tweak = "fixaccents", - }, - -- First we set the dimensions of the initial accent which started out as zero but we want - -- a proper width. --- { --- tweak = "dimensions", --- list = { --- -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat --- -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde --- -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve --- -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck --- }, --- }, - -- Then we deal with all offsets and heights in one go. So we treat the initial accent - -- as well as the variants here. --- { --- tweak = "dimensions", --- list = { --- -- here we want to apply to all --- -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 --- -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 --- -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 --- -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC --- -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 --- -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA --- -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 --- -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF --- -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 --- -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 --- -- [0x020DB] = { yoffset = -0.015, height = .95, all = true }, -- widedddot : 0x20DB (self) --- }, --- }, - -- We now copy these to the not wide slots so that we can set these to stretch as well, - -- if only because it is less confusing and more consistent. - { - tweak = "copyaccents", - }, - -- So far for the accents. - - { - tweak = "fixslashes", - }, - { - tweak = "fixellipses", - }, - { - tweak = "addbreve", - }, - { - tweak = "kerns", - list = { - [0x002F] = { topleft = -0.2, bottomright = -0.2 }, - ["0x7D.parts.top"] = { topright = -0.15 }, -- right brace top - ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom - ["0x7D.variants.*"] = { topright = -0.15, bottomright = -0.15 }, -- right brace variants - ["0x29.parts.top"] = { topright = -0.25 }, -- right parenthesis top - ["0x29.parts.bottom"] = { bottomright = -0.25 }, -- right parenthesis bottom - ["0x29.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants - ["0x221A.parts.top"] = { topright = 0.2 }, -- right radical top - ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom - ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants - [0x27E9] = { topright = -0.2, bottomright = -0.2 }, -- angle - ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, - [0x27EB] = { topright = -0.2, bottomright = -0.2 }, - ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, - ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, - - }, - }, - { - tweak = "fixprimes", - factor = 0.8, -- accent base height - -- smaller = true, -- replace multiples - scale = 1.1, -- glyph scale - -- fake = 0.65, -- replace multiples with this width proportion - -- keep = true, -- keep the text size prime (aka minute) - }, - { - tweak = "checkspacing", - }, - { - tweak = "addscripts", - }, - { - tweak = "accentdimensions", - }, - { - tweak = "addrules", - }, - { - tweak = "addactuarian", - }, - { - tweak = "addfourier", - -- scale = 1.5, - variant = 1, - }, - { - tweak = "addarrows", - left = 0.1, - right = 0.1, - slack = 0.20, - list = { - [0x21A9] = false, - [0x21AA] = false, - [0x2190] = false, - [0x2192] = false, - [0x219E] = false, - [0x21A0] = false, - -- [0x21A6] = false, - -- [0x21CB] = false, - -- [0x21CC] = false, - } - }, - -- this is the mkiv section - { - tweak = "emulatelmtx", - feature = "emulatelmtx", - comment = "this is for mkiv", - }, - }, - }, - alternates = { - textitalic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, - arrow = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Smaller Arrows" }, - operator = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Smaller Operators" }, - calligraphic = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, - zero = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Zero" }, - multipledots = { feature = 'ss06', value = 1, comment = "Mathematical Alternative Multiple Dots" }, - ldots = { feature = 'ss07', value = 1, comment = "Mathematical Alternative Ellipsis" }, - }, - bigslots = { - 1, 2, 3, 4 - }, - -- - -- experimental fixes for mkiv: - -- - dimensions = dimensions, - kerns = kerns, - }, -} diff --git a/tex/context/fonts/mkiv/minion-math.lfg b/tex/context/fonts/mkiv/minion-math.lfg index a768c0518..82b0b0c33 100644 --- a/tex/context/fonts/mkiv/minion-math.lfg +++ b/tex/context/fonts/mkiv/minion-math.lfg @@ -26,8 +26,8 @@ return { }, mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, -- AccentTopShiftUp = -15, -- FlattenedAccentTopShiftUp = -15, -- AccentExtendMargin = 50, @@ -43,8 +43,8 @@ return { PrimeRaiseComposedPercent = 25, -- 25 default -- PrimeShiftUp = 0, -- PrimeBaselineDropMax = 0, - RadicalKernAfterExtensible = 100, -- 0 default - RadicalKernBeforeExtensible = 100, -- 0 default + -- RadicalKernAfterExtensible = 100, -- 0 default + -- RadicalKernBeforeExtensible = 100, -- 0 default }, tweaks = { aftercopying = { @@ -71,6 +71,23 @@ return { { tweak = "extendaccents", }, +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = -0.15, vfactor = .75 }, + ["0x221A.variants.*"] = { location = "left", hfactor = -0.1, vfactor = .575 }, + ["0x221A.variants.1"] = { location = "left", hfactor = -0.1, vfactor = .725 }, + ["0x221A.variants.2"] = { location = "left", hfactor = -0.1, vfactor = .65 }, + ["0x221A.variants.3"] = { location = "left", hfactor = -0.1, vfactor = .625 }, + ["0x221A.variants.4"] = { location = "left", hfactor = -0.1, vfactor = .625 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = 0.05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = -0.1, vfactor = 0.85 }, + } +}, + { tweak = "fixaccents", }, diff --git a/tex/context/fonts/mkiv/modern-math.lfg b/tex/context/fonts/mkiv/modern-math.lfg new file mode 100644 index 000000000..509e5a7da --- /dev/null +++ b/tex/context/fonts/mkiv/modern-math.lfg @@ -0,0 +1,525 @@ +-- In order to be able to use beta math fonts, we use our own file name and +-- always remap. + +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +return { + name = "latin modern math", + version = "1.00", + comment = "Goodies that complement latin modern math.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + parameters = { + FractionNumeratorDisplayStyleShiftUp = 600, -- used to be a function + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, + AccentTopShiftUp = -60, + FlattenedAccentTopShiftUp = -60, + -- AccentExtendMargin = 50, + -- AccentBaseHeight = 0, + -- AccentBaseDepth = 0, + -- AccentTopOvershoot = 66, + AccentSuperscriptDrop = 100, -- drop the superscripts if accents are present. Amount in percentage of height of accent(?) + AccentSuperscriptPercent = 0, + DelimiterPercent = 90, + DelimiterShortfall = 400, + -- DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) + PrimeRaisePercent = 60, + PrimeRaiseComposedPercent = 15, + -- SubSuperscriptGapMin = 160, -- 160 in font + SuperscriptBaselineDropMax = 250, -- 250 in font + -- SuperscriptBottomMaxWithSubscript = 344, -- 344 in font + -- SuperscriptBottomMin = 108, -- 108 in font + SuperscriptShiftUp = 363, -- 363 in font + SuperscriptShiftUpCramped = 89, -- 289 in font + }, + tweaks = { + aftercopying = { + { + tweak = "version", + expected = "Version 1.958", + }, + { + tweak = "addmirrors", + }, + presets.scripttocalligraphic { }, + presets.rsfstoscript { }, + presets.rsfsuprighttoscript { }, + presets.moderntocalligraphic { }, + presets.eulertocalligraphic { }, + presets.xitsarabic { rscale = 0.80 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { factor = 1.4 }, + presets.wipeanchors { }, + presets.wipeitalics { }, + -- these will become moveanchors + { + tweak = "dimensions", + list = { + -- [0x1D483] = { anchor = 1.15 }, -- bold italic b + -- [0x1D485] = { anchor = 0.8 }, -- bold italic d + [0x1D487] = { anchor = 0.9 }, -- bold italic f + [0x1D489] = { anchor = 1.2 }, -- bold italic h + [0x1D48C] = { anchor = 1.2 }, -- bold italic k + [0x1D48F] = { anchor = 1.1 }, -- bold italic n + [0x1D491] = { anchor = 1.2 }, -- bold italic p + [0x1D492] = { anchor = 0.9 }, -- bold italic q + [0x1D49B] = { anchor = 0.9 }, -- bold italic z + + [0x1D736] = { anchor = 0.9 }, -- bold italic alpha + [0x1D737] = { anchor = 0.9 }, -- bold italic beta + [0x1D738] = { anchor = 1.1 }, -- bold italic gamma + [0x1D740] = { anchor = 1.2 }, -- bold italic lambda + [0x1D744] = { anchor = 1.2 }, -- bold italic omicron + + [0x1D6FE] = { anchor = 1.1 }, -- italic gamma + [0x1D702] = { anchor = 1.1 }, -- italic eta + -- [0x1D70A] = { anchor = 1.2 }, -- italic omicron -- no difference + -- [0x1D70D] = { anchor = 1.2 }, -- italic varsigma -- no difference + + [0x1D44F] = { anchor = 1.15 }, -- italic b + [0x1D451] = { anchor = 0.8, }, -- italic d + [0x1D455] = { anchor = 1.15 }, -- italic h + -- [0x1D456] = { anchor = 1.15 }, -- italic i (wrong code?) + [0x1D458] = { anchor = 1.15 }, -- italic k + [0x1D45B] = { anchor = 1.1 }, -- italic n + [0x1D45D] = { anchor = 1.1 }, -- italic p + [0x1D45E] = { anchor = 0.9 }, -- italic q + [0x1D467] = { anchor = 0.9 }, -- italic z + + [0x1D6FE] = { anchor = 1.2 }, -- italic gamma + [0x1D706] = { anchor = 1.2 }, -- italic lambda + [0x1D70A] = { anchor = 1.1 }, -- italic omikron + [0x1D70D] = { anchor = 1.1 }, -- italic varsigma + + [0x1D46A] = { anchor = 0.75 }, -- bold italic C + [0x1D46B] = { anchor = 1.1 }, -- bold italic D + [0x1D46E] = { anchor = 0.75 }, -- bold italic G + [0x1D479] = { anchor = 1.2 }, -- bold italic R + [0x1D47A] = { anchor = 0.8 }, -- bold italic S + + -- uppercaseboldscript could be improved + + [0x1D435] = { anchor = 1.05 }, -- italic B + [0x1D436] = { anchor = 0.7 }, -- italic C + [0x1D437] = { anchor = 1.05 }, -- italic D + [0x1D43A] = { anchor = 0.8 }, -- italic G + [0x1D443] = { anchor = 1.1 }, -- italic P + [0x1D445] = { anchor = 1.05 }, -- italic R + [0x1D446] = { anchor = 0.85 }, -- italic S + + [0x1D49C] = { anchor = 0.9 }, -- script A + [0x1D49D] = { anchor = 0.95 }, -- script B + [0x1D49E] = { anchor = 0.8 }, -- script C + [0x1D49F] = { anchor = 0.95 }, -- script D + [0x1D4A0] = { anchor = 0.85 }, -- script E + [0x1D4A1] = { anchor = 0.75 }, -- script F + [0x1D4A2] = { anchor = 0.9 }, -- script G + [0x1D4A3] = { anchor = 0.85 }, -- script H + [0x1D4A4] = { anchor = 0.8 }, -- script I + [0x1D4A5] = { anchor = 0.8 }, -- script J + [0x1D4A6] = { anchor = 0.85 }, -- script K + [0x1D4A7] = { anchor = 0.75 }, -- script L + [0x1D4A8] = { anchor = 0.9 }, -- script M + [0x1D4A9] = { anchor = 0.85 }, -- script N + [0x1D4AA] = { anchor = 0.95 }, -- script O + [0x1D4AB] = { anchor = 0.95 }, -- script P + [0x1D4AC] = { anchor = 0.95 }, -- script Q + [0x1D4AD] = { anchor = 0.95 }, -- script R + [0x1D4AE] = { anchor = 0.9 }, -- script S + [0x1D4AF] = { anchor = 0.75 }, -- script T + [0x1D4B0] = { anchor = 0.9, }, -- script U + [0x1D4B1] = { anchor = 0.95 }, -- script V + [0x1D4B2] = { anchor = 0.95 }, -- script W + [0x1D4B3] = { anchor = 0.95 }, -- script X + [0x1D4B4] = { anchor = 0.9 }, -- script Y + [0x1D4B5] = { anchor = 1 }, -- script Z + + -- [984874] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + -- [984881] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + -- [984888] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + -- [984895] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + -- [984902] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + -- [984909] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + -- [984916] = { squeeze = 0.50, height = 0.50, depth = 0.50 }, + + -- ["0x7C.variants.*"] = { squeeze = 0.75, height = 0.75, depth = 0.75, extend = 1.15, width = 1.15 }, -- squeeze: glyph, height, depth: bbox + -- ["0x7C.variants.*"] = { squeeze = 0.75, height = 0.8, depth = 0.8, extend = 1.1, width = 1.1 }, -- squeeze: glyph, height, depth: bbox + + ["0x7C.variants.1"]={ squeeze = 0.90, height = 0.90, depth = 0.90 }, + ["0x7C.variants.2"]={ squeeze = 0.85, height = 0.85, depth = 0.85 }, + ["0x7C.variants.3"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + ["0x7C.variants.4"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + ["0x7C.variants.5"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + ["0x7C.variants.6"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + ["0x7C.variants.7"]={ squeeze = 0.80, height = 0.80, depth = 0.80 }, + + -- [utf.byte("1")] = { + -- original = utf.byte("2"), + -- mode = 1, + -- scale = 2, + -- }, + + -- ["lowercasegreeksansserifbolditalic"] = { + -- delta = 0x003B1 - 0x1D7AA, + -- slant = 0.4, + -- slant = -0.2, + -- line = 0.1, + -- mode = 1, + -- width = 1.25, + -- width = 0.95, + -- scale = 0.975, + -- }, + }, + }, + + -- Accents are a mess. We migrate the extensibles from the combiners to the base accent + -- and then need to tweak the width (which is auto set because it was zero with a large + -- accent anchor offset). First we copy and fix. + { + tweak = "extendaccents", + }, + +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = 0.05, vfactor = .675 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = 0.05, vfactor = .6 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = 0.05, vfactor = .65 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = 0.05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.05 }, + } +}, + + { + tweak = "fixaccents", + }, + -- First we set the dimensions of the initial accent which started out as zero but we want + -- a proper width. + { + tweak = "dimensions", + list = { + -- [0x00300] = { width = 0.8 }, -- widegrave + -- [0x00301] = { width = 0.9 }, -- wideacute + [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030A] = { width = 0.9, xoffset = -.0 }, -- widering + [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + }, + }, + -- Then we deal with all offsets and heights in one go. So we treat the initial accent + -- as well as the variants here. + { + tweak = "dimensions", + list = { + -- here we want to apply to all + -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 + -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 + -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 + -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC + -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 + -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA + -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 + -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF + -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 + -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 + [0x020DB] = { yoffset = -0.015, height = .95, all = true }, -- widedddot : 0x20DB (self) + }, + }, + -- We now copy these to the not wide slots so that we can set these to stretch as well, + -- if only because it is less confusing and more consistent. + { + tweak = "copyaccents", + }, + -- So far for the accents. + + { + -- Here we modify "corner kerns". + -- We started with 0x2F, the solidus + -- to have the 2 in x^2/5 a bit over the slash + tweak = "kerns", + list = { + [0x0002F] = { topleft = -0.2, bottomright = -0.2 }, -- solidus + -- + [0x1D49C] = { bottomright = -0.05, }, -- script A + [0x1D49D] = { bottomright = -0.05, }, -- script B + [0x1D49E] = { bottomright = -0.25, }, -- script C + [0x1D49F] = { bottomright = -0.11, }, -- script D + [0x1D4A0] = { bottomright = -0.18, }, -- script E + [0x1D4A1] = { bottomright = -0.30, }, -- script F + [0x1D4A2] = { bottomright = -0.11, }, -- script G + [0x1D4A3] = { bottomright = -0.18, }, -- script H + [0x1D4A4] = { bottomright = -0.25, }, -- script I + [0x1D4A5] = { bottomright = -0.25, }, -- script J + [0x1D4A6] = { bottomright = -0.11, }, -- script K + [0x1D4A7] = { bottomright = -0.05, }, -- script L + [0x1D4A8] = { bottomright = -0.11, }, -- script M + [0x1D4A9] = { bottomright = -0.18, }, -- script N + [0x1D4AA] = { bottomright = -0.05, }, -- script O + [0x1D4AB] = { bottomright = -0.25, }, -- script P + [0x1D4AC] = { bottomright = -0.05, }, -- script Q + [0x1D4AD] = { bottomright = -0.05, }, -- script R + [0x1D4AE] = { bottomright = -0.11, }, -- script S + [0x1D4AF] = { bottomright = -0.33, }, -- script T + [0x1D4B0] = { bottomright = -0.11, }, -- script U + [0x1D4B1] = { bottomright = -0.25, }, -- script V + [0x1D4B2] = { bottomright = -0.25, }, -- script W + [0x1D4B3] = { bottomright = -0.11, }, -- script X + [0x1D4B4] = { bottomright = -0.18, }, -- script Y + [0x1D4B5] = { bottomright = -0.05, }, -- script Z + -- + ["0x7D.parts.top"] = { topright = -0.25 }, -- right brace top + ["0x7D.parts.bottom"] = { bottomright = -0.25 }, -- right brace bottom + ["0x7D.variants.*"] = { topright = -0.25, bottomright = -0.25 }, -- right brace variants + ["0x29.parts.top"] = { topright = -0.3, }, -- right parenthesis top + ["0x29.parts.bottom"] = { bottomright = -0.3 }, -- right parenthesis bottom + ["0x29.variants.*"] = { topright = -0.25, bottomright = -0.25 }, -- right parenthesis variants + ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top + ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants + [0x27E9] = { topright = -0.2, bottomright = -0.2 }, -- angles + ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, + [0x27EB] = { topright = -0.2, bottomright = -0.2 }, + ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, + + }, + }, + -- { + -- tweak = "staircase", + -- list = { + -- }, + -- }, + { + -- This one fakes margins to get larger/smaller accents + -- with for example \widetilde. + tweak = "margins", + list = { + [0x1D487] = { left = -.2, right = -.2 }, -- bold italic f + [0x1D489] = { left = -.2, right = -.2 }, -- bold italic h + [0x1D496] = { left = -.1, right = -.1 }, -- bold italic u + [0x1D499] = { left = -.1, right = -.1 }, -- bold italic x + + [0x1D711] = { left = -.1, right = -.1 }, -- italic varphi + [0x1D713] = { left = -.1, right = -.1 }, -- italic psi + + [0x1D659] = { left = -.1, right = -.1 }, -- sans bold italic d + [0x1D65C] = { left = -.1, right = -.1 }, -- sans bold italic g + + [0x1D409] = { left = .1, right = .1 }, -- bold upright J + [0x1D412] = { left = .1, right = .1 }, -- bold upright S + + [0x1D509] = { left = .1, right = .1 }, -- fraktur F + [0x1D50C] = { left = .1, right = .1 }, -- fraktur I + [0x1D50D] = { left = .1, right = .1 }, -- fraktur J + [0x1D51D] = { left = .1, right = .1 }, -- fraktur Z + + [0x1D538] = { left = .1, right = .1 }, -- doublestruck A + [0x1D539] = { left = .1, right = .1 }, -- doublestruck B + [0x1D53C] = { left = .1, right = .1 }, -- doublestruck E + [0x1D53D] = { left = .1, right = .1 }, -- doublestruck F + [0x1D541] = { left = .1, right = .1 }, -- doublestruck J + [0x1D542] = { left = .1, right = .1 }, -- doublestruck K + [0x1D543] = { left = .1, right = .1 }, -- doublestruck L + [0x1D547] = { left = .1, right = .1 }, -- doublestruck P + [0x1D549] = { left = .1, right = .1 }, -- doublestruck R + [0x1D54A] = { left = .1, right = .1 }, -- doublestruck S + [0x1D54B] = { left = .1, right = .1 }, -- doublestruck T + [0x1D54D] = { left = .1, right = .1 }, -- doublestruck V + [0x1D550] = { left = .1, right = .1 }, -- doublestruck Y + + [0x1D506] = { left = .1, right = .1 }, -- fraktur C + + [0x00393] = { left = .1, right = .1 }, -- upfight Gamma + [0x00396] = { left = .1, right = .1 }, -- upfight Zeta + + [0x1D5D8] = { left = .1, right = .1 }, -- sans bold E + [0x1D5D9] = { left = .1, right = .1 }, -- sans bold F + -- [0x1D5DD] = { left = .2, right = .2 }, -- sans bold J -- nope + [0x1D5DF] = { left = .1, right = .1 }, -- sans bold L + [0x1D5E6] = { left = .1, right = .1 }, -- sans bold S + + [0x1D61A] = { left = .1, right = .1 }, -- sans italic S + + [0x1D5A2] = { left = .1, right = .1 }, -- sans C + [0x1D5A4] = { left = .1, right = .1 }, -- sans E + [0x1D5A5] = { left = .1, right = .1 }, -- sans F + -- [0x1D5AB] = { left = .1, right = .1 }, -- sans L -- nope + [0x1D5AF] = { left = .1, right = .1 }, -- sans P + [0x1D5B2] = { left = .1, right = .1 }, -- sans S + [0x1D5B9] = { left = .1, right = .1 }, -- sans Z + + [0x1D4A0] = { left = .1, right = .1 }, -- script E + [0x1D4AE] = { left = .1, right = .1 }, -- script S + [0x1D4B4] = { left = .1, right = .1 }, -- script Y + + -- [0x0004A] = { left = .2, right = .2 }, -- J + [0x0004C] = { left = .1, right = .1 }, -- L + [0x00053] = { left = .1, right = .1 }, -- S + [0x0005A] = { left = .1, right = .1 }, -- Z + + [0x1D43D] = { left = -.1, right = -.1 }, -- italic J + [0x1D409] = { left = -.1, right = -.1 }, -- bold J + [0x1D471] = { left = -.1, right = -.1 }, -- bold italic J + [0x1D4D9] = { left = -.05, right = -.05 }, -- bold script J + }, + }, + { + tweak = "fixprimes", + factor = 1.05, + -- smaller = true, + scale = 0.9, + -- fake = 0.6, + }, + { + tweak = "checkspacing", + }, + { + tweak = "fixradicals", + }, + { + tweak = "addprivates", + }, + { + tweak = "addscripts", + }, + { + tweak = "accentdimensions", + }, + { + tweak = "addrules", + }, + { + tweak = "addbars", + advance = 0.52, + }, + { + tweak = "addactuarian", + }, + { + tweak = "addfourier", + variant = 1, + }, + { + tweak = "addequals", + }, + -- { + -- tweak = "wipevariants", + -- list = { + -- 0x7C, + -- }, + -- }, + -- this is the mkiv section + { + tweak = "emulatelmtx", + feature = "emulatelmtx", + comment = "this is for mkiv", + }, + }, + }, + bigslots = { + -- 1, 3, 5, 7 -- In fact, 7 is the last one. + 1, 4, 6, 7 -- In fact, 7 is the last one. + }, + }, +} + +-- For now we keep these commented as they show where we came from. + +-- [0x00060] = { yoffset = -0.05 }, -- grave +-- [0x000B4] = { yoffset = -0.05 }, -- acute +-- [0x002C6] = { yoffset = -0.05 }, -- hat +-- [0x002DC] = { yoffset = -0.05 }, -- tilde +-- [0x000AF] = { yoffset = -0.075 }, -- bar +-- [0x002D8] = { yoffset = -0.05 }, -- breve +-- [0x002D9] = { yoffset = -0.05 }, -- dot +-- [0x000A8] = { yoffset = -0.05 }, -- ddot +-- [0x020DB] = { yoffset = 0.2 }, -- dddot (done below!) +-- [0x002DA] = { width = 0 }, -- ring (bounding box is wrong) +-- [0x002C7] = { yoffset = -0.05 }, -- check +-- [0x020D7] = { yoffset = -0.05 }, -- vec + +-- [0x00300] = { yoffset = -0.03, all = true }, -- widegrave +-- [0x00301] = { yoffset = -0.03, all = true }, -- wideacute +-- [0x00302] = { yoffset = -0.075, all = true }, -- widehat +-- [0x00303] = { yoffset = -0.05, all = true }, -- widetilde +-- [0x00304] = { yoffset = -0.02, all = true }, -- widebar +-- [0x00306] = { yoffset = -0.05, all = true }, -- widebreve +-- [0x00307] = { yoffset = -0.027, all = true }, -- widedot +-- [0x00308] = { yoffset = -0.027, all = true }, -- wideddot +-- [0x020DB] = { yoffset = -0.065, all = true }, -- widedddot +-- [0x0030C] = { yoffset = -0.05, all = true }, -- widecheck +-- [0x0030A] = { yoffset = -0.025, all = true }, -- widering + +-- [0x0212C] = { width = 0.95, italic = 0.05 }, -- script B +-- [0x1D49E] = { width = 0.8, italic = 0.25 }, -- script C +-- [0x1D49F] = { width = 0.9, italic = 0.11 }, -- script D +-- [0x02130] = { width = 0.85, italic = 0.18 }, -- script E +-- [0x02131] = { width = 0.75, italic = 0.3 }, -- script F +-- [0x1D4A2] = { width = 0.9, italic = 0.11 }, -- script G +-- [0x0210B] = { width = 0.85, italic = 0.18 }, -- script H +-- [0x02110] = { width = 0.8, italic = 0.25 }, -- script I +-- [0x1D4A5] = { width = 0.8, italic = 0.25 }, -- script J +-- [0x1D4A6] = { width = 0.9, italic = 0.11 }, -- script K +-- [0x02112] = { width = 0.95, italic = 0.05 }, -- script L +-- [0x02133] = { width = 0.9, italic = 0.11 }, -- script M +-- [0x1D4A9] = { width = 0.85, italic = 0.18 }, -- script N +-- [0x1D4AA] = { width = 0.95, italic = 0.05 }, -- script O +-- [0x1D4AB] = { width = 0.8, italic = 0.25 }, -- script P +-- [0x1D4AB] = { width = 0.95, italic = 0.05 }, -- script Q +-- [0x0211B] = { width = 0.95, italic = 0.05 }, -- script R +-- [0x1D4AE] = { width = 0.9, italic = 0.11 }, -- script S +-- [0x1D4AF] = { width = 0.75, italic = 0.33 }, -- script T +-- [0x1D4B0] = { width = 0.9, italic = 0.11 }, -- script U +-- [0x1D4B1] = { width = 0.8, italic = 0.25 }, -- script V +-- [0x1D4B2] = { width = 0.8, italic = 0.25 }, -- script W +-- [0x1D4B3] = { width = 0.9, italic = 0.11 }, -- script X +-- [0x1D4B4] = { width = 0.85, italic = 0.18 }, -- script Y +-- [0x1D4B5] = { width = 0.95, italic = 0.05 }, -- script Z + +-- Setting anchors to shift the location of accents +-- Note: Many non-italic alphabets are wiped below +-- Todo: Check the less common italic alphabets + +-- { +-- -- For non-italic alphabets we +-- -- remove italic correction. +-- tweak = "wipeitalics", +-- list = { +-- -- "digitsbold", +-- -- "digitsdoublestruck", +-- -- "digitsmonospace", +-- -- "digitsnormal", +-- -- "digitssansserifbold", +-- -- "digitssansserifnormal", +-- -- "lowercasebold", +-- -- "lowercaseboldfraktur", +-- -- "lowercasedoublestruck", +-- -- "lowercasefraktur", +-- "lowercasemonospace", +-- -- "lowercasenormal", +-- -- "lowercasesansserifbold", +-- -- "lowercasesansserifnormal", +-- -- "lowercasegreeknormal", +-- "uppercasebold", +-- -- "uppercaseboldfraktur", +-- -- "uppercasedoublestruck", +-- -- "uppercasefraktur", +-- -- "uppercasegreekbold", +-- -- "uppercasegreeknormal", +-- -- "uppercasegreeksansserifbold", +-- "uppercasemonospace", +-- "uppercasesansserifbold", +-- "uppercasesanserifnormal", +-- }, +-- }, diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index 032450426..8c60759ab 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -13,8 +13,8 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, AccentTopShiftUp = 10, FlattenedAccentTopShiftUp = 10, -- AccentExtendMargin = 50, @@ -22,9 +22,9 @@ return { AccentBaseDepth = 80, -- SpaceAfterScript = 0, -- SpaceAfterScript = 30, - RadicalDegreeBottomRaisePercent = 60, - RadicalKernAfterDegree = -500, - RadicalRuleThickness = 54, -- 60 in font + -- RadicalDegreeBottomRaisePercent = 60, + -- RadicalKernAfterDegree = -500, + -- RadicalRuleThickness = 54, -- 60 in font DelimiterPercent = 90, DelimiterShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1500 in font @@ -49,8 +49,8 @@ return { { tweak = "replacealphabets", feature = "euleroverpagella", - filename = "euler.otf", - list = { + filename = "euler-math.otf", + list = { -- { source = { first = 0x02100, last = 0x0210D } }, -- no 0x2210E -- { source = { first = 0x0210F, last = 0x02BFF } }, { source = { first = 0x02100, last = 0x02BFF } }, @@ -106,6 +106,22 @@ return { { tweak = "extendaccents", }, +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = 0.05 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = 0.05 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = 0.05, vfactor = .65 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = 0.05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.0, vfactor = 1.1 }, + } +}, { tweak = "fixaccents", }, @@ -174,15 +190,19 @@ return { [0x27EB] = { topright = -0.2, bottomright = -0.2 }, ["0x27EB.variants.*"] = { topright = -0.3, bottomright = -0.3 }, -- - ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int + ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint + ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint + ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint + -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, + -- ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, + -- ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, }, }, { diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg index 9a7b3dca6..8666690da 100644 --- a/tex/context/fonts/mkiv/schola-math.lfg +++ b/tex/context/fonts/mkiv/schola-math.lfg @@ -12,16 +12,16 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, AccentTopShiftUp = -15, FlattenedAccentTopShiftUp = -15, -- AccentExtendMargin = 50, -- AccentBaseHeight = 0, AccentBaseDepth = 30, - RadicalDegreeBottomRaisePercent = 60, - RadicalKernAfterDegree = -500, - RadicalRuleThickness = 64, -- 70 in font + -- RadicalDegreeBottomRaisePercent = 60, + -- RadicalKernAfterDegree = -500, + -- RadicalRuleThickness = 64, -- 70 in font DelimiterPercent = 90, DelimiterShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1333 in font @@ -72,15 +72,19 @@ return { [0x27EB] = { topright = -0.1, bottomright = -0.1 }, ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- - ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int + ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint + ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint + ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint + -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, + -- ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, + -- ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, }, }, @@ -91,6 +95,22 @@ return { { tweak = "extendaccents", }, +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = 0.05 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = 0.05 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = 0.05, vfactor = .65 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = 0.05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.1 }, + } +}, { tweak = "fixaccents", }, diff --git a/tex/context/fonts/mkiv/stix-two-math.lfg b/tex/context/fonts/mkiv/stix-two-math.lfg deleted file mode 100644 index 1f370359f..000000000 --- a/tex/context/fonts/mkiv/stix-two-math.lfg +++ /dev/null @@ -1,220 +0,0 @@ -local common = fonts.goodies.load("common-math.lfg") -local presets = common.mathematics.tweaks.presets - -local integral_variants = { bottomright = -0.4 } ------ integral_top = { topright = 0.05 } -local integral_bottom = { bottomright = -0.35 } - -return { - name = "stix-two-math", - version = "1.00", - comment = "Goodies that complement stix two opentype.", - author = "Hans Hagen & Mikael Sundqvist", - copyright = "ConTeXt development team", - mathematics = { - alternates = { - calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, - italic = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, - barred = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Barred Characters" }, -- hbar, lambdabar etc - primes = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Primes" }, -- larger/lower primes, minute etc - arrow = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Smaller Arrows" }, - narrower = { feature = 'ss06', value = 1, comment = "Mathematical Alternative Narrower Elements" }, -- narrower/shorter element etc - small = { feature = 'ss07', value = 1, comment = "Mathematical Alternative Smaller Operators" }, - upright = { feature = 'ss08', value = 1, comment = "Mathematical Alternative Upright Symbols" }, -- upright integrals etc. - negated = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Symbols" }, - relation = { feature = 'ss10', value = 1, comment = "Mathematical Alternative Relations" }, - negatedset = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Set Symbols" }, - -- todo = { feature = 'ss14', value = 1, comment = "" }, - circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" }, - }, - parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 1000, - -- AccentBaseHeight = 0, - AccentBaseDepth = 30, - FlattenedAccentTopShiftUp = 0, - -- AccentExtendMargin = 50, - RadicalDegreeBottomRaisePercent = 65, - -- RadicalKernBeforeDegree = 500, - RadicalKernAfterDegree = -500, - RadicalVerticalGap = 10, - -- RadicalRuleThickness = 68, -- 68 in font (but shifted down) - DelimiterPercent = 90, - DelimiterShortfall = 400, - DisplayOperatorMinHeight = 1800, -- 1800 in font - PrimeRaisePercent = 75, -- 50 default - PrimeRaiseComposedPercent = 10, -- 25 default - }, - tweaks = { - aftercopying = { - { - tweak = "version", - expected = "Version 2.12 b168", - }, - { - tweak = "fixprimes", - scale = 1, - -- smaller = true, - factor = 1, - }, - { - tweak = "addmirrors", - }, - -- MS: we need to check this, I moved it up - { - tweak = "replacealphabets", - list = { - { - source = "uppercasescript", - target = "uppercasecalligraphic", - }, - { - source = "uppercasescript", - target = "uppercasescript", - feature = "ss01", - }, - }, - }, - -- - presets.scripttocalligraphic { }, - presets.rsfstoscript { }, - presets.rsfsuprighttoscript { }, - presets.moderntocalligraphic { }, - presets.eulertocalligraphic { }, - presets.xitsarabic { rscale = 0.95 }, - presets.fallbacks { }, - presets.moveitalics { correct = true }, - presets.moveitalics { correct = true, letters = true }, - presets.moveintegrals { }, - presets.wipeitalics { }, - { - tweak = "simplifykerns", - }, - { - tweak = "kerns", - list = { - [0x002F] = { topleft = -0.2, bottomright = -0.2 }, - ["0x7D.parts.top"] = { topright = -0.15, }, -- right brace top - ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom - -- ["0x7D.variants.*"] = { topright = -0.15, bottomright = -0.15 }, -- right brace variants - ["0x29.parts.top"] = { topright = -0.1, }, -- right parenthesis top - ["0x29.parts.bottom"] = { bottomright = -0.1 }, -- right parenthesis bottom - ["0x29.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants - ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top - ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom - ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants - [0x27E9] = { topright = -0.1, bottomright = -0.1 }, -- angle - ["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 }, - [0x27EB] = { topright = -0.1, bottomright = -0.1 }, - ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, - -- - ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, - }, - }, - -- Accents are a mess. We migrate the extensibles from the combiners to the base accent - -- and then need to tweak the width (which is auto set because it was zero with a large - -- accent anchor offset). First we copy and fix. - { - tweak = "extendaccents", - }, - { - tweak = "fixaccents", - }, - -- First we set the dimensions of the initial accent which started out as zero but we want - -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.2, anchor = 1.10, xoffset = .05 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, - -- Then we deal with all offsets and heights in one go. So we treat the initial accent - -- as well as the variants here. - { - tweak = "dimensions", - list = { - -- here we want to apply to all - -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 - -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 - -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 - -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC - -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 - -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA - -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 - -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF - -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 - -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 - [0x020DB] = { yoffset = 0.025, height = .95, all = true }, -- widedddot : 0x20DB (self) - }, - }, - -- We now copy these to the not wide slots so that we can set these to stretch as well, - -- if only because it is less confusing and more consistent. - { - tweak = "copyaccents", - }, - -- So far for the accents. - { - tweak = "checkspacing", - }, - { - tweak = "addscripts", - }, - { - tweak = "accentdimensions", - }, - { - tweak = "addrules", - }, - { - tweak = "addarrows", - }, - { - tweak = "fixslashes", - }, - { -- already exists, but not good spacing - tweak = "addbars", - advance = 0.4, - }, - { - tweak = "addfourier", - variant = 1, - }, - { - tweak = "addparts", - list = { - [0x21F4] = { - horizontal = true, - template = 0x2192, - sequence = { - { glyph = "first", factor = 2 }, - { glyph = 0x2022, }, - { glyph = "first", factor = 2 }, - { glyph = "last" }, - } - } - } - }, - -- this is the mkiv section - { - tweak = "emulatelmtx", - feature = "emulatelmtx", - comment = "this is for mkiv", - }, - }, - }, - bigslots = { - 1, 3, 5, 7 - }, - }, -} diff --git a/tex/context/fonts/mkiv/stixtwo-math.lfg b/tex/context/fonts/mkiv/stixtwo-math.lfg new file mode 100644 index 000000000..ab5b884ad --- /dev/null +++ b/tex/context/fonts/mkiv/stixtwo-math.lfg @@ -0,0 +1,242 @@ +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +local integral_variants = { bottomright = -0.4 } +----- integral_top = { topright = 0.05 } +local integral_bottom = { bottomright = -0.35 } + +return { + name = "stix-two-math", + version = "1.00", + comment = "Goodies that complement stix two opentype.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + alternates = { + calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, + italic = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, + barred = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Barred Characters" }, -- hbar, lambdabar etc + primes = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Primes" }, -- larger/lower primes, minute etc + arrow = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Smaller Arrows" }, + narrower = { feature = 'ss06', value = 1, comment = "Mathematical Alternative Narrower Elements" }, -- narrower/shorter element etc + small = { feature = 'ss07', value = 1, comment = "Mathematical Alternative Smaller Operators" }, + upright = { feature = 'ss08', value = 1, comment = "Mathematical Alternative Upright Symbols" }, -- upright integrals etc. + negated = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Symbols" }, + relation = { feature = 'ss10', value = 1, comment = "Mathematical Alternative Relations" }, + negatedset = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Set Symbols" }, + -- todo = { feature = 'ss14', value = 1, comment = "" }, + circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" }, + }, + parameters = { + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 1000, + -- AccentBaseHeight = 0, + AccentBaseDepth = 30, + FlattenedAccentTopShiftUp = 0, + -- AccentExtendMargin = 50, + -- RadicalDegreeBottomRaisePercent = 65, + -- RadicalKernBeforeDegree = 500, + RadicalKernAfterDegree = -500, + -- RadicalVerticalGap = 10, + -- RadicalRuleThickness = 68, -- 68 in font (but shifted down) + DelimiterPercent = 90, + DelimiterShortfall = 400, + DisplayOperatorMinHeight = 1800, -- 1800 in font + PrimeRaisePercent = 75, -- 50 default + PrimeRaiseComposedPercent = 10, -- 25 default + }, + tweaks = { + aftercopying = { + { + tweak = "version", + expected = "Version 2.12 b168", + }, + { + tweak = "fixprimes", + scale = 1, + -- smaller = true, + factor = 1, + }, + { + tweak = "addmirrors", + }, + -- MS: we need to check this, I moved it up + { + tweak = "replacealphabets", + list = { + { + source = "uppercasescript", + target = "uppercasecalligraphic", + }, + { + source = "uppercasescript", + target = "uppercasescript", + feature = "ss01", + }, + }, + }, + -- + presets.scripttocalligraphic { }, + presets.rsfstoscript { }, + presets.rsfsuprighttoscript { }, + presets.moderntocalligraphic { }, + presets.eulertocalligraphic { }, + presets.xitsarabic { rscale = 0.95 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { }, + presets.wipeitalics { }, + { + tweak = "simplifykerns", + }, + { + tweak = "kerns", + list = { + [0x002F] = { topleft = -0.2, bottomright = -0.2 }, + ["0x7D.parts.top"] = { topright = -0.15, }, -- right brace top + ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom + -- ["0x7D.variants.*"] = { topright = -0.15, bottomright = -0.15 }, -- right brace variants + ["0x29.parts.top"] = { topright = -0.1, }, -- right parenthesis top + ["0x29.parts.bottom"] = { bottomright = -0.1 }, -- right parenthesis bottom + ["0x29.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants + ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top + ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants + [0x27E9] = { topright = -0.1, bottomright = -0.1 }, -- angle + ["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 }, + [0x27EB] = { topright = -0.1, bottomright = -0.1 }, + ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, + -- + ["0x222B.parts.bottom"] = { bottomright = -0.30 }, -- int + -- ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint does not exist + -- ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint does not exist + -- ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint does not exist + -- -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, + -- ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, + -- ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + }, + }, + -- Accents are a mess. We migrate the extensibles from the combiners to the base accent + -- and then need to tweak the width (which is auto set because it was zero with a large + -- accent anchor offset). First we copy and fix. + { + tweak = "extendaccents", + }, + +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = 0.00, vfactor = 0.7 }, + ["0x221A.variants.*"] = { location = "left", hfactor = 0.00, vfactor = 0.55 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = 0.05, vfactor = .65 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + ["0x221A.variants.3"] = { location = "left", hfactor = 0.00, vfactor = .525 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = 0.05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.00 }, + } +}, + + { + tweak = "fixaccents", + }, + -- First we set the dimensions of the initial accent which started out as zero but we want + -- a proper width. + { + tweak = "dimensions", + list = { + [0x00302] = { width = 1.2, anchor = 1.10, xoffset = .05 }, -- widehat + [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + }, + }, + -- Then we deal with all offsets and heights in one go. So we treat the initial accent + -- as well as the variants here. + { + tweak = "dimensions", + list = { + -- here we want to apply to all + -- [0x00300] = { yoffset = -0.02, height = .95, all = true }, -- widegrave : 0x0060 + -- [0x00301] = { yoffset = -0.02, height = .95, all = true }, -- wideacute : 0x00B4 + -- [0x00302] = { yoffset = -0.03, height = .95, all = true }, -- widehat : 0x02C6 + -- [0x00303] = { yoffset = -0.02, height = .95, all = true }, -- widetilde : 0x02DC + -- [0x00306] = { yoffset = -0.03, height = .95, all = true }, -- widebre : 0x02D8 + -- [0x0030A] = { yoffset = 0.00, height = .95, all = true }, -- widering : 0x02DA + -- [0x0030C] = { yoffset = -0.03, height = .95, all = true }, -- widecheck : 0x02C7 + -- [0x00304] = { yoffset = -0.05, height = .95, all = true }, -- widebar : 0x00AF + -- [0x00307] = { yoffset = -0.03, height = .95, all = true }, -- widedot : 0x02D9 + -- [0x00308] = { yoffset = -0.03, height = .95, all = true }, -- wideddot : 0x00A8 + [0x020DB] = { yoffset = 0.025, height = .95, all = true }, -- widedddot : 0x20DB (self) + }, + }, + -- We now copy these to the not wide slots so that we can set these to stretch as well, + -- if only because it is less confusing and more consistent. + { + tweak = "copyaccents", + }, + -- So far for the accents. + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + { + tweak = "accentdimensions", + }, + { + tweak = "addrules", + }, + { + tweak = "addarrows", + }, + { + tweak = "fixslashes", + }, + { -- already exists, but not good spacing + tweak = "addbars", + advance = 0.4, + }, + { + tweak = "addfourier", + variant = 1, + }, + { + tweak = "addparts", + list = { + [0x21F4] = { + horizontal = true, + template = 0x2192, + sequence = { + { glyph = "first", factor = 2 }, + { glyph = 0x2022, }, + { glyph = "first", factor = 2 }, + { glyph = "last" }, + } + } + } + }, + -- this is the mkiv section + { + tweak = "emulatelmtx", + feature = "emulatelmtx", + comment = "this is for mkiv", + }, + }, + }, + bigslots = { + 1, 3, 5, 7 + }, + }, +} diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index 6e3eb9306..cd4536b55 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -12,15 +12,15 @@ return { copyright = "ConTeXt development team", mathematics = { parameters = { - NoLimitSupFactor = 0, - NoLimitSubFactor = 900, + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, AccentTopShiftUp = -15, FlattenedAccentTopShiftUp = -15, -- AccentExtendMargin = 50, -- AccentBaseHeight = 0, AccentBaseDepth = 50, - RadicalDegreeBottomRaisePercent = 60, - RadicalRuleThickness = 46, -- 52 in font + -- RadicalDegreeBottomRaisePercent = 60, + -- RadicalRuleThickness = 46, -- 52 in font DelimiterPercent = 90, DelimiterShortfall = 400, DisplayOperatorMinHeight = 1800, -- 1300 in font (only one) @@ -71,15 +71,19 @@ return { [0x27EB] = { topright = -0.1, bottomright = -0.1 }, ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- - ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, - ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, - ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, - ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, - ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, - ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, - ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, - ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, - ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, + ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int + ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint + ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint + ["0x2A0C.parts.bottom"] = { bottomright = -0.05 }, -- iiiint + -- ["0x222B.variants.*"] = integral_variants, ["0x222B.parts.top"] = integral_top, ["0x222B.parts.bottom"] = integral_bottom, + -- ["0x222C.variants.*"] = integral_variants, ["0x222C.parts.top"] = integral_top, ["0x222C.parts.bottom"] = integral_bottom, + -- ["0x222D.variants.*"] = integral_variants, ["0x222D.parts.top"] = integral_top, ["0x222D.parts.bottom"] = integral_bottom, + -- ["0x222E.variants.*"] = integral_variants, ["0x222E.parts.top"] = integral_top, ["0x222E.parts.bottom"] = integral_bottom, + -- ["0x222F.variants.*"] = integral_variants, ["0x222F.parts.top"] = integral_top, ["0x222F.parts.bottom"] = integral_bottom, + -- ["0x2230.variants.*"] = integral_variants, ["0x2230.parts.top"] = integral_top, ["0x2230.parts.bottom"] = integral_bottom, + -- ["0x2231.variants.*"] = integral_variants, ["0x2231.parts.top"] = integral_top, ["0x2231.parts.bottom"] = integral_bottom, + -- ["0x2232.variants.*"] = integral_variants, ["0x2232.parts.top"] = integral_top, ["0x2232.parts.bottom"] = integral_bottom, + -- ["0x2233.variants.*"] = integral_variants, ["0x2233.parts.top"] = integral_top, ["0x2233.parts.bottom"] = integral_bottom, }, }, -- Accents are a mess. We migrate the extensibles from the combiners to the base accent @@ -88,6 +92,22 @@ return { { tweak = "extendaccents", }, +{ + tweak = "radicaldegreeanchors", + list = { + [0x221A] = { location = "left", hfactor = 0.0, vfactor = 0.6 }, + ["0x221A.variants.*"] = { location = "left", hfactor = 0.0, vfactor = 0.6 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = 0.05, vfactor = .65 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .65 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = 0.05, vfactor = .525 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.1 }, + } +}, { tweak = "fixaccents", }, diff --git a/tex/context/fonts/mkiv/type-imp-asana.mkiv b/tex/context/fonts/mkiv/type-imp-asana.mkiv deleted file mode 100644 index c48d3b7ad..000000000 --- a/tex/context/fonts/mkiv/type-imp-asana.mkiv +++ /dev/null @@ -1,35 +0,0 @@ -%D \module -%D [ file=type-imp-asana, -%D version=2007.07.30, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Asana, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\loadtypescriptfile[texgyre] - -\starttypescriptcollection [asanamath] - - \starttypescript [\s!math] [asana] - \definefontsynonym [AsanaMath] [\s!name:asanamath] - \stoptypescript - - \starttypescript [\s!math] [asana] [\s!name] - \loadfontgoodies[asana-math] - \definefontsynonym [MathRoman] [AsanaMath] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=asana-math] - \stoptypescript - - \starttypescript[asana] - \definetypeface [\typescriptone] [\s!rm] [\s!serif] [palatino] [\s!default] - \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] [\s!rscale=1.075] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.075] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] - \quittypescriptscanning - \stoptypescript - -\stoptypescriptcollection diff --git a/tex/context/fonts/mkiv/type-imp-cambria.mkiv b/tex/context/fonts/mkiv/type-imp-cambria.mkiv index 0ccb4409e..345778149 100644 --- a/tex/context/fonts/mkiv/type-imp-cambria.mkiv +++ b/tex/context/fonts/mkiv/type-imp-cambria.mkiv @@ -22,7 +22,12 @@ \doifunknownfontfeature {cambria-math-bold} {\definefontfeature[cambria-math-bold][boldened]} - \starttypescript [\s!math,\s!serif] [cambria,cambria-x,cambria-y] + \starttypescript [\s!math] [cambria,cambria-x,cambria-y,cambria-nt,cambria-m,cambria-a] + \checkedmapfontsize[\typescripttwo][\s!script] [.73] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60] + \stoptypescript + + \starttypescript [\s!math,\s!serif] [cambria,cambria-x,cambria-y,cambria-nt] % whatever matches \definefontsynonym [CambriaMath] [\s!name:cambriamath] \definefontsynonym [CambriaSerif] [\s!name:cambria] @@ -47,6 +52,11 @@ \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=cambria-math] \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria-math-bold,mathextra},\s!goodies=cambria-math] \stoptypescript + \starttypescript [\s!math] [cambria-nt] [\s!name] + \loadfontgoodies[cambria-math] + \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math\mathsizesuffix,mathextra}] + \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math\mathsizesuffix,cambria-math-bold,mathextra}] + \stoptypescript \starttypescript [\s!math] [cambria-x] [\s!name] \loadfontgoodies[cambria-math] \definefontsynonym [\s!MathRoman] [CambriaMath] [\s!features={\s!math,mathextra},\s!goodies=cambria-math] @@ -58,7 +68,7 @@ \definefontsynonym [\s!MathRomanBold] [CambriaMath] [\s!features={\s!math-nostack\mathsizesuffix,cambria-math-bold,mathextra},\s!goodies=cambria-math] \stoptypescript - \starttypescript [\s!serif] [cambria,cambria-m,cambria-a] [\s!name] + \starttypescript [\s!serif] [cambria,cambria-m,cambria-a,cambria-nt] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [CambriaSerif] [\s!features=\s!default,\s!goodies=cambria] \definefontsynonym [\s!SerifBold] [\s!name:cambriabold] [\s!features=\s!default,\s!goodies=cambria] @@ -72,7 +82,7 @@ \definetypeface [cambria] [\s!tt] [\s!mono] [dejavu] [\s!default] \definetypeface [cambria] [\s!mm] [\s!math] [\typescriptone] [\s!default] \stoptypescript - \starttypescript [cambria-x,cambria-y] + \starttypescript [cambria-x,cambria-y,cambria-nt] % test x \definetypeface [\typescriptone] [\s!rm] [\s!serif] [cambria] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] diff --git a/tex/context/fonts/mkiv/type-imp-concrete.mkiv b/tex/context/fonts/mkiv/type-imp-concrete.mkiv index 5e4e6bc76..0ecee3e8b 100644 --- a/tex/context/fonts/mkiv/type-imp-concrete.mkiv +++ b/tex/context/fonts/mkiv/type-imp-concrete.mkiv @@ -20,7 +20,7 @@ %\definefontfeature[default-slanted-concrete][default][slant=.2] %\definefontfeature[none-slanted-concrete] [none] [slant=.2] - \starttypescript [\s!serif] [concrete-serif] + \starttypescript [\s!serif] [concrete] \definefontsynonym [\s!Serif] [\s!file:cmunorm] [\s!features=\s!default] \definefontsynonym [\s!SerifItalic] [\s!file:cmunoti] [\s!features=\s!default] \definefontsynonym [\s!SerifSlanted] [\s!file:cmunorm] [\s!features=default-slanted-concrete] @@ -29,7 +29,7 @@ \definefontsynonym [\s!SerifBoldSlanted] [\s!file:cmunobx] [\s!features=default-slanted-concrete] \stoptypescript - \starttypescript [\s!sans] [concrete-sans] + \starttypescript [\s!sans] [concrete] \definefontsynonym [\s!Sans] [\s!file:cmunss] [\s!features=\s!default] \definefontsynonym [\s!SansItalic] [\s!file:cmunsi] [\s!features=\s!default] \definefontsynonym [\s!SansSlanted] [\s!file:cmunss] [\s!features=default-slanted-concrete] @@ -38,7 +38,7 @@ \definefontsynonym [\s!SansBoldSlanted] [\s!file:cmunsx] [\s!features=default-slanted-concrete] \stoptypescript - \starttypescript [\s!mono] [concrete-mono] + \starttypescript [\s!mono] [concrete] \definefontsynonym [\s!Mono] [\s!file:cmuntt] [\s!features=\s!none] \definefontsynonym [\s!MonoItalic] [\s!file:cmunit] [\s!features=\s!none] \definefontsynonym [\s!MonoSlanted] [\s!file:cmunst] [\s!features=\s!none] @@ -47,16 +47,26 @@ \definefontsynonym [\s!MonoBoldSlanted] [\s!file:cmuntb] [\s!features=none-slanted-concrete] \stoptypescript - \starttypescript [\s!math] [concrete-math] [\s!name] + \starttypescript [\s!math] [concrete] + \checkedmapfontsize[\typescripttwo][\s!script] [.76] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60] + \stoptypescript + + \starttypescript [\s!math] [concrete] [\s!name] \loadfontgoodies[concrete-math] \definefontsynonym[\s!MathRoman] [\s!file:Concrete-Math.otf] [\s!features={\s!math\mathsizesuffix,mathextra,concrete:mathextra},\s!goodies=concrete-math] \stoptypescript - \starttypescript [concrete] - \definetypeface [concrete] [\s!rm] [\s!serif] [concrete-serif] [\s!default] - \definetypeface [concrete] [\s!ss] [\s!sans] [concrete-sans] [\s!default] - \definetypeface [concrete] [\s!tt] [\s!mono] [concrete-mono] [\s!default] - \definetypeface [concrete] [\s!mm] [\s!math] [concrete-math] [\s!default] + \starttypescript [\s!math] [concrete-nt] [\s!name] + \loadfontgoodies[concrete-math] + \definefontsynonym[\s!MathRoman] [\s!file:Concrete-Math.otf] [\s!features={\s!math\mathsizesuffix,mathextra,concrete:mathextra}] + \stoptypescript + + \starttypescript [concrete,concrete-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [concrete] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [concrete] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [concrete] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] \quittypescriptscanning \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv index fdd1ec5e3..d6fe406fb 100644 --- a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv +++ b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv @@ -16,7 +16,7 @@ \definefontfeature[dejavu-condensed-mono][extend=.8] -\starttypescriptcollection[dejavu] +\starttypescriptcollection[xxdejavu] \doifunknownfontfeature {dejavu-math-bold} {\definefontfeature[dejavu-math-bold][boldened]} @@ -44,27 +44,36 @@ \definefontsynonym [\s!MonoBoldItalic] [\s!name:dejavusansmonoboldoblique] [\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic] \stoptypescript - \starttypescript [\s!math][dejavu] [\s!name] + \starttypescript [\s!math] [dejavu,dejavu-nt,dejavu-condensed] + \checkedmapfontsize[\typescripttwo][\s!script] [.80] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.65] + \stoptypescript + + \starttypescript [\s!math] [dejavu] [\s!name] \loadfontgoodies[dejavu-math] \definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=dejavu-math,\s!fallbacks=\s!Math] \definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,dejavu-math-bold,mathextra},\s!goodies=dejavu-math,\s!fallbacks=\s!Math] \stoptypescript - - \starttypescript[dejavu] - \definetypeface [dejavu] [\s!rm] [\s!serif] [dejavu] [\s!default] - \definetypeface [dejavu] [\s!ss] [\s!sans] [dejavu] [\s!default] - \definetypeface [dejavu] [\s!tt] [\s!mono] [dejavu] [\s!default] - % \definetypeface [dejavu] [\s!mm] [\s!math] [xits] [\s!default] [\s!rscale=1.2] - \definetypeface [dejavu] [\s!mm] [\s!math] [dejavu] [\s!default] + \starttypescript [\s!math] [dejavu-nt] [\s!name] + \loadfontgoodies[dejavu-math] + \definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,mathextra}] + \definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,dejavu-math-bold,mathextra}] \stoptypescript - \starttypescript[dejavubidi] - \definetypeface [dejavu] [\s!rm] [\s!serif] [dejavu] [\s!default] - \definetypeface [dejavu] [\s!ss] [\s!sans] [dejavu] [\s!default] - \definetypeface [dejavu] [\s!tt] [\s!mono] [dejavu] [\s!default] - \definetypeface [dejavu] [\s!mm] [\s!math] [xitsbidi] [\s!default] [\s!rscale=1.2] + \starttypescript[dejavu,dejavu-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] \stoptypescript + % \starttypescript[dejavubidi] + % \definetypeface [dejavu] [\s!rm] [\s!serif] [dejavu] [\s!default] + % \definetypeface [dejavu] [\s!ss] [\s!sans] [dejavu] [\s!default] + % \definetypeface [dejavu] [\s!tt] [\s!mono] [dejavu] [\s!default] + % \definetypeface [dejavu] [\s!mm] [\s!math] [xitsbidi] [\s!default] [\s!rscale=1.2] + % \stoptypescript + \starttypescript [\s!serif] [dejavu-condensed] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [\s!name:dejavuserifcondensed] [\s!features=\s!default] diff --git a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv index 32c1528ad..1785eacc7 100644 --- a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv +++ b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv @@ -65,16 +65,24 @@ \definefontsynonym [\s!SerifCaps] [\s!Serif] [\s!features=eb-garamond-smallcaps] \stoptypescript + \starttypescript [\s!math] [ebgaramond,ebgaramond-nt] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.50] + \stoptypescript + \starttypescript [\s!math] [ebgaramond] [\s!name] - \loadfontgoodies[garamond-math] - \definefontsynonym [\s!MathRoman] [\s!file:garamond-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=garamond-math] + \definefontsynonym [\s!MathRoman] [\s!file:garamond-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=ebgaramond-math] + \stoptypescript + + \starttypescript [\s!math] [ebgaramond-nt] [\s!name] + \definefontsynonym [\s!MathRoman] [\s!file:garamond-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra}] \stoptypescript - \starttypescript[ebgaramond] - \definetypeface [ebgaramond] [\s!rm] [\s!serif] [ebgaramond] [\s!default] - \definetypeface [ebgaramond] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.8] - % \definetypeface [ebgaramond] [\s!mm] [\s!math] [bonum] [\s!default] [\s!rscale=0.8] - \definetypeface [ebgaramond] [\s!mm] [\s!math] [ebgaramond] [\s!default] + \starttypescript[ebgaramond,ebgaramond-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [ebgaramond] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.8] + % \definetypeface [\typescriptone] [\s!mm] [\s!math] [bonum] [\s!default] [\s!rscale=0.8] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] \stoptypescript \stoptypescriptcollection diff --git a/tex/context/fonts/mkiv/type-imp-erewhon.mkiv b/tex/context/fonts/mkiv/type-imp-erewhon.mkiv index 8f38fb8b0..5c705400f 100644 --- a/tex/context/fonts/mkiv/type-imp-erewhon.mkiv +++ b/tex/context/fonts/mkiv/type-imp-erewhon.mkiv @@ -20,7 +20,7 @@ %\definefontfeature[default-slanted-erewhon][default][slant=.2] %\definefontfeature[none-slanted-erewhon] [none] [slant=.2] - \starttypescript [\s!serif] [erewhon-serif] + \starttypescript [\s!serif] [erewhon] \definefontsynonym [\s!Serif] [\s!file:Erewhon-Regular] [\s!features=\s!default] \definefontsynonym [\s!SerifItalic] [\s!file:Erewhon-Italic] [\s!features=\s!default] \definefontsynonym [\s!SerifSlanted] [\s!file:Erewhon-RegularSlanted][\s!features=\s!default] @@ -30,6 +30,7 @@ \stoptypescript \starttypescript [\s!sans] [cabin-sans] + \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [\s!file:Cabin-Regular] [\s!features=\s!default] \definefontsynonym [\s!SansItalic] [\s!file:Cabin-Italic] [\s!features=\s!default] \definefontsynonym [\s!SansBold] [\s!file:Cabin-SemiBold] [\s!features=\s!default] @@ -37,20 +38,29 @@ \stoptypescript \starttypescript [\s!mono] [inconsolata-mono] + \setups[\s!font:\s!fallback:\s!mono] \definefontsynonym [\s!Mono] [\s!file:Inconsolatazi4-Regular][\s!features=\s!none] \definefontsynonym [\s!MonoBold][\s!file:Inconsolatazi4-Bold] [\s!features=\s!none] \stoptypescript - \starttypescript [\s!math] [erewhon-math] [\s!name] - \loadfontgoodies[erewhon-math] - \definefontsynonym [\s!MathRoman] [\s!file:Erewhon-Math.otf] [\s!features={\s!math\mathsizesuffix,erewhon:mathextra,mathextra},\s!goodies=erewhon-math] + \starttypescript [\s!math] [erewhon,erewhon-nt] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] \stoptypescript - \starttypescript [erewhon] - \definetypeface [erewhon] [\s!rm] [\s!serif] [erewhon-serif] [\s!default] - \definetypeface [erewhon] [\s!ss] [\s!sans] [cabin-sans] [\s!default] - \definetypeface [erewhon] [\s!tt] [\s!mono] [inconsolata-mono] [\s!default] [\s!rscale=1.1] - \definetypeface [erewhon] [\s!mm] [\s!math] [erewhon-math] [\s!default] + \starttypescript [\s!math] [erewhon] [\s!name] + \definefontsynonym [\s!MathRoman][\s!file:Erewhon-Math.otf][\s!features={\s!math\mathsizesuffix,erewhon:mathextra,mathextra},\s!goodies=erewhon-math] + \stoptypescript + + \starttypescript [\s!math] [erewhon-nt] [\s!name] + \definefontsynonym [\s!MathRoman][\s!file:Erewhon-Math.otf][\s!features={\s!math\mathsizesuffix,erewhon:mathextra,mathextra}] + \stoptypescript + + \starttypescript [erewhon,erewhon-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [erewhon] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [cabin] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [inconsolata] [\s!default] [\s!rscale=1.1] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] \quittypescriptscanning \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-euler.mkiv b/tex/context/fonts/mkiv/type-imp-euler.mkiv index 1aea88aae..4901c1dcb 100644 --- a/tex/context/fonts/mkiv/type-imp-euler.mkiv +++ b/tex/context/fonts/mkiv/type-imp-euler.mkiv @@ -11,6 +11,10 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% Instead of euler.otf we now use euler-math.otf which is a copy of the version +% that Daniel Flipo maintains now. We will also make an euler-regular.otf for +% text usage (which might have slighty different metrics then). + \loadtypescriptfile[texgyre] \loadtypescriptfile[dejavu] @@ -21,10 +25,10 @@ % 0x1D455 : italic h -\definefontfallback [euleroverpagella] [\s!file:euler.otf] [0x02100-0x02BFF] [\s!check=yes,\c!force=yes] -\definefontfallback [euleroverpagella] [\s!file:euler.otf] [0x1D400-0x1D7FF] [\s!check=yes,\c!force=yes] -\definefontfallback [euleroverpagella] [texgyrepagella-math] [0x0210E] [\s!check=yes,\c!force=\v!yes] -%definefontfallback [euleroverpagella] [\s!file:euler.otf] [0x1D538-0x1D550] [\s!check=yes,\c!force=yes] +\definefontfallback [euleroverpagella] [\s!file:euler-math.otf] [0x02100-0x02BFF] [\s!check=yes,\c!force=yes] +\definefontfallback [euleroverpagella] [\s!file:euler-math.otf] [0x1D400-0x1D7FF] [\s!check=yes,\c!force=yes] +\definefontfallback [euleroverpagella] [texgyrepagella-math] [0x0210E] [\s!check=yes,\c!force=\v!yes] +%definefontfallback [euleroverpagella] [\s!file:euler-math.otf] [0x1D538-0x1D550] [\s!check=yes,\c!force=yes] \definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x02100-0x02BFF] [\s!check=yes] \definefontfallback [pagellaovereuler] [texgyrepagella-math] [0x1D400-0x1D7FF] [\s!check=yes] @@ -43,12 +47,12 @@ \starttypescript [\s!serif] [eulernova] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [\s!file:euler.otf] [\s!features=\s!default] + \definefontsynonym [\s!Serif] [\s!file:euler-math.otf] [\s!features=\s!default] \stoptypescript \starttypescript [\s!math] [eulernova] [\s!name] % \loadfontgoodies[euler-math] - \definefontsynonym [MathRoman] [\s!file:euler.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=euler-math] + \definefontsynonym [MathRoman] [\s!file:euler-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=euler-math] \stoptypescript \starttypescript [pagella-eulernova] @@ -70,7 +74,7 @@ \stoptypescript \starttypescript [\s!math] [pagellaovereuler] [\s!name] - \definefontsynonym [MathRoman] [\s!file:euler.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!fallbacks=pagellaovereuler,\s!goodies=euler-with-pagella-math] + \definefontsynonym [MathRoman] [\s!file:euler-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!fallbacks=pagellaovereuler,\s!goodies=euler-with-pagella-math] \stoptypescript \starttypescript [pagella-with-euler] diff --git a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv index 77a7a0bb2..7f819fe3c 100644 --- a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv +++ b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv @@ -15,20 +15,20 @@ \starttypescriptcollection[kpfonts-opentype] - \doifunknownfontfeature {kp-sans-bold} {\definefontfeature[kp-sans-bold][boldened]} + \doifunknownfontfeature {kp-sans-bold} {\definefontfeature[kp-sans-bold][boldened-15]} - \starttypescript [kpfonts,kpfonts-light,kpfonts-bold,kpfonts-sans] + \starttypescript [kpfonts,kpfonts-light,kpfonts-bold,kpfonts-sans,kpfonts-nt] \loadfontgoodies[kpfonts-math] - \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!features=\s!default] - \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!features=\s!default] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] [\s!features=\s!none] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!features=\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!features=\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] [\s!features=\s!none] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] % for the moment here: % \setupmathrendering[\typescriptone][\s!it=\s!italic] \quittypescriptscanning \stoptypescript - \starttypescript [\s!serif] [kpfonts,kpfonts-sans] + \starttypescript [\s!serif] [kpfonts,kpfonts-sans,kpfonts-nt] \definefontsynonym [\s!Serif] [\s!file:KpRoman-Regular.otf] \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-SemiBold.otf] \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf] @@ -52,35 +52,39 @@ \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-Bold.otf] \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf] \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-BoldItalic.otf] - % \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic] - % \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic] \stoptypescript - \starttypescript [\s!sans] [kpfonts,kpfonts-sans,kpfonts-light,kpfonts-bold] + \starttypescript [\s!sans] [kpfonts,kpfonts-sans,kpfonts-light,kpfonts-bold,kpfonts-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [\s!file:KpSans-Regular.otf] \definefontsynonym [\s!SansBold] [\s!file:KpSans-Bold.otf] \definefontsynonym [\s!SansItalic] [\s!file:KpSans-Italic.otf] \definefontsynonym [\s!SansBoldItalic] [\s!file:KpSans-BoldItalic.otf] - % \definefontsynonym [\s!SansSlanted] [\s!SansItalic] - % \definefontsynonym [\s!SansBoldSlanted] [\s!SansBoldItalic] \stoptypescript - \starttypescript [\s!mono] [kpfonts,kpfonts-sans,kpfonts-light,kpfonts-bold] + \starttypescript [\s!mono] [kpfonts,kpfonts-sans,kpfonts-light,kpfonts-bold,kpfonts-nt] \setups[\s!font:\s!fallback:\s!mono] \definefontsynonym [\s!Mono] [\s!file:KpMono-Regular.otf] \definefontsynonym [\s!MonoBold] [\s!file:KpMono-Bold.otf] \definefontsynonym [\s!MonoItalic] [\s!file:KpMono-Italic.otf] \definefontsynonym [\s!MonoBoldItalic] [\s!file:KpMono-BoldItalic.otf] - % \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic] - % \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic] \stoptypescript - \starttypescript [\s!math] [kpfonts,kpfonts-bold] + \starttypescript [\s!math] [kpfonts,kpfonts-nt,kpfonts-bold,kpfonts-light,kpfonts-sans] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] + \stoptypescript + + \starttypescript [\s!math] [kpfonts] \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math] \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Semibold.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math] \stoptypescript + \starttypescript [\s!math] [kpfonts-nt] + \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra}] + \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Semibold.otf] [\s!features={\s!math\mathsizesuffix,mathextra}] + \stoptypescript + \starttypescript [\s!math] [kpfonts-bold] \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math] \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Bold.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math] @@ -93,7 +97,7 @@ \starttypescript [\s!math] [kpfonts-sans] \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Sans.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math] - \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Sans.otf] [\s!features={\s!math\mathsizesuffix,lm-math-bold,mathextra},\s!goodies=kpfonts-math] + \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Sans.otf] [\s!features={\s!math\mathsizesuffix,kp-sans-bold,mathextra},\s!goodies=kpfonts-math] \stoptypescript \stoptypescriptcollection diff --git a/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv b/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv index e8e8e353b..f5082f784 100644 --- a/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv +++ b/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv @@ -71,7 +71,7 @@ \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular] [\s!features=\s!none] \stoptypescript - \starttypescript [\s!math] [modern,latin-modern-designsize,latin-modern] [\s!name] + \starttypescript [\s!math] [modern,latin-modern-designsize,latin-modern,modern-nt] [\s!name] \loadfontgoodies[lm] \definefontsynonym [\s!MathRoman] [LMMathRoman-Regular] \definefontsynonym [\s!MathRomanBold] [LMMathRoman-Bold] @@ -173,16 +173,23 @@ \definefontsynonym [LMTypewriterVarWd-DarkOblique] [\s!file:lmmonoproplt10-boldoblique] [\s!features=\s!default] \stoptypescript -% \starttypescript [\s!math] [modern,latin-modern] -% \loadfontgoodies[lm] -% \definefontsynonym [LMMathRoman-Regular] [\v!file:latinmodern-math-regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=lm] -% \definefontsynonym [LMMathRoman-Bold] [\v!file:latinmodern-math-regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=lm] -% \stoptypescript + \starttypescript [\s!math] [modern,modern-nt,latin-modern,modern-designsize,modern-base,% + modernvariable,modern-variable,% + modernvariablelight,modern-variable-light,% + modern-mono,modern-base-mono] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.50] + \stoptypescript \starttypescript [\s!math] [modern,latin-modern] \loadfontgoodies[lm] - \definefontsynonym [LMMathRoman-Regular] [\v!file:latinmodern-math-regular.otf] [\s!features={\s!math\mathsizesuffix,lm:mathextra,lm-math,mathextra},\s!goodies=lm] - \definefontsynonym [LMMathRoman-Bold] [\v!file:latinmodern-math-regular.otf] [\s!features={\s!math\mathsizesuffix,lm:mathextra,lm-math-bold,lm-math,mathextra},\s!goodies=lm] + \definefontsynonym [LMMathRoman-Regular] [\v!file:latinmodern-math.otf] [\s!features={\s!math\mathsizesuffix,lm:mathextra,lm-math,mathextra},\s!goodies=modern-math] + \definefontsynonym [LMMathRoman-Bold] [\v!file:latinmodern-math.otf] [\s!features={\s!math\mathsizesuffix,lm:mathextra,lm-math-bold,lm-math,mathextra},\s!goodies=modern-math] + \stoptypescript + \starttypescript [\s!math] [modern-nt] + \loadfontgoodies[lm] + \definefontsynonym [LMMathRoman-Regular] [\v!file:latinmodern-math.otf] [\s!features={\s!math\mathsizesuffix,lm:mathextra,lm-math,mathextra}] + \definefontsynonym [LMMathRoman-Bold] [\v!file:latinmodern-math.otf] [\s!features={\s!math\mathsizesuffix,lm:mathextra,lm-math-bold,lm-math,mathextra}] \stoptypescript \starttypescript [modern-designsize-virtual] @@ -209,6 +216,14 @@ \quittypescriptscanning \stoptypescript + \starttypescript [modern-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [modern] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [modern-nt] [\s!default] + \quittypescriptscanning + \stoptypescript + \starttypescript [modernvariable,modern-variable] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [modern-variable] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern-variable] [\s!default] diff --git a/tex/context/fonts/mkiv/type-imp-libertinus.mkiv b/tex/context/fonts/mkiv/type-imp-libertinus.mkiv index 38804cf79..6e084c14e 100644 --- a/tex/context/fonts/mkiv/type-imp-libertinus.mkiv +++ b/tex/context/fonts/mkiv/type-imp-libertinus.mkiv @@ -71,17 +71,28 @@ \definefontsynonym [\s!Mono] [LibertinusMono-Regular] [\s!features=\s!none] \stoptypescript + \starttypescript [\s!math] [libertinus,libertinus-nt] + \checkedmapfontsize[\typescripttwo][\s!script] [.80] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60] + \stoptypescript + \starttypescript [\s!math] [libertinus] [\s!name] \loadfontgoodies[libertinus-math] \definefontsynonym[\s!MathRoman ] [\s!file:libertinusmath-regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=libertinus-math.lfg] \definefontsynonym[\s!MathRomanBold] [\s!file:libertinusmath-regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=libertinus-math.lfg] \stoptypescript - \starttypescript [libertinus] - \definetypeface [libertinus] [\s!rm] [\s!serif] [libertinus] [\s!default] - \definetypeface [libertinus] [\s!ss] [\s!sans] [libertinus] [\s!default] - \definetypeface [libertinus] [\s!tt] [\s!mono] [libertinus] [\s!default] - \definetypeface [libertinus] [\s!mm] [\s!math] [libertinus] [\s!default] + \starttypescript [\s!math] [libertinus-nt] [\s!name] + \loadfontgoodies[libertinus-math] + \definefontsynonym[\s!MathRoman ] [\s!file:libertinusmath-regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra}] + \definefontsynonym[\s!MathRomanBold] [\s!file:libertinusmath-regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra}] + \stoptypescript + + \starttypescript [libertinus,libertinus-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [libertinus] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [libertinus] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [libertinus] [\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] \quittypescriptscanning \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-lucida-opentype.mkiv b/tex/context/fonts/mkiv/type-imp-lucida-opentype.mkiv deleted file mode 100644 index 7237f7d08..000000000 --- a/tex/context/fonts/mkiv/type-imp-lucida-opentype.mkiv +++ /dev/null @@ -1,87 +0,0 @@ -%D \module -%D [ file=type-lucida-opentype, -%D version=2011.05.18, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Lucida Nova Opentype, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% NOTA BENE: class features and goodies get expanded! - -\definefontfeature[mathlucida][copymathscripts=yes] % see lfg file - -% \definefontfeature[mathlucida][mathlucida][ss04=yes] % now we swap - -% \definefontfeature[mathlucida][ss03=yes] - -\starttypescriptcollection[lucida-opentype] - - \starttypescript [lucida,lucidaot,lucidadk] - \loadfontgoodies[lucida-opentype-math] - \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!features=\s!default] - \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!features=\s!default] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] [\s!features=\s!none] - \definetypeface [\typescriptone] [\s!hw] [\s!handwriting] [\typescriptone] [\s!default] [\s!features=\s!default] - \definetypeface [\typescriptone] [\s!cg] [\s!calligraphy] [\typescriptone] [\s!default] [\s!features=\s!default] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] - % no longer: \setupmathrendering[\typescriptone][\s!it=\s!italic] - \quittypescriptscanning - \stoptypescript - - \starttypescript [\s!serif] [lucida,lucidaot,lucidadk] - \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf] - \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf] - \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:LucidaBrightOT-DemiItalic.otf] - \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic] - \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic] - \stoptypescript - - \starttypescript [\s!sans] [lucida,lucidaot,lucidadk] - \definefontsynonym [\s!Sans] [\s!file:LucidaSansOT.otf] - \definefontsynonym [\s!SansBold] [\s!file:LucidaSansOT-Demi.otf] - \definefontsynonym [\s!SansItalic] [\s!file:LucidaSansOT-Italic.otf] - \definefontsynonym [\s!SansBoldItalic] [\s!file:LucidaSansOT-DemiItalic.otf] - \definefontsynonym [\s!SansSlanted] [\s!SansItalic] - \definefontsynonym [\s!SansBoldSlanted] [\s!SansBoldItalic] - \stoptypescript - - \starttypescript [\s!mono] [lucida,lucidaot] - \definefontsynonym [\s!Mono] [\s!file:LucidaSansTypewriterOT.otf] - \definefontsynonym [\s!MonoBold] [\s!file:LucidaSansTypewriterOT-Bold.otf] - \definefontsynonym [\s!MonoItalic] [\s!file:LucidaSansTypewriterOT-Oblique.otf] - \definefontsynonym [\s!MonoBoldItalic] [\s!file:LucidaSansTypewriterOT-BoldOblique.otf] - \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic] - \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic] - \stoptypescript - - \starttypescript [\s!mono] [lucidadk] - \definefontsynonym [\s!Mono] [\s!file:LucidaGrandeMonoDK.otf] - \definefontsynonym [\s!MonoBold] [\s!file:LucidaGrandeMonoDK-Bold.otf] - \definefontsynonym [\s!MonoItalic] [\s!file:LucidaGrandeMonoDK-Oblique.otf] - \definefontsynonym [\s!MonoBoldItalic] [\s!file:LucidaGrandeMonoDK-BoldOblique.otf] - \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic] - \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic] - \stoptypescript - - \starttypescript [\s!math] [lucida,lucidaot,lucidadk] - \definefontsynonym [\s!MathRoman] [\s!file:LucidaBrightMathOT.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra},\s!goodies=lucida-opentype-math] - \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra},\s!goodies=lucida-opentype-math] - \stoptypescript - - \starttypescript [\s!handwriting] [lucida,lucidaot,lucidadk] - \definefontsynonym [\s!Handwriting] [\s!file:LucidaHandwritingOT.otf] - \stoptypescript - - \starttypescript [\s!calligraphy] [lucida,lucidaot,lucidadk] - \definefontsynonym [\s!Calligraphy] [\s!file:LucidaCalligraphyOT.otf] - \stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/fonts/mkiv/type-imp-lucida.mkiv b/tex/context/fonts/mkiv/type-imp-lucida.mkiv new file mode 100644 index 000000000..ced61dcd2 --- /dev/null +++ b/tex/context/fonts/mkiv/type-imp-lucida.mkiv @@ -0,0 +1,96 @@ +%D \module +%D [ file=type-lucida-opentype, +%D version=2011.05.18, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Lucida Nova Opentype, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% NOTA BENE: class features and goodies get expanded! + +\definefontfeature[mathlucida][copymathscripts=yes] % see lfg file + +% \definefontfeature[mathlucida][mathlucida][ss04=yes] % now we swap + +% \definefontfeature[mathlucida][ss03=yes] + +\starttypescriptcollection[lucida-opentype] + + \starttypescript [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] + \loadfontgoodies[lucida-opentype-math] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!features=\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!features=\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] [\s!features=\s!none] + \definetypeface [\typescriptone] [\s!hw] [\s!handwriting] [\typescriptone] [\s!default] [\s!features=\s!default] + \definetypeface [\typescriptone] [\s!cg] [\s!calligraphy] [\typescriptone] [\s!default] [\s!features=\s!default] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] + \quittypescriptscanning + \stoptypescript + + \starttypescript [\s!serif] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] + \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf] + \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf] + \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:LucidaBrightOT-DemiItalic.otf] + \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic] + \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic] + \stoptypescript + + \starttypescript [\s!sans] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] + \definefontsynonym [\s!Sans] [\s!file:LucidaSansOT.otf] + \definefontsynonym [\s!SansBold] [\s!file:LucidaSansOT-Demi.otf] + \definefontsynonym [\s!SansItalic] [\s!file:LucidaSansOT-Italic.otf] + \definefontsynonym [\s!SansBoldItalic] [\s!file:LucidaSansOT-DemiItalic.otf] + \definefontsynonym [\s!SansSlanted] [\s!SansItalic] + \definefontsynonym [\s!SansBoldSlanted] [\s!SansBoldItalic] + \stoptypescript + + \starttypescript [\s!mono] [lucida,lucidaot,lucidaot-nt,lucida-nt] + \definefontsynonym [\s!Mono] [\s!file:LucidaSansTypewriterOT.otf] + \definefontsynonym [\s!MonoBold] [\s!file:LucidaSansTypewriterOT-Bold.otf] + \definefontsynonym [\s!MonoItalic] [\s!file:LucidaSansTypewriterOT-Oblique.otf] + \definefontsynonym [\s!MonoBoldItalic] [\s!file:LucidaSansTypewriterOT-BoldOblique.otf] + \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic] + \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic] + \stoptypescript + + \starttypescript [\s!mono] [lucidadk,lucidaot-nt,lucida-nt] + \definefontsynonym [\s!Mono] [\s!file:LucidaGrandeMonoDK.otf] + \definefontsynonym [\s!MonoBold] [\s!file:LucidaGrandeMonoDK-Bold.otf] + \definefontsynonym [\s!MonoItalic] [\s!file:LucidaGrandeMonoDK-Oblique.otf] + \definefontsynonym [\s!MonoBoldItalic] [\s!file:LucidaGrandeMonoDK-BoldOblique.otf] + \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic] + \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic] + \stoptypescript + + \starttypescript [\s!math] [lucida,lucida-nt,lucidaot,lucidaot-nt,lucidadk] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.50] + \stoptypescript + + \starttypescript [\s!math] [lucida,lucidaot,lucidadk] + \definefontsynonym [\s!MathRoman] [\s!file:LucidaBrightMathOT.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra},\s!goodies=lucida-math] + \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra},\s!goodies=lucida-math] + \stoptypescript + + \starttypescript [\s!math] [lucidaot-nt,lucida-nt] + \definefontsynonym [\s!MathRoman] [\s!file:LucidaBrightMathOT.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra}] + \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra}] + \stoptypescript + + \starttypescript [\s!handwriting] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] + \definefontsynonym [\s!Handwriting] [\s!file:LucidaHandwritingOT.otf] + \stoptypescript + + \starttypescript [\s!calligraphy] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] + \definefontsynonym [\s!Calligraphy] [\s!file:LucidaCalligraphyOT.otf] + \stoptypescript + +\stoptypescriptcollection + +\endinput diff --git a/tex/context/fonts/mkiv/type-imp-stix.mkiv b/tex/context/fonts/mkiv/type-imp-stix.mkiv index ed2b63909..503566318 100644 --- a/tex/context/fonts/mkiv/type-imp-stix.mkiv +++ b/tex/context/fonts/mkiv/type-imp-stix.mkiv @@ -13,19 +13,23 @@ %D We provide typescripts for version one and two of the stix fonts. There is a %D xits variant based on the first (not opentype) release that also provides -%D bidirectional math. +%D bidirectional math. With (in 2022) stixtwo being frozsen for 2 years we can make +%D these the default now. %D %D Users should be aware of the fact that the stix filenames keep changing so if %D something fails, make sure you have the files and that the names below match -%D those on your system. (In \TEX\ distributions there's 2 and Two and math can have -%D -Regular appended or not. +%D those on your system. In \TEX\ distributions there's 2 and Two and math can have +%D -Regular appended or not. You can expect the \CONTEXT\ distribution to be kept up +%D to date. %D -%D There's now also: -%D -%D stixtwotext-medium.otf -%D stixtwotext-mediumitalic.otf -%D stixtwotext-semibold.otf -%D stixtwotext-semibolditalic.otf +%D Per november 2022 we swithched from \OPENTYPE\ (otf) files to \TRUETYPE\ (ttf) +%D files. The main reason is that the metrics are cleaner, especially when one peeks +%D into the font for the purpose tweaking math (boundingbox, true positioning +%D unaffected by excessive hinting shown in in FontForge). It is yet unclear to us +%D (MS & HH) why there is this difference, but it might relate to the toolchain used +%D for generating these fonts. We might even switch to (smaller) unhinted \TRUETYPE\ +%D fonts at some point but then we need to generate them ourselves). Anyway, the end +%D results are the same but we just want to be able to view it right. \definefontfeature [stixtwomath] @@ -35,23 +39,41 @@ \starttypescriptcollection[stix] + \doifunknownfontfeature {stixtwo-math-bold} {\definefontfeature[stixtwo-math-bold][boldened]} + + \starttypescript [\s!math] [stix,stixtwo,stix-nt,stixtwo-nt,xits] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] + \stoptypescript + \starttypescript [\s!math] [stix,stixtwo,xits] [\s!name] - \definefontsynonym[\s!MathRoman][\s!file:stixtwomath-regular.otf][\s!features={\s!math\mathsizesuffix,stixtwomath,mathextra},\s!goodies=stix-two-math] + \definefontsynonym[\s!MathRoman] [\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwomath,stixtwo:mathextra,mathextra},\s!goodies=stixtwo-math] + \definefontsynonym[\s!MathRomanBold][\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwo-math-bold,stixtwomath,stixtwo:mathextra,mathextra},\s!goodies=stixtwo-math] + \stoptypescript + + \starttypescript [\s!math] [stix-nt,stixtwo-nt] [\s!name] + \definefontsynonym[\s!MathRoman][\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwomath,stixtwo:mathextra,mathextra}] + \definefontsynonym[\s!MathRoman][\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwo-math-bold,stixtwomath,stixtwo:mathextra,mathextra}] \stoptypescript \starttypescript [\s!serif] [stix,stixtwo,xits] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym[\s!Serif] [\s!file:stixtwotext-regular.otf] [\s!features=\s!default] - \definefontsynonym[\s!SerifBold] [\s!file:stixtwotext-bold.otf] [\s!features=\s!default] - \definefontsynonym[\s!SerifItalic] [\s!file:stixtwotext-italic.otf] [\s!features=\s!default] - \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.otf][\s!features=\s!default] + \definefontsynonym[\s!Serif] [\s!file:stixtwotext-regular.ttf] [\s!features=\s!default] + \definefontsynonym[\s!SerifBold] [\s!file:stixtwotext-bold.ttf] [\s!features=\s!default] + \definefontsynonym[\s!SerifItalic] [\s!file:stixtwotext-italic.ttf] [\s!features=\s!default] + \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.ttf][\s!features=\s!default] \stoptypescript + \starttypescript[stix,stixtwo,xits,stix-nt,stixtwo-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [stixtwo] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!serif] [stixtwo] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.895] + \stoptypescript \starttypescript[stix,stixtwo,xits] - \definetypeface [\typescriptone] [\s!rm] [\s!serif] [stixtwo] [\s!default] - \definetypeface [\typescriptone] [\s!ss] [\s!serif] [stixtwo] [\s!default] - \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.895] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [stixtwo] [\s!default] [\s!direction=\s!both] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [stixtwo] [\s!default] [\s!direction=\s!both] + \stoptypescript + \starttypescript[stix-nt,stixtwo-nt] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [stixtwo-nt] [\s!default] [\s!direction=\s!both] \stoptypescript \stoptypescriptcollection diff --git a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv index c6b0ab28b..87009f11e 100644 --- a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv +++ b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv @@ -1,4 +1,4 @@ -%D \module + %D \module %D [ file=type-imp-texgyre, %D version=2007.07.30, %D title=\CONTEXT\ Typescript Macros, @@ -163,37 +163,61 @@ % caps: \definetypeface [pagella] [rm] [serif] [pagella-caps] [default] - \starttypescript [times,termes] + \starttypescript [termes,termes-nt,times] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [helvetica] [\s!default] [\s!rscale=0.9] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.05] + \stoptypescript + \starttypescript [termes,times] \definetypeface [\typescriptone] [\s!mm] [\s!math] [termes] [\s!default] \quittypescriptscanning \stoptypescript + \starttypescript [termes-nt] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [termes-nt] [\s!default] + \quittypescriptscanning + \stoptypescript - \starttypescript [palatino,pagella] + \starttypescript [pagella,pagella-nt,palatino] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] [\s!rscale=1.075] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.075] + \stoptypescript + \starttypescript [pagella,palatino] \definetypeface [\typescriptone] [\s!mm] [\s!math] [pagella] [\s!default] \quittypescriptscanning \stoptypescript + \starttypescript [pagella-nt] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [pagella-nt] [\s!default] + \quittypescriptscanning + \stoptypescript - \starttypescript [schoolbook,schola] + \starttypescript [schola,schola-nt,schoolbook] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] [\s!rscale=1.1] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.1] + \stoptypescript + \starttypescript [schola,schoolbook] \definetypeface [\typescriptone] [\s!mm] [\s!math] [schola] [\s!default] \quittypescriptscanning \stoptypescript + \starttypescript [schola-nt] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [schola-nt] [\s!default] + \quittypescriptscanning + \stoptypescript - \starttypescript [bookman,bonum] + \starttypescript [bonum,bonum-nt,bookman] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] [\s!rscale=1.1] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.1] + \stoptypescript + \starttypescript [bookman,bonum] \definetypeface [\typescriptone] [\s!mm] [\s!math] [bonum] [\s!default] \quittypescriptscanning \stoptypescript + \starttypescript [bonum-nt] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [bonum-nt] [\s!default] + \quittypescriptscanning + \stoptypescript \starttypescript [chancery,chorus] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] @@ -240,9 +264,9 @@ \startmode[txmath] - \starttypescriptcollection[texgyre-math-times] + \starttypescriptcollection[texgyre-math-termes] - \starttypescript [\s!math][times,termes][\s!all] + \starttypescript [\s!math][termes,times][\s!all] \loadfontgoodies[tx-math] \definefontsynonym[\s!MathRoman][txmath@tx-math] % \definefontsynonym[\s!MathRomanBold][MathRoman] @@ -254,14 +278,20 @@ \startnotmode[txmath] - \starttypescriptcollection[texgyre-math-times] + \starttypescriptcollection[texgyre-math-termes] - \starttypescript [\s!math][times,termes][\s!all] - % \loadfontgoodies[texgyre] - % \definefontsynonym[\s!MathRoman][file:texgyre-termes-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] + \starttypescript [\s!math][termes,termes-nt,times][\s!all] + \checkedmapfontsize[\typescripttwo][\s!script] [.74] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] + \stoptypescript + \starttypescript [\s!math][termes,times][\s!all] \definefontsynonym[\s!MathRoman] [file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,termes:mathextra,mathextra},\s!goodies=termes-math] \definefontsynonym[\s!MathRomanBold][file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,termes:mathextra,termes-math-bold,mathextra},\s!goodies=termes-math] \stoptypescript + \starttypescript [\s!math][termes-nt][\s!all] + \definefontsynonym[\s!MathRoman] [file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,termes:mathextra,mathextra}] + \definefontsynonym[\s!MathRomanBold][file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,termes:mathextra,termes-math-bold,mathextra}] + \stoptypescript \stoptypescriptcollection @@ -285,12 +315,18 @@ \starttypescriptcollection[texgyre-math-pagella] - \starttypescript [\s!math][palatino,pagella][\s!all] - % \loadfontgoodies[texgyre] - % \definefontsynonym[\s!MathRoman][file:texgyre-pagella-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] + \starttypescript [\s!math][pagella,pagella-nt,palatino]% [\s!all] + \checkedmapfontsize[\typescripttwo][\s!script] [.74] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] + \stoptypescript + \starttypescript [\s!math][pagella,palatino][\s!all] \definefontsynonym[\s!MathRoman] [file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,pagella:mathextra,mathextra},\s!goodies=pagella-math] \definefontsynonym[\s!MathRomanBold][file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,pagella:mathextra,pagella-math-bold,mathextra},\s!goodies=pagella-math] \stoptypescript + \starttypescript [\s!math][pagella-nt][\s!all] + \definefontsynonym[\s!MathRoman] [file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,pagella:mathextra,mathextra}] + \definefontsynonym[\s!MathRomanBold][file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,pagella:mathextra,pagella-math-bold,mathextra}] + \stoptypescript \stoptypescriptcollection @@ -298,22 +334,34 @@ \starttypescriptcollection[texgyre-math-bonum] - \starttypescript [\s!math][bookman,bonum][\s!all] - % \loadfontgoodies[texgyre] - % \definefontsynonym[\s!MathRoman][file:texgyre-bonum-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] + \starttypescript [\s!math][bonum,bonum-nt,bookman][\s!all] + \checkedmapfontsize[\typescripttwo][\s!script] [.77] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60] + \stoptypescript + \starttypescript [\s!math][bonum,bookman][\s!all] \definefontsynonym[\s!MathRoman] [file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,bonum:mathextra,mathextra},\s!goodies=bonum-math] \definefontsynonym[\s!MathRomanBold][file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,bonum:mathextra,bonum-math-bold,mathextra},\s!goodies=bonum-math] \stoptypescript + \starttypescript [\s!math][bonum-nt][\s!all] + \definefontsynonym[\s!MathRoman] [file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,bonum:mathextra,mathextra}] + \definefontsynonym[\s!MathRomanBold][file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,bonum:mathextra,bonum-math-bold,mathextra}] + \stoptypescript \stoptypescriptcollection \starttypescriptcollection[texgyre-math-schola] - \starttypescript [\s!math][schoolbook,schola][\s!all] - % \loadfontgoodies[texgyre] - % \definefontsynonym[\s!MathRoman][file:texgyre-schola-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] + \starttypescript [\s!math][schola,schola-nt,schoolbook][\s!all] + \checkedmapfontsize[\typescripttwo][\s!script] [.77] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.60] + \stoptypescript + \starttypescript [\s!math][schola,schoolbook][\s!all] \definefontsynonym[\s!MathRoman] [file:texgyreschola-math.otf][\s!features={\s!math\mathsizesuffix,schola:mathextra,mathextra},\s!goodies=schola-math] \definefontsynonym[\s!MathRomanBold][file:texgyreschola-math.otf][\s!features={\s!math\mathsizesuffix,schola:mathextra,schola-math-bold,mathextra},\s!goodies=schola-math] \stoptypescript + \starttypescript [\s!math][schola-nt][\s!all] + \definefontsynonym[\s!MathRoman] [file:texgyreschola-math.otf][\s!features={\s!math\mathsizesuffix,schola:mathextra,mathextra}] + \definefontsynonym[\s!MathRomanBold][file:texgyreschola-math.otf][\s!features={\s!math\mathsizesuffix,schola:mathextra,schola-math-bold,mathextra}] + \stoptypescript \stoptypescriptcollection diff --git a/tex/context/fonts/mkiv/type-imp-xcharter.mkiv b/tex/context/fonts/mkiv/type-imp-xcharter.mkiv new file mode 100644 index 000000000..d27f4bcba --- /dev/null +++ b/tex/context/fonts/mkiv/type-imp-xcharter.mkiv @@ -0,0 +1,63 @@ +%D \module +%D [ file=type-imp-xcharter, +%D version=2022.30.09, % a bit older +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=XCharter fonts, +%D author=Mikael Sundqvist, +%D date=\currentdate, +%D copyright={\CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\starttypescriptcollection[xcharter] + + % \definefontfeature[default-slanted-xcharter][default][slant=.2] + % \definefontfeature[none-slanted-xcharter] [none] [slant=.2] + + \starttypescript [\s!serif] [xcharter] [\s!name] + \definefontsynonym [\s!Serif] [\s!file:XCharter-Roman] [\s!features=\s!default] + \definefontsynonym [\s!SerifItalic] [\s!file:XCharter-Italic] [\s!features=\s!default] + \definefontsynonym [\s!SerifSlanted] [\s!file:XCharter-Slanted] [\s!features=\s!default] + \definefontsynonym [\s!SerifBold] [\s!file:XCharter-Bold] [\s!features=\s!default] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:xcharter-BoldItalic] [\s!features=\s!default] + \definefontsynonym [\s!SerifBoldSlanted][\s!file:XCharter-BoldSlanted][\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!sans] [cabin] [\s!name] + \setups[\s!font:\s!fallback:\s!sans] + \definefontsynonym [\s!Sans] [\s!file:Cabin-Regular] [\s!features=\s!default] + \definefontsynonym [\s!SansItalic] [\s!file:Cabin-Italic] [\s!features=\s!default] + \definefontsynonym [\s!SansBold] [\s!file:Cabin-SemiBold] [\s!features=\s!default] + \definefontsynonym [\s!SansBoldItalic][\s!file:Cabin-SemiBoldItalic][\s!features=\s!default] + \stoptypescript + + \starttypescript [\s!mono] [inconsolata] [\s!name] + \setups[\s!font:\s!fallback:\s!mono] + \definefontsynonym [\s!Mono] [\s!file:Inconsolatazi4-Regular][\s!features=\s!none] + \definefontsynonym [\s!MonoBold][\s!file:Inconsolatazi4-Bold] [\s!features=\s!none] + \stoptypescript + + \starttypescript [\s!math] [xcharter,xcharter-nt][\s!name] + \checkedmapfontsize[\typescripttwo][\s!script] [.70] + \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55] + \stoptypescript + + \starttypescript [\s!math] [xcharter][\s!name] + \definefontsynonym [\s!MathRoman][\s!file:XCharter-Math.otf][\s!features={\s!math\mathsizesuffix,xcharter:mathextra,mathextra},\s!goodies=xcharter-math] + \stoptypescript + + \starttypescript [\s!math] [xcharter-nt] [\s!name] + \definefontsynonym [\s!MathRoman][\s!file:XCharter-Math.otf][\s!features={\s!math\mathsizesuffix,xcharter:mathextra,mathextra}] + \stoptypescript + + \starttypescript [xcharter,xcharter-nt] + \definetypeface [\typescriptone] [\s!rm] [\s!serif] [xcharter] [\s!default] + \definetypeface [\typescriptone] [\s!ss] [\s!sans] [cabin] [\s!default] + \definetypeface [\typescriptone] [\s!tt] [\s!mono] [inconsolata] [\s!default] [\s!rscale=1.1] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default] + \quittypescriptscanning + \stoptypescript + +\stoptypescriptcollection diff --git a/tex/context/fonts/mkiv/xcharter-math.lfg b/tex/context/fonts/mkiv/xcharter-math.lfg new file mode 100644 index 000000000..c9b5a2690 --- /dev/null +++ b/tex/context/fonts/mkiv/xcharter-math.lfg @@ -0,0 +1,127 @@ +-- This font is under active development so we don't want to tweek it too much +-- before all issues are sorted out. + +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + +return { + name = "xcharter-math", + version = "1.00", + comment = "Goodies that complement xcharter math.", + author = "Hans Hagen & Mikael Sundqvist", + copyright = "ConTeXt development team", + mathematics = { + parameters = { + -- NoLimitSupFactor = 0, + -- NoLimitSubFactor = 900, + -- AccentBaseHeight = 0, + -- AccentBaseDepth = 60, + -- RadicalDegreeBottomRaisePercent = 55, + -- RadicalKernAfterDegree = -600, + -- RadicalRuleThickness = 45, -- 55 in font + -- DelimiterPercent = 90, + -- DelimiterShortfall = 400, + -- DisplayOperatorMinHeight = 1800, -- 1300 in font (one size) + }, + tweaks = { + aftercopying = { + { + tweak = "fixprimes", + factor = 0.8, + scale = 1, + }, + { + tweak = "addmirrors", + }, +{ + tweak = "dimensions", + list = { + -- ["0x222B.variants.*"] = { axis = 0.15 }, + }, +}, +{ + -- tweak = "fixintegrals", +}, + presets.scripttocalligraphic { }, + presets.rsfstoscript { }, + presets.rsfsuprighttoscript { }, + presets.moderntocalligraphic { }, + presets.eulertocalligraphic { }, + presets.xitsarabic { rscale = 0.90 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { factor = 1.5 }, + presets.wipeitalics { }, + { + tweak = "kerns", + list = { + [0x002F] = { topleft = -0.15, bottomright = -0.15 }, + ["0x7D.parts.top"] = { topright = -0.15, }, -- right brace top + ["0x7D.parts.bottom"] = { bottomright = -0.15 }, -- right brace bottom + ["0x7D.variants.*"] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants + ["0x29.parts.top"] = { topright = -0.1, }, -- right parenthesis top + ["0x29.parts.bottom"] = { bottomright = -0.1 }, -- right parenthesis bottom + ["0x29.variants.*"] = { topright = -0.1, bottomright = -0.1 }, -- right parenthesis variants + ["0x221A.parts.top"] = { topright = 0.2, }, -- right radical top + ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants + [0x27E9] = { topright = -0.1, bottomright = -0.1 }, -- angle + ["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 }, + [0x27EB] = { topright = -0.1, bottomright = -0.1 }, + ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, + }, + }, +{ + tweak = "radicaldegreeanchors", + list = { + -- [0x221A] = { location = "left", hfactor = .1, vfactor = .3 }, + -- ["0x221A.variants.*"] = { location = "left", hfactor = .1, vfactor = .625 }, + -- ["0x221A.variants.1"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.2"] = { location = "left", hfactor = .1, vfactor = .575 }, + -- ["0x221A.variants.3"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.4"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.variants.5"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221Aq.variants.6"] = { location = "left", hfactor = .1, vfactor = .55 }, + -- ["0x221A.parts.top"] = { location = "left", hfactor = .1, vfactor = 5.5 }, -- keep commented: bottom wins over top + ["0x221A.parts.bottom"] = { location = "left", hfactor = .1, vfactor = 1.025 }, + } +}, + + { + tweak = "checkspacing", + }, + { + tweak = "addscripts", + }, + { + tweak = "accentdimensions", + }, + { + tweak = "addrules", + }, + { + tweak = "addactuarian", + }, + { + tweak = "addequals", + }, + { + tweak = "setoptions", + -- set = { "ignorekerndimensions" } + }, + -- this is the mkiv section +-- { +-- tweak = "emulatelmtx", +-- feature = "emulatelmtx", +-- comment = "this is for mkiv", +-- }, + }, + }, + bigslots = { + 1, 2, 3, 4 + }, + }, + +} diff --git a/tex/context/fonts/mkiv/xits-math.lfg b/tex/context/fonts/mkiv/xits-math.lfg index 9eb1a1200..1d7e22df6 100644 --- a/tex/context/fonts/mkiv/xits-math.lfg +++ b/tex/context/fonts/mkiv/xits-math.lfg @@ -2,6 +2,9 @@ -- -- \definefilesynonym [type-imp-xits.mkiv] [type-imp-xits.mkiv] +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets + return { name = "xits-math", version = "1.00", diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml index 96e655e31..89a549482 100644 --- a/tex/context/interface/mkii/keys-fr.xml +++ b/tex/context/interface/mkii/keys-fr.xml @@ -96,7 +96,6 @@ - @@ -683,9 +682,13 @@ + + + + diff --git a/tex/context/modules/mkiv/s-math-extensibles.mkiv b/tex/context/modules/mkiv/s-math-extensibles.mkiv index cc6fd1b00..b3fcf0e1f 100644 --- a/tex/context/modules/mkiv/s-math-extensibles.mkiv +++ b/tex/context/modules/mkiv/s-math-extensibles.mkiv @@ -143,3 +143,71 @@ } \stoptext + +% This could also be some tracer + +\definefontfeature[mathextra][goodies=] % or use the raw unpatched font + + +\def\Test#1% + {\left( + \scratchdimen\Umathaxis\displaystyle + \blackrule + [height=\dimexpr#1ex+\scratchdimen\relax, + depth=\dimexpr#1ex-\scratchdimen\relax] + \right)} + + +\startbuffer[p] +% \Umathconnectoroverlapmin\allmathstyles \zeropoint +% \Umathconnectoroverlapmin\allmathstyles 2pt % \zeropoint + \Umathdelimitershortfall \allmathstyles \zeropoint + \showboxes + \showglyphs + \Test{4.0} + \Test{4.5} + \Test{5.0} + \Test{8.0} + \quad + \dorecurse{\mathvariantcount `(} { + \char\mathvariantcode `( #1 + } +\stopbuffer + +\startbuffer[p] + \showboxes + \showglyphs + \overparent{\blackrule[color=darkgray,width=1em,height=2ex]}\quad + \overparent{\blackrule[color=darkgray,width=2em,height=2ex]}\quad + \overparent{\blackrule[color=darkgray,width=4em,height=2ex]}\quad + \overparent{\blackrule[color=darkgray,width=8em,height=2ex]} +\stopbuffer + +\startbuffer + \hpack\bgroup + $ + \getbuffer[p] + $ + \egroup +\stopbuffer + +\def\TestFont#1% + {\dontleavehmode + \begingroup + \hbox to 5.5em{\hss\type{#1}:}\quad + \switchtobodyfont[#1]\getbuffer + \endgroup + \par} + +\starttext + \startTEXpage[offset=1dk] +% \TestFont{modern} +% \TestFont{pagella} +% \TestFont{termes} +% \TestFont{bonum} + \TestFont{lucida} +% \TestFont{cambria} + \TestFont{ebgaramond} +% \TestFont{xits} + \stopTEXpage +\stoptext diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 480f4ef66..c249372fb 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2022-10-22 11:20 +-- merge date : 2022-11-14 22:54 do -- begin closure to overcome local limits and interference @@ -9406,19 +9406,9 @@ function constructors.scale(tfmdata,specification) target.unscaled=tfmdata 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 - scaledpoints=parameters.scriptscriptpercentage*textsize/100 - elseif forcedsize>1000 then - scaledpoints=forcedsize - else - end targetparameters.mathsize=mathsize - targetparameters.textsize=textsize - targetparameters.forcedsize=forcedsize + targetparameters.textsize=textsize targetparameters.extrafactor=extrafactor local addtounicode=constructors.addtounicode local tounicode=fonts.mappings.tounicode @@ -15659,8 +15649,11 @@ local function applyaxis(glyph,shape,deltas,dowidth) end if found==last then lastindex=currentindex - break; + break elseif found>last then +while lastindex>1 and dpoints[lastindex]>last do + lastindex=lastindex-1 +end break end end @@ -15668,7 +15661,7 @@ local function applyaxis(glyph,shape,deltas,dowidth) local function find(i) local prv=lastindex for j=firstindex,lastindex do - local nxt=dpoints[j] + local nxt=dpoints[j] if nxt==i then return false,j,false elseif nxt>i then @@ -18602,22 +18595,18 @@ do report("used %s lookups: % t",what,sortedkeys(usedlookups)) end local reported={} - local function report_issue(i,what,sequence,kind) - local name=sequence.name - if not reported[name] then - report("rule %i in %s lookup %a has %s lookups",i,what,name,kind) - reported[name]=true - end + local function report_issue(i,what,step,kind) + report("rule %i in step %i of %s has %s lookups",i,step,what,kind) end - for i=1,#allsteps do - local step=allsteps[i] + for s=1,#allsteps do + local step=allsteps[s] local rules=step.rules if rules then for i=1,#rules do local rule=rules[i] local rlookups=rule.lookups if not rlookups then - report_issue(i,what,sequence,"no") + report_issue(i,what,s,"no") elseif not next(rlookups) then rule.lookups=nil else @@ -18653,12 +18642,12 @@ do sublookupcheck[lookupid]=1 h=nofsublookups else - report_issue(i,what,sequence,"missing") + report_issue(i,what,s,"missing") rule.lookups=nil break end else - report_issue(i,what,sequence,"bad") + report_issue(i,what,s,"bad") rule.lookups=nil break end @@ -19183,7 +19172,7 @@ local function readmathvariants(f,fontdata,offset) local vconstruction=readcardinaltable(f,vnofglyphs,ushort) local hconstruction=readcardinaltable(f,hnofglyphs,ushort) fontdata.mathconstants.MinConnectorOverlap=minoverlap - local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic) + local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic,korientation,orientation) if coverage~=0 and nofglyphs>0 then local coverage=readcoverage(f,offset+coverage,true) for i=1,nofglyphs do @@ -19246,13 +19235,21 @@ local function readmathvariants(f,fontdata,offset) if italic and italic~=0 then math[kitalic]=italic end + if orientation then + math[korientation]=orientation + end end end end end end - get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic") - get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic") + if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then + get(offset,hcoverage,hnofglyphs,hconstruction,"variants","parts","partsitalic","partsorientation","horizontal") + get(offset,vcoverage,vnofglyphs,vconstruction,"variants","parts","partsitalic","partsorientation","vertical") + else + get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic") + get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic") + end end function readers.math(f,fontdata,specification) local tableoffset=gotodatatable(f,fontdata,"math",specification.glyphs) @@ -21294,7 +21291,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf -otf.version=3.121 +otf.version=3.130 otf.cache=containers.define("fonts","otl",otf.version,true) otf.svgcache=containers.define("fonts","svg",otf.version,true) otf.pngcache=containers.define("fonts","png",otf.version,true) @@ -21777,24 +21774,6 @@ local function read_from_otf(specification) end return tfmdata end -local function checkmathsize(tfmdata,mathsize) - local mathdata=tfmdata.shared.rawdata.metadata.math - local mathsize=tonumber(mathsize) - if mathdata then - local parameters=tfmdata.parameters - parameters.scriptpercentage=mathdata.ScriptPercentScaleDown - parameters.scriptscriptpercentage=mathdata.ScriptScriptPercentScaleDown - parameters.mathsize=mathsize - end -end -registerotffeature { - name="mathsize", - description="apply mathsize specified in the font", - initializers={ - base=checkmathsize, - node=checkmathsize, - } -} function otf.collectlookups(rawdata,kind,script,language) if not kind then return @@ -24786,24 +24765,40 @@ local function unifyglyphs(fontdata,usenames) descriptions[unicode]=glyph end end - for index=1,nofglyphs do - local math=glyphs[index].math - if math then - local list=math.vparts - if list then - for i=1,#list do local l=list[i] l.glyph=indices[l.glyph] end - end - local list=math.hparts - if list then - for i=1,#list do local l=list[i] l.glyph=indices[l.glyph] end - end - local list=math.vvariants - if list then - for i=1,#list do list[i]=indices[list[i]] end + if LUATEXENGINE=="luametatex" then + for index=1,nofglyphs do + local math=glyphs[index].math + if math then + local list=math.parts + if list then + for i=1,#list do local l=list[i] l.glyph=indices[l.glyph] end + end + local list=math.variants + if list then + for i=1,#list do list[i]=indices[list[i]] end + end end - local list=math.hvariants - if list then - for i=1,#list do list[i]=indices[list[i]] end + end + else + for index=1,nofglyphs do + local math=glyphs[index].math + if math then + local list=math.vparts + if list then + for i=1,#list do local l=list[i] l.glyph=indices[l.glyph] end + end + local list=math.hparts + if list then + for i=1,#list do local l=list[i] l.glyph=indices[l.glyph] end + end + local list=math.vvariants + if list then + for i=1,#list do list[i]=indices[list[i]] end + end + local list=math.hvariants + if list then + for i=1,#list do list[i]=indices[list[i]] end + end end end end @@ -37130,7 +37125,7 @@ local afm=fonts.handlers.afm local pfb=fonts.handlers.pfb local hashes=fonts.hashes local identifiers=hashes.identifiers -local version=otf.version or 0.013 +local version=otf.version or 0.014 local shapescache=containers.define("fonts","shapes",version,true) local streamscache=containers.define("fonts","streams",version,true) local compact_streams=false -- cgit v1.2.3