From 8e51addbcecd962280c24a77de9ec1f6724e7a65 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 21 Feb 2018 19:26:29 +0100 Subject: 2018-02-21 18:27:00 --- tex/context/modules/common/s-abr-01.tex | 2 + tex/context/modules/mkiv/s-def-01.mkiv | 10 -- tex/context/modules/mkiv/s-fnt-10.mkiv | 169 --------------------- tex/context/modules/mkiv/s-fnt-20.mkiv | 167 --------------------- tex/context/modules/mkiv/s-fnt-21.mkiv | 64 -------- tex/context/modules/mkiv/s-fnt-24.mkiv | 83 ----------- tex/context/modules/mkiv/s-fonts-cjk.mkiv | 87 +++++++++++ tex/context/modules/mkiv/s-fonts-complete.mkiv | 160 ++++++++++++++++++++ tex/context/modules/mkiv/s-fonts-engines.mkiv | 196 +++++++++++++++++++++++++ tex/context/modules/mkiv/s-fonts-steps.mkiv | 186 +++++++++++++++++++++++ tex/context/modules/mkiv/s-reg-01.mkiv | 60 -------- tex/context/modules/mkiv/s-regimes-list.mkiv | 74 ++++++++++ 12 files changed, 705 insertions(+), 553 deletions(-) delete mode 100644 tex/context/modules/mkiv/s-def-01.mkiv delete mode 100644 tex/context/modules/mkiv/s-fnt-10.mkiv delete mode 100644 tex/context/modules/mkiv/s-fnt-20.mkiv delete mode 100644 tex/context/modules/mkiv/s-fnt-21.mkiv delete mode 100644 tex/context/modules/mkiv/s-fnt-24.mkiv create mode 100644 tex/context/modules/mkiv/s-fonts-cjk.mkiv create mode 100644 tex/context/modules/mkiv/s-fonts-complete.mkiv create mode 100644 tex/context/modules/mkiv/s-fonts-engines.mkiv create mode 100644 tex/context/modules/mkiv/s-fonts-steps.mkiv delete mode 100644 tex/context/modules/mkiv/s-reg-01.mkiv create mode 100644 tex/context/modules/mkiv/s-regimes-list.mkiv (limited to 'tex/context/modules') diff --git a/tex/context/modules/common/s-abr-01.tex b/tex/context/modules/common/s-abr-01.tex index a0e3829e4..b36ae7a0d 100644 --- a/tex/context/modules/common/s-abr-01.tex +++ b/tex/context/modules/common/s-abr-01.tex @@ -76,10 +76,12 @@ \logo [CTXTOOLS] {ctxtools} \logo [CWEB] {cweb} \logo [CSTUG] {cstug} +\logo [DAC] {dac} \logo [DANTE] {Dante} \logo [DECTEN] {dec-10} \logo [DNA] {dna} \logo [DISTILLER] {distiller} +\logo [DPI] {dpi} \logo [DRATEX] {Dra\TeXsuffix} \logo [DSC] {dsc} \logo [DTD] {dtd} diff --git a/tex/context/modules/mkiv/s-def-01.mkiv b/tex/context/modules/mkiv/s-def-01.mkiv deleted file mode 100644 index 49e585bd0..000000000 --- a/tex/context/modules/mkiv/s-def-01.mkiv +++ /dev/null @@ -1,10 +0,0 @@ -% yes or no - -\unprotect - -\startsetups defaults:frontpart:pagenumbers:roman - \defineconversionset[\c!frontpart:\c!pagenumber][][romannumerals] - \setupuserpagenumber[\c!way=\v!by\v!block] -\stopsetups - -\protect diff --git a/tex/context/modules/mkiv/s-fnt-10.mkiv b/tex/context/modules/mkiv/s-fnt-10.mkiv deleted file mode 100644 index 731c4be39..000000000 --- a/tex/context/modules/mkiv/s-fnt-10.mkiv +++ /dev/null @@ -1,169 +0,0 @@ -%D \module -%D [ file=s-fnt-01, -%D version=2006.10.10, % guess -%D title=\CONTEXT\ Style File, -%D subtitle=Listing Glyphs in Large Fonts, -%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. - -% sort of obsolete - -\startluacode -local fontdata = fonts.hashes.identifiers - --- function fonts.tracers.show_all() --- local tfmdata = fontdata[font.current()] --- if tfmdata and tfmdata.shared then --- local NC, NR, char = context.NC, context.NR, context.char --- context.starttabulate { "|l|r|c|" } --- for unicode, description in fonts.iterators.characters(tfmdata) do --- NC() context(description.name) NC() context(unicode) NC() char(unicode) NC() NR() --- end --- context.stoptabulate() --- end --- end - -local context = context -local escaped = context.escaped - -function fonts.tracers.show_all() - local tfmdata = fontdata[font.current()] - if tfmdata then - local NC, NR, HL, char, bold, tttf = context.NC, context.NR, context.HL, context.char, context.bold, context.tttf - local descriptions = tfmdata.descriptions or { } - local data = characters.data - -- context.setuptabulate { header = "repeat" } - context.starttabulatehead() - NC() bold("unicode") - NC() bold("visual") - NC() bold("index") - NC() bold("glyph") - NC() bold("adobe") - NC() bold("context") - NC() NR() - context.stoptabulatehead() - context.starttabulate { "|l|c|l|p|p|p|" } - for unicode, chr in fonts.iterators.characters(tfmdata) do - local des, dat = descriptions[unicode], data[unicode] - local index = chr.index or 0 - local cname = (dat and dat.contextname) or "" - local aname = (dat and dat.adobename) or "" - local gname = (des and des.name) or "" - local mname = dat and dat.mathname - if type(mname) ~= "string" then - mname = "" - end - local mspec = dat and dat.mathspec - if mspec then - for m=1,#mspec do - local n = mspec[m].name - if n then - if mname == "" then - mname = n - else - mname = mname .. " " .. n - end - end - end - end - if mname ~= "" then - mname = "m: " .. mname - if cname ~= "" then - cname = cname .. " " .. mname - else - cname = mname - end - end - NC() tttf() context("U+%05X",unicode) - NC() char(unicode) - NC() tttf() context("%05X",index) - NC() if gname ~= "" then tttf() escaped(gname) end - NC() if aname ~= "" then tttf() context(aname) end - NC() if cname ~= "" then tttf() context(cname) end - NC() NR() - end - context.stoptabulate() - else - context("problems") - end -end - -function fonts.tracers.show_glyphs() - local tfmdata = fontdata[font.current()] - if tfmdata then - for unicode, chr in fonts.iterators.characters(tfmdata) do - context.showglyph(unicode) - end - end -end -\stopluacode - -\unexpanded\def\ShowCompleteFont#1#2#3% - {\bgroup - \page - \font\TestFont=#1 at #2 - \setuplayout[style=\TestFont] - \setupheadertexts[] - \setupfootertexts[#1 -- \pagenumber] - \setupfootertexts[pagenumber] - \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm] - \TestFont - \nonknuthmode - \startcolumns[n=#3] - \TestFont - \ctxlua { fonts.tracers.show_all() } - \stopcolumns - \page - \egroup} - -\unexpanded\def\ShowAllGlyphs#1#2#3% - {\bgroup - \page - \def\showglyph##1{\dontleavehmode\strut\char##1\relax\par} - \font\TestFontA=#1 at 12pt - \font\TestFontB=#1 at #2 - \setuplayout[style=\TestFontA] - \setupheadertexts[] - \setupfootertexts[#1\space\endash\space\pagenumber] - \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm,header=1cm,footer=2cm] - \TestFontB \setupinterlinespace[line=1.2\dimexpr#2\relax] \raggedcenter - \nonknuthmode - \startcolumns[n=#3] - \TestFontB - \ctxlua { fonts.tracers.show_glyphs() } - \stopcolumns - \page - \egroup} - -\continueifinputfile{s-fnt-10.mkiv} - -\starttext - -% \ShowCompleteFont{name:dejavusansmono}{10pt}{1} -% \ShowCompleteFont{name:dejavuserif}{10pt}{2} -% \ShowCompleteFont{name:officinasansbookitcregular}{10pt}{2} -% \ShowCompleteFont{name:officinaserifbookitcregular}{10pt}{2} -% \ShowCompleteFont{name:serpentineserifeflight}{10pt}{2} -\ShowCompleteFont{name:lmroman10-regular}{10pt}{1} -% \ShowCompleteFont{name:lmtypewriter10-regular}{10pt}{2} -% \ShowCompleteFont{lt55485}{10pt}{2} -% \ShowCompleteFont{lmr10}{10pt}{2} -% \ShowCompleteFont{lbr}{10pt}{2} -% \ShowCompleteFont{name:Cambria}{10pt}{2} -% \ShowCompleteFont{name:CambriaMath}{10pt}{2} -% \ShowCompleteFont{name:texgyrepagella-regular}{10pt}{2} -% \ShowCompleteFont{name:texgyrechorus-mediumitalic}{10pt}{2} -% \ShowAllGlyphs {name:texgyrepagella-regular} {48pt}{2} -% \ShowAllGlyphs {name:texgyrechorus-mediumitalic}{48pt}{2} -% \ShowCompleteFont{name:euler10-regular}{10pt}{2} - -% \ShowCompleteFont{name:palatinosansinformalcombold}{20pt}{2} -% \ShowCompleteFont{name:palatinonovaregular}{11pt}{2} -% \ShowCompleteFont{pirat.ttf}{12pt}{1} - -\stoptext diff --git a/tex/context/modules/mkiv/s-fnt-20.mkiv b/tex/context/modules/mkiv/s-fnt-20.mkiv deleted file mode 100644 index 6fc1edb22..000000000 --- a/tex/context/modules/mkiv/s-fnt-20.mkiv +++ /dev/null @@ -1,167 +0,0 @@ -%D \module -%D [ file=s-fnt-20, -%D version=2009.01.10, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Feature Application (1), -%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. - -%D This file is used by Idris and me in the process of getting the -%D best arabic fonts getting rendered best. As such it might change. - -% \setvariables -% [otftracker] -% [title=Reverse Chaining, -% figure=test-003-volt.pdf, -% font=husayni, -% sample={ببب بببب ببببب بببببب}] - -\def\checkedotftrackerfeature #1{otftracker-\ifnum\featureattribute{otftracker-#1}=\zerocount default\else#1\fi} -\def\checkedotftrackerdirection#1{\csname otftracker-direction-\ifcsname otftracker-direction-#1\endcsname#1\else default\fi\endcsname} - -% we can consider adding a dir key to features - -\definefontfeature - [otftracker-default] - [default] - [mode=node] - -\definefontfeature - [otftracker-arabtype] - [mode=node,analyze=yes, - language=dflt,script=arab,ccmp=yes, - init=yes,medi=yes,fina=yes,isol=yes, - liga=yes,dlig=yes,rlig=yes,clig=yes, - mark=yes,mkmk=yes,kern=yes,curs=yes] - -\definefontfeature - [otftracker-husayni-default] - [analyze=yes,mode=node, - language=dflt,script=arab, - init=yes,medi=yes,fina=yes, - spacekern=yes, - calt=yes, - rlig=yes, - ccmp=yes, - salt=yes, - ss01=yes, % full Allah, Muhammad, Allahumma - ss05=yes, % full Jiim stacking - ss09=yes, % full Haa stacking - ss10=yes, % partial dipped Miim - ss13=yes, % full stacked Miim - ss15=yes, % full stacked Laam-on-Miim - ss17=yes, % full stacked Ayn-on-Miim - ss19=yes, % LM_im - ss24=yes, % BX specials - ss25=yes, % LH_im specials - ss26=yes, % full Yaa.final specials - ss27=yes, % partial thin Miim.final - ss31=yes, % partial Raa.final contexts - ss34=yes, % partial Raa.final contexts - ss35=yes, % full Kaaf contexts - ss36=yes, % full Laam contexts - ss37=yes, % Miim-Miim contexts - ss38=yes, % fancy thin Haa.medial-Miim.final - ss39=yes, % high and low Baa strings - ss40=yes, % diagonal entry - ss41=yes, % initial alternates - mark=yes,mkmk=yes,kern=yes,curs=yes] - -\definefontfeature - [otftracker-husayni] - [otftracker-husayni-default] - -\definefontfeature - [otftracker-simplenaskhi] - [analyze=yes,mode=node, - language=dflt,script=arab, - init=yes,medi=yes,fina=yes,calt=yes, - rlig=yes,liga=yes,dlig=yes, - mark=yes,mkmk=yes,kern=yes,curs=yes] - -\setvalue{otftracker-direction-arabtype}{r2l} -\setvalue{otftracker-direction-husayni}{r2l} -\setvalue{otftracker-direction-simplenaskhi}{r2l} -\setvalue{otftracker-direction-default}{} -\setvalue{otftracker-direction-sbl-hbrw}{r2l} - -\setvariables - [otftracker] - [font=Serif, - features=\checkedotftrackerfeature{\getvariable{otftracker}{font}}, - direction=\checkedotftrackerdirection{\getvariable{otftracker}{font}}, - size=48pt, - figure=, - title=Feature Check, - sample=no sample, - set=\setups{otftracker}] - -\setuplayout - [topspace=1.5cm, - backspace=1.5cm, - width=middle, - height=middle, - header=1.5cm, - footer=1.5cm] - -\setuphead - [chapter] - [header=high, - number=no] - -\setupfootertexts - [chapter] - -\setupalign - [flushleft] - -\setupcolors - [state=start] - -\startsetups otftracker-steps - \doifsomething {\getvariable{otftracker}{figure}} { - \startlinecorrection - \externalfigure[\getvariable{otftracker}{figure}][maxwidth=\hsize,frame=on] - \stoplinecorrection - } - \showotfcomposition - {\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}} - {\getvariable{otftracker}{direction}} - {\getvariable{otftracker}{sample}} -\stopsetups - -\startsetups otftracker - \setupbodyfont[tt,10pt] - \starttext - \normalexpanded{\startchapter[title={\getvariable{otftracker}{title}}]} - \directsetup{otftracker-steps} - \directsetup{otftracker-extra} - \stopchapter - \setvariables[otftracker][comment=] - \stoptext -\stopsetups - -\continueifinputfile{s-fnt-20.mkiv} - -\usemodule[art-01] - -\setupbodyfont -% [cambria] - [dejavu] - -\starttext - -\setvariables - [otftracker] - [font=Serif, - size=48pt, - figure=, - title=Feature Check, - sample={affiliation}] - -\stoptext diff --git a/tex/context/modules/mkiv/s-fnt-21.mkiv b/tex/context/modules/mkiv/s-fnt-21.mkiv deleted file mode 100644 index 10d5a4623..000000000 --- a/tex/context/modules/mkiv/s-fnt-21.mkiv +++ /dev/null @@ -1,64 +0,0 @@ -%D \module -%D [ file=s-fnt-20, -%D version=2009.01.10, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Feature Application (2), -%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. - -%D This module is related to: - -\usemodule[fnt-20] - -\setvariables - [otftracker] - [set=\setups{araball}] - -\startsetups araball - \begingroup - \setupcolors[state=start]% - \enabletrackers[otf.analyzing]% beware, kind of global - \ruledhbox \bgroup - \definedfont[\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}]% - \ifnum\getvariable{otftracker}{direction}<0 \textdir TRT\else\ifnum\getvariable{otftracker}{direction}>0 \textdir TLT\fi\fi\relax - \getvariable{otftracker}{sample}% - \egroup - \disabletrackers[otf.analyzing]% - \endgroup -\stopsetups - -\unexpanded\def\ShowOtfTrackerSample#1% - {\doiffile{#1} - {\blank - \startlinecorrection - \vbox \bgroup - \forgetall - \setbox\scratchbox\hbox{\component #1 \relax} - \hbox{\copy\scratchbox\quad\lower\dp\scratchbox\hbox{\ruledhbox{\externalfigure[#1-volt.pdf][height=\htdp\scratchbox]}}} - \hbox{\strut\tttf#1}% - \egroup - \stoplinecorrection - \blank}} - -\endinput - -% \usemodule[fnt-21] -% -% \starttext -% -% \setvariables -% [otftracker] -% [direction=-1, -% sample=لا, -% title=Test, -% font=file:arabtype, -% % font=file:husayni, -% % font=file:scheherazaderegot, -% features=arabic] -% -% \stoptext diff --git a/tex/context/modules/mkiv/s-fnt-24.mkiv b/tex/context/modules/mkiv/s-fnt-24.mkiv deleted file mode 100644 index 2e6b9a591..000000000 --- a/tex/context/modules/mkiv/s-fnt-24.mkiv +++ /dev/null @@ -1,83 +0,0 @@ -%D \module -%D [ file=s-fnt-24, -%D version=2009.02.06, -%D title=\CONTEXT\ Style File, -%D subtitle=CJK Glyph Combination Testing, -%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. - -\unprotect - -\def\ShowChineseCombiChar#1#2#3#4% - {\blank[small] - \dontleavehmode - \hbox\bgroup - \dontcomplain - \setstrut - \hbox to 7em{\ruledhbox{\char#1}\hskip.25em\type{+}\hskip.25em\ruledhbox{\char#2}\hskip.25em\type{=}\hskip.25em\ruledhbox{\char#1\char#2}\hss}\relax - \ruledvtop{\hsize1em\char#1\char#2}\relax - \hskip2em - \ruledvtop{\hsize.625em\char#1\char#2}\relax - \hskip2em - \ruledvtop{\hsize1.5em\char#1\char#2}\relax - \hskip2em - \type{#3 + #4}\relax - \egroup - \blank[small]} - -\startluacode -local example = { - korean = 0x0AC00, - chinese = 0x04E55, - full_width_open = 0x03008, - full_width_close = 0x03009, - half_width_open = 0x02018, - half_width_close = 0x02019, - hyphen = 0x02026, - non_starter = 0x03005, - other = 0x0004D, -- M -} - -function fonts.analyzers.cjktest(first,second) - for k, v in next, example do - if (not first or first == "") or first == k then - for kk, vv in next, example do - if (not second or second == "") or second == kk then - context.ShowChineseCombiChar(v,vv,k,kk) - end - end - end - end -end -\stopluacode - -\unexpanded\def\ShowCombinationsKorean - {\dodoubleempty\doShowCombinationsKorean} - -\def\doShowCombinationsKorean[#1][#2]% - {\startpacked - \setscript[hangul] - \setupcolors[\c!state=\v!start] - \enabletrackers[cjk.analyzing] - \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! - \disabletrackers[cjk.analyzing] - \stoppacked} - -\unexpanded\def\ShowCombinationsChinese - {\dodoubleempty\doShowCombinationsChinese} - -\def\doShowCombinationsChinese[#1][#2]% - {\startpacked - \setscript[hanzi] - \setupcolors[\c!state=\v!start] - \enabletrackers[cjk.analyzing] - \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! - \disabletrackers[cjk.analyzing] - \stoppacked} - -\protect \endinput diff --git a/tex/context/modules/mkiv/s-fonts-cjk.mkiv b/tex/context/modules/mkiv/s-fonts-cjk.mkiv new file mode 100644 index 000000000..fae041316 --- /dev/null +++ b/tex/context/modules/mkiv/s-fonts-cjk.mkiv @@ -0,0 +1,87 @@ +%D \module +%D [ file=s-fonts-cjk, % was: s-fnt-24 +%D version=2009.02.06, +%D title=\CONTEXT\ Style File, +%D subtitle=CJK Glyph Combination Testing, +%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. + +\startmodule[fonts-cjk] + +\unprotect + +\unexpanded\def\ShowChineseCombiChar#1#2#3#4% + {\blank[small] + \dontleavehmode + \hbox\bgroup + \dontcomplain + \setstrut + \hbox to 7em{\ruledhbox{\char#1}\hskip.25em\type{+}\hskip.25em\ruledhbox{\char#2}\hskip.25em\type{=}\hskip.25em\ruledhbox{\char#1\char#2}\hss}\relax + \ruledvtop{\hsize1em\char#1\char#2}\relax + \hskip2em + \ruledvtop{\hsize.625em\char#1\char#2}\relax + \hskip2em + \ruledvtop{\hsize1.5em\char#1\char#2}\relax + \hskip2em + \type{#3 + #4}\relax + \egroup + \blank[small]} + +\startluacode +local example = { + korean = 0x0AC00, + chinese = 0x04E55, + full_width_open = 0x03008, + full_width_close = 0x03009, + half_width_open = 0x02018, + half_width_close = 0x02019, + hyphen = 0x02026, + non_starter = 0x03005, + other = 0x0004D, -- M +} + +function fonts.analyzers.cjktest(first,second) + for k, v in next, example do + if (not first or first == "") or first == k then + for kk, vv in next, example do + if (not second or second == "") or second == kk then + context.ShowChineseCombiChar(v,vv,k,kk) + end + end + end + end +end +\stopluacode + +\unexpanded\def\ShowCombinationsKorean + {\dodoubleempty\doShowCombinationsKorean} + +\def\doShowCombinationsKorean[#1][#2]% + {\startpacked + \setscript[hangul] + \setupcolors[\c!state=\v!start] + \enabletrackers[cjk.analyzing] + \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! + \disabletrackers[cjk.analyzing] + \stoppacked} + +\unexpanded\def\ShowCombinationsChinese + {\dodoubleempty\doShowCombinationsChinese} + +\unexpanded\def\doShowCombinationsChinese[#1][#2]% + {\startpacked + \setscript[hanzi] + \setupcolors[\c!state=\v!start] + \enabletrackers[cjk.analyzing] + \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! + \disabletrackers[cjk.analyzing] + \stoppacked} + +\stopmodule + +\protect \endinput diff --git a/tex/context/modules/mkiv/s-fonts-complete.mkiv b/tex/context/modules/mkiv/s-fonts-complete.mkiv new file mode 100644 index 000000000..afdd79b4c --- /dev/null +++ b/tex/context/modules/mkiv/s-fonts-complete.mkiv @@ -0,0 +1,160 @@ +%D \module +%D [ file=s-fnt-01, +%D version=2006.10.10, % guess +%D title=\CONTEXT\ Style File, +%D subtitle=Listing Glyphs in Large Fonts, +%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. + +%D This module is sort of obsolete as other moduels give nicer overviews. + +\startluacode + moduledata.fonts = moduledata.fonts or { } + moduledata.fonts.complete = moduledata.fonts.complete or { } + + local fontdata = fonts.hashes.identifiers + + local context = context + local escaped = context.escaped + + function moduledata.fonts.complete.all() + local tfmdata = fontdata[true] + if tfmdata then + local NC, NR, HL, char, bold, tttf = context.NC, context.NR, context.HL, context.char, context.bold, context.tttf + local descriptions = tfmdata.descriptions or { } + local data = characters.data + -- context.setuptabulate { header = "repeat" } + context.starttabulatehead() + NC() bold("unicode") + NC() bold("visual") + NC() bold("index") + NC() bold("glyph") + NC() bold("adobe") + NC() bold("context") + NC() NR() + context.stoptabulatehead() + context.starttabulate { "|l|c|l|p|p|p|" } + for unicode, chr in fonts.iterators.characters(tfmdata) do + local des, dat = descriptions[unicode], data[unicode] + local index = chr.index or 0 + local cname = (dat and dat.contextname) or "" + local aname = (dat and dat.adobename) or "" + local gname = (des and des.name) or "" + local mname = dat and dat.mathname + if type(mname) ~= "string" then + mname = "" + end + local mspec = dat and dat.mathspec + if mspec then + for m=1,#mspec do + local n = mspec[m].name + if n then + if mname == "" then + mname = n + else + mname = mname .. " " .. n + end + end + end + end + if mname ~= "" then + mname = "m: " .. mname + if cname ~= "" then + cname = cname .. " " .. mname + else + cname = mname + end + end + NC() tttf() context("U+%05X",unicode) + NC() char(unicode) + NC() tttf() context("%05X",index) + NC() if gname ~= "" then tttf() escaped(gname) end + NC() if aname ~= "" then tttf() context(aname) end + NC() if cname ~= "" then tttf() context(cname) end + NC() NR() + end + context.stoptabulate() + else + context("problems") + end + end + + function moduledata.fonts.complete.glyphs() + local tfmdata = fontdata[true] + if tfmdata then + for unicode, chr in fonts.iterators.characters(tfmdata) do + context.showglyph(unicode) + end + end + end +\stopluacode + +\unexpanded\def\ShowCompleteFont#1#2#3% + {\begingroup + \page + \font\TestFont=#1 at #2 + \setuplayout[style=\TestFont] + \setupheadertexts[] + \setupfootertexts[#1 -- \pagenumber] + \setupfootertexts[pagenumber] + \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm] + \TestFont + \nonknuthmode + \startcolumns[n=#3] + \TestFont + \ctxlua { moduledata.fonts.complete.all() } + \stopcolumns + \page + \endgroup} + +\unexpanded\def\ShowAllGlyphs#1#2#3% + {\begingroup + \page + \def\showglyph##1{\dontleavehmode\strut\char##1\relax\par} + \font\TestFontA=#1 at 12pt + \font\TestFontB=#1 at #2 + \setuplayout[style=\TestFontA] + \setupheadertexts[] + \setupfootertexts[#1\space\endash\space\pagenumber] + \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm,header=1cm,footer=2cm] + \TestFontB \setupinterlinespace[line=1.2\dimexpr#2\relax] \raggedcenter + \nonknuthmode + \startcolumns[n=#3] + \TestFontB + \ctxlua { moduledata.fonts.complete.glyphs() } + \stopcolumns + \page + \endgroup} + +\continueifinputfile{s-fonts-complete.mkiv} + +\starttext + +% \ShowCompleteFont{name:dejavusansmono}{10pt}{1} +% \ShowCompleteFont{name:dejavuserif}{10pt}{2} +% \ShowCompleteFont{name:officinasansbookitcregular}{10pt}{2} +% \ShowCompleteFont{name:officinaserifbookitcregular}{10pt}{2} +% \ShowCompleteFont{name:serpentineserifeflight}{10pt}{2} +\ShowCompleteFont{name:lmroman10-regular}{10pt}{1} +% \ShowCompleteFont{name:lmtypewriter10-regular}{10pt}{2} +% \ShowCompleteFont{lt55485}{10pt}{2} +% \ShowCompleteFont{lmr10}{10pt}{2} +% \ShowCompleteFont{lbr}{10pt}{2} +% \ShowCompleteFont{name:Cambria}{10pt}{2} +% \ShowCompleteFont{name:CambriaMath}{10pt}{2} +% \ShowCompleteFont{name:texgyrepagella-regular}{10pt}{2} +% \ShowCompleteFont{name:texgyrechorus-mediumitalic}{10pt}{2} +% \ShowAllGlyphs {name:texgyrepagella-regular} {48pt}{2} +% \ShowAllGlyphs {name:texgyrechorus-mediumitalic}{48pt}{2} +% \ShowCompleteFont{name:euler10-regular}{10pt}{2} + +% \ShowCompleteFont{name:palatinosansinformalcombold}{20pt}{2} +% \ShowCompleteFont{name:palatinonovaregular}{11pt}{2} +% \ShowCompleteFont{pirat.ttf}{12pt}{1} + +\stoptext diff --git a/tex/context/modules/mkiv/s-fonts-engines.mkiv b/tex/context/modules/mkiv/s-fonts-engines.mkiv new file mode 100644 index 000000000..1b1f664b8 --- /dev/null +++ b/tex/context/modules/mkiv/s-fonts-engines.mkiv @@ -0,0 +1,196 @@ +%D \module +%D [ file=s-fonts-engines, % was: s-fnt-22 +%D version=2017.06.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Compare engines and such, +%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. + +%D This module is just for me when I wanted to check some husayni (by Idris) +%D regression. Interesting is that fina should be disabled for hb (otherwise +%D garbage) and that some substitutions are ignored in hb (1.1.3), so we can +%D only compare some examples. Don't expect this style to be stable as I +%D might change default features. + +\startmodule[fonts-engines] + +\usemodule[fonts-steps] +\usemodule[fonts-plugins] + +\enabletrackers[fonts.reorderlookups] + +\startsetups otftracker-extra-context + \definedfont[\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}]\relax + \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax + \getvariable{otftracker}{sample}\relax +\stopsetups + +\startsetups otftracker-extra-context-reordered + \definedfont[\getvariable{otftracker}{font}*otftracker-context-reordered at \getvariable{otftracker}{size}]\relax + \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax + \getvariable{otftracker}{sample}\relax +\stopsetups + +\startsetups otftracker-extra-harfbuzz + \definedfont[\getvariable{otftracker}{font}*otftracker-harfbuzz-native at \getvariable{otftracker}{size}]\relax + \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax + \getvariable{otftracker}{sample}\relax +\stopsetups + +\startsetups otftracker-extra-uniscribe + \definedfont[\getvariable{otftracker}{font}*otftracker-harfbuzz-uniscribe at \getvariable{otftracker}{size}]\relax + \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax + \getvariable{otftracker}{sample}\relax +\stopsetups + +\definecolor[otftracker-overlay-1][a=1,t=.5,b=1] +\definecolor[otftracker-overlay-2][a=1,t=.5,g=1] +\definecolor[otftracker-overlay-3][a=1,t=.5,r=1] + +% This is a sort of a check against xetex but with limited font trickery because we bypass +% the normal font handling. It's no big deal for a test. The biggest problem is that we +% run into default features and we don't know what is turned on by default. We also need +% to disable tagging so that hb itself can do some (init/medi/fina) magic in setting +% features. + +\startsetups otftracker-extra + \start + \blank + \definefontfeature + [otftracker-context-reordered] + [\getvariable{otftracker}{features}] + [reorderlookups=arab] + \definefontfeature + [otftracker-harfbuzz-uniscribe] + [\getvariable{otftracker}{features}] + [mode=plug, + features=harfbuzz, + shaper=uniscribe, + % stch=nothing, + % ccmp=nothing, + % locl=nothing, + % rlig=nothing, + % calt=nothing, + % mset=nothing, + fina=nothing, % looks like the libs does something special + init=nothing, % looks like the libs does something special + medi=nothing, % looks like the libs does something special + isol=nothing, % looks like the libs does something special + % method=binary, + script=arabic] + \definefontfeature + [otftracker-harfbuzz-native] + [\getvariable{otftracker}{features}] + [mode=plug, + features=harfbuzz, + shaper=native, + % stch=nothing, + % ccmp=nothing, + % locl=nothing, + % rlig=nothing, + % calt=nothing, + % mset=nothing, + fina=nothing, % looks like the libs does something special + init=nothing, % looks like the libs does something special + medi=nothing, % looks like the libs does something special + isol=nothing, % looks like the libs does something special + script=arabic] + \doifelsesomething {\getvariable{otftracker}{comment}} { + \def\ExtraComment{ + \TB + \NC + comment + \NC + \vtop { + \hsize\dimexpr\hsize-10em\relax + \veryraggedright + \getvariable{otftracker}{comment} + } + \NC \NR + } + } { + \def\ExtraComment{} + } + \starttabulate[|lTB|l|] + \NC + context + \NC + \showglyphs \showfontkerns + \enabletrackers[otf.sample.silent] + \ruledhbox{\directsetup{otftracker-extra-context}} + \disabletrackers[otf.sample] + \NC \NR \TB \NC + reordered + \NC + \showglyphs \showfontkerns + \enabletrackers[otf.sample.silent] + \ruledhbox{\directsetup{otftracker-extra-context-reordered}} + \disabletrackers[otf.sample] + \NC \NR \TB \NC + harfbuzz + \NC + \showglyphs \showfontkerns + \enabletrackers[fonts.plugins.hb.colors] + \ruledhbox{\directsetup{otftracker-extra-harfbuzz}} + \disabletrackers[fonts.plugins.hb.colors] + \NC \NR \TB \NC + uniscribe + \NC + \showglyphs \showfontkerns + \enabletrackers[fonts.plugins.hb.colors] + \ruledhbox{\directsetup{otftracker-extra-uniscribe}} + \disabletrackers[fonts.plugins.hb.colors] + \NC \NR \TB \NC + context + \NC + \showglyphs \showfontkerns + \ruledhbox{\directsetup{otftracker-extra-context}} + \NC \NR \TB \NC + harfbuzz + \NC + \showglyphs \showfontkerns + \ruledhbox{\directsetup{otftracker-extra-harfbuzz}} + \NC \NR \TB \NC + uniscribe + \NC + \showglyphs \showfontkerns + \ruledhbox{\directsetup{otftracker-extra-uniscribe}} + \NC \NR \TB \NC + context harfbuzz + \NC + \showglyphs \showfontkerns + \hbox to \zeropoint { + \ruledhbox{\color[otftracker-overlay-1]{\directsetup{otftracker-extra-harfbuzz}}} + \hss + } + \ruledhbox{\color[otftracker-overlay-3]{\directsetup{otftracker-extra-context}}} + \NC \NR \TB \NC + uniscribe harfbuzz + \NC + \showglyphs \showfontkerns + \hbox to \zeropoint { + \ruledhbox{\color[otftracker-overlay-1]{\directsetup{otftracker-extra-harfbuzz}}} + \hss + } + \ruledhbox{\color[otftracker-overlay-2]{\directsetup{otftracker-extra-uniscribe}}} + \NC \NR \TB \NC + context uniscribe + \NC + \showglyphs \showfontkerns + \hbox to \zeropoint { + \ruledhbox{\color[otftracker-overlay-1]{\directsetup{otftracker-extra-uniscribe}}} + \hss + } + \ruledhbox{\color[otftracker-overlay-2]{\directsetup{otftracker-extra-context}}} + \NC \NR + \ExtraComment + \stoptabulate + \stop +\stopsetups + +\stopmodule diff --git a/tex/context/modules/mkiv/s-fonts-steps.mkiv b/tex/context/modules/mkiv/s-fonts-steps.mkiv new file mode 100644 index 000000000..6e11a6a77 --- /dev/null +++ b/tex/context/modules/mkiv/s-fonts-steps.mkiv @@ -0,0 +1,186 @@ +%D \module +%D [ file=s-fonts-steps, % was s-fnt-20 +%D version=2009.01.10, +%D title=\CONTEXT\ Style File, +%D subtitle=Tracing Feature Application (1), +%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. + +%D This file is used by Idris and me in the process of getting the +%D best arabic fonts getting rendered best. As such it might change. + +\startmodule[fonts-steps] + +% \setvariables +% [otftracker] +% [title=Reverse Chaining, +% figure=test-003-volt.pdf, +% font=husayni, +% sample={ببب بببب ببببب بببببب}] + +\def\checkedotftrackerfeature #1{otftracker-\ifnum\featureattribute{otftracker-#1}=\zerocount default\else#1\fi} +\def\checkedotftrackerdirection#1{\csname otftracker-direction-\ifcsname otftracker-direction-#1\endcsname#1\else default\fi\endcsname} + +% we can consider adding a dir key to features + +\definefontfeature + [otftracker-default] + [default] + [mode=node] + +\definefontfeature + [otftracker-arabtype] + [mode=node,analyze=yes, + language=dflt,script=arab,ccmp=yes, + init=yes,medi=yes,fina=yes,isol=yes, + liga=yes,dlig=yes,rlig=yes,clig=yes, + mark=yes,mkmk=yes,kern=yes,curs=yes] + +\definefontfeature + [otftracker-husayni-default] + [analyze=yes,mode=node, + language=dflt,script=arab, + init=yes,medi=yes,fina=yes, + spacekern=yes, + calt=yes, + rlig=yes, + ccmp=yes, + salt=yes, + ss01=yes, % full Allah, Muhammad, Allahumma + ss05=yes, % full Jiim stacking + ss09=yes, % full Haa stacking + ss10=yes, % partial dipped Miim + ss13=yes, % full stacked Miim + ss15=yes, % full stacked Laam-on-Miim + ss17=yes, % full stacked Ayn-on-Miim + ss19=yes, % LM_im + ss24=yes, % BX specials + ss25=yes, % LH_im specials + ss26=yes, % full Yaa.final specials + ss27=yes, % partial thin Miim.final + ss31=yes, % partial Raa.final contexts + ss34=yes, % partial Raa.final contexts + ss35=yes, % full Kaaf contexts + ss36=yes, % full Laam contexts + ss37=yes, % Miim-Miim contexts + ss38=yes, % fancy thin Haa.medial-Miim.final + ss39=yes, % high and low Baa strings + ss40=yes, % diagonal entry + ss41=yes, % initial alternates + mark=yes,mkmk=yes,kern=yes,curs=yes] + +\definefontfeature + [otftracker-husayni] + [otftracker-husayni-default] + +\definefontfeature + [otftracker-simplenaskhi] + [analyze=yes,mode=node, + language=dflt,script=arab, + init=yes,medi=yes,fina=yes,calt=yes, + rlig=yes,liga=yes,dlig=yes, + mark=yes,mkmk=yes,kern=yes,curs=yes] + +\setvalue{otftracker-direction-arabtype}{r2l} +\setvalue{otftracker-direction-husayni}{r2l} +\setvalue{otftracker-direction-simplenaskhi}{r2l} +\setvalue{otftracker-direction-default}{} +\setvalue{otftracker-direction-sbl-hbrw}{r2l} + +\setvariables + [otftracker] + [font=Serif, + features=\checkedotftrackerfeature{\getvariable{otftracker}{font}}, + direction=\checkedotftrackerdirection{\getvariable{otftracker}{font}}, + size=48pt, + figure=, + title=Feature Check, + sample=no sample, + set=\setups{otftracker}] + +\setuplayout + [topspace=1.5cm, + backspace=1.5cm, + width=middle, + height=middle, + header=1.5cm, + footer=1.5cm] + +\setuphead + [chapter] + [header=high, + number=no] + +\setupfootertexts + [chapter] + +\setupalign + [flushleft] + +\setupcolors + [state=start] + +\startsetups otftracker-steps + \doifsomething {\getvariable{otftracker}{figure}} { + \startlinecorrection + \externalfigure[\getvariable{otftracker}{figure}][maxwidth=\hsize,frame=on] + \stoplinecorrection + } + \showotfcomposition + {\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}} + {\getvariable{otftracker}{direction}} + {\getvariable{otftracker}{sample}} +\stopsetups + +\startsetups otftracker + \setupbodyfont[tt,10pt] + \starttext + \normalexpanded{\startchapter[title={\getvariable{otftracker}{title}}]} + \directsetup{otftracker-steps} + \directsetup{otftracker-extra} + \stopchapter + \setvariables[otftracker][comment=] + \stoptext +\stopsetups + +%D For old times sake we keep this one: + +\unexpanded\def\ShowOtfTrackerSample#1% + {\doiffile{#1} + {\blank + \startlinecorrection + \vbox \bgroup + \forgetall + \setbox\scratchbox\hbox{\component #1 \relax} + \hbox{\copy\scratchbox\quad\lower\dp\scratchbox\hbox{\ruledhbox{\externalfigure[#1-volt.pdf][height=\htdp\scratchbox]}}} + \hbox{\strut\tttf#1}% + \egroup + \stoplinecorrection + \blank}} + +\stopmodule + +\continueifinputfile{s-fonts-steps.mkiv} + +\usemodule[art-01] + +\setupbodyfont +% [cambria] + [dejavu] + +\starttext + +\setvariables + [otftracker] + [font=Serif, + size=48pt, + figure=, + title=Feature Check, + sample={affiliation}] + +\stoptext diff --git a/tex/context/modules/mkiv/s-reg-01.mkiv b/tex/context/modules/mkiv/s-reg-01.mkiv deleted file mode 100644 index 36434c30c..000000000 --- a/tex/context/modules/mkiv/s-reg-01.mkiv +++ /dev/null @@ -1,60 +0,0 @@ -%D \module -%D [ file=s-reg-01, -%D version=2005.04.25, -%D title=\CONTEXT\ Style File, -%D subtitle=Extra Regime Support, -%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. - -%D \macros -%D {showregime} -%D -%D This code is moved from the kernel to here. (We could make it -%D auto-loadable). - -\startluacode ---[[ldx-- -

The following code is rather specific.

---ldx]]-- - -function regimes.show(regime) - regime = regimes.synonyms[regime] or regime - local r = regimes.data[regime] - if r then - local chardata = characters.data - context.starttabulate { "|rT|T|rT|lT|lT|lT|" } - for k, v in ipairs(r) do - local chr = chardata[v] - if chr then - context.NC() context(k) - context.NC() context.getvalue(chr.contextname]) - context.NC() context("%U+05X",v) - context.NC() context(chr.contextname) - context.NC() context(chr.category) - context.NC() context(chr.description) - context.NC() context.NR() - else - -- can't happen - end - end - context.stoptabulate() - else - context("unknown regime %s",regime) - end -end -\stopluacode - -\unprotect - -\def\showregime - {\dosingleempty\doshowregime} - -\def\doshowregime[#1]% - {\ctxlua{regimes.show("#1")}} - -\protect \endinput diff --git a/tex/context/modules/mkiv/s-regimes-list.mkiv b/tex/context/modules/mkiv/s-regimes-list.mkiv new file mode 100644 index 000000000..0124b3023 --- /dev/null +++ b/tex/context/modules/mkiv/s-regimes-list.mkiv @@ -0,0 +1,74 @@ +%D \module +%D [ file=s-regimes-list, % was: s-reg-01 +%D version=2005.04.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Extra Regime Support, +%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. + +%D \macros +%D {showregime} +%D +%D This code is moved from the kernel to here. + +\startmodule[regimes-list] + +\startluacode + +moduledata.regimes = moduledata.regimes or { } +moduledata.regimes.charts = moduledata.regimes.charts or { } + +local byte = string.byte + +function moduledata.regimes.charts.show(regime) + if regime and regime ~= "" then + local r = regimes.mapping[regime] + if r then + local chardata = characters.data + context.starttabulate { "|rT|rT|rT|cT|lT|lT|pT|" } + for k, v in table.sortedhash(r) do + local chr = chardata[v] + local num = byte(k) + local uni = utf.byte(v) + if chr then + context.NC() context(num) + context.NC() context("0x%02X",num) + context.NC() context("%U",uni) + context.NC() context.char(uni) + context.NC() context(chr.contextname) + context.NC() context(chr.category) + context.NC() context(chr.description) + context.NC() context.NR() + else + -- can't happen + end + end + context.stoptabulate() + else + context("unknown regime %s",regime) + end + else + context("available regimes: %, t",regimes.list()) + end +end + +\stopluacode + +\installmodulecommandluasingle \showregime {moduledata.regimes.charts.show} + +\stopmodule + +\continueifinputfile{s-regimes-list.mkiv} + +\usemodule[art-01] + +\starttext + + \showregime[8859-1] + +\stoptext -- cgit v1.2.3