diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-08-19 20:32:31 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-08-19 20:32:31 +0200 |
commit | af60125ab3fa9e482720f0f46c2143fa08512113 (patch) | |
tree | 3e85c8a8a5979ebd05b891f8ecfb93d1b69ac41b /tex/context/modules | |
parent | d3d93bc4f0d21a259fdafee5ba1a744999474c28 (diff) | |
download | context-af60125ab3fa9e482720f0f46c2143fa08512113.tar.gz |
2021-08-19 19:43:00
Diffstat (limited to 'tex/context/modules')
-rw-r--r-- | tex/context/modules/mkiv/s-fonts-emoji.mkiv | 65 | ||||
-rw-r--r-- | tex/context/modules/mkiv/s-fonts-features.lua | 22 | ||||
-rw-r--r-- | tex/context/modules/mkiv/s-fonts-tables.lua | 20 |
3 files changed, 77 insertions, 30 deletions
diff --git a/tex/context/modules/mkiv/s-fonts-emoji.mkiv b/tex/context/modules/mkiv/s-fonts-emoji.mkiv index 1f303d569..096b90263 100644 --- a/tex/context/modules/mkiv/s-fonts-emoji.mkiv +++ b/tex/context/modules/mkiv/s-fonts-emoji.mkiv @@ -293,39 +293,64 @@ end \start -\definedfont[seguiemj*seguiemj-cl] +\definedfont[file:seguiemj.any*default,seguiemj-cl] -\ShowEmojiSnippets - [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone] +% \ShowEmojiSnippets +% [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone] -\ShowEmojiSnippetsOverlay - [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone] +% \ShowEmojiSnippetsOverlay +% [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone] -\ShowEmojiGlyphs - [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone] +% \ShowEmojiGlyphs +% [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone] -\page +% \page -\ShowEmoji[^man] +% \ShowEmoji[^man] -\page +% \ShowEmoji[backhand index pointing down] +% \ShowEmoji[backhand index pointing up] -\definecolor[emoji-base][r=.4] -\definecolor[emoji-gray][s=.5,t=.5,a=1] +\startTEXpage +[\char8205\char128104]=\char988828\par +[\char8205\char128105]=\char988851\par +[\char8205\char983484]=\char988834\par +[\char8205\char983485]=\char988835\par +[\char8205\char983486]=\char988836\par +[\char8205\char983487]=\char988837\par +[\char8205\char983488]=\char988838\par +[\char8205\char983495]=\char988858\par +[\char8205\char983496]=\char988859\par +[\char8205\char983497]=\char988860\par +[\char8205\char983498]=\char988861\par +[\char8205\char983499]=\char988862\par +\stopTEXpage -\definefontcolorpalette - [emoji-gray] - [emoji-base,emoji-gray] -\definefontfeature[seguiemj-cl][ccmp=yes,dist=yes,colr=emoji-gray] -\definedfont[seguiemj*seguiemj-cl] -\ShowEmoji -\page -\ShowEmojiPalettes[1] + + +% \page + +% \definecolor[emoji-base][r=.4] +% \definecolor[emoji-gray][s=.5,t=.5,a=1] + +% \definefontcolorpalette +% [emoji-gray] +% [emoji-base,emoji-gray] + +% \definefontfeature[seguiemj-cl][ccmp=yes,dist=yes,colr=emoji-gray] + +% \definedfont[seguiemj*seguiemj-cl] + +% \ShowEmoji + +% \page + +% \ShowEmojiPalettes[1] \stop diff --git a/tex/context/modules/mkiv/s-fonts-features.lua b/tex/context/modules/mkiv/s-fonts-features.lua index 34268c171..eb64e4c8f 100644 --- a/tex/context/modules/mkiv/s-fonts-features.lua +++ b/tex/context/modules/mkiv/s-fonts-features.lua @@ -200,6 +200,8 @@ function moduledata.fonts.features.showfeatureset(specification) end end +-- The next one looks a bit like the collector in font-oup.lua. + local function collectligatures(tfmdata) local sequences = tfmdata.resources.sequences @@ -207,18 +209,28 @@ local function collectligatures(tfmdata) return end + -- Mostly the same as s-fonts-tables so we should make a helper. + local series = { } local stack = { } local max = 0 + local function add(v) + local n = #stack + if n > max then + max = n + end + series[#series+1] = { v, unpack(stack) } + end + local function make(tree) for k, v in sortedhash(tree) do if k == "ligature" then - local n = #stack - if n > max then - max = n - end - series[#series+1] = { v, unpack(stack) } + add(v) + elseif tonumber(v) then + insert(stack,k) + add(v) + remove(stack) else insert(stack,k) make(v) diff --git a/tex/context/modules/mkiv/s-fonts-tables.lua b/tex/context/modules/mkiv/s-fonts-tables.lua index c9aa7b801..65725594b 100644 --- a/tex/context/modules/mkiv/s-fonts-tables.lua +++ b/tex/context/modules/mkiv/s-fonts-tables.lua @@ -678,18 +678,28 @@ end local function collectligatures(steps) + -- Mostly the same as s-fonts-features so we should make a helper. + local series = { } local stack = { } local max = 0 + local function add(v) + local n = #stack + if n > max then + max = n + end + series[#series+1] = { v, unpack(stack) } + end + local function make(tree) for k, v in sortedhash(tree) do if k == "ligature" then - local n = #stack - if n > max then - max = n - end - series[#series+1] = { v, unpack(stack) } + add(v) + elseif tonumber(v) then + insert(stack,k) + add(v) + remove(stack) else insert(stack,k) make(v) |