Make below marks to avoid bottom-right Ogoneks (#1789).
This commit is contained in:
parent
5379351705
commit
d35b849f68
8 changed files with 49 additions and 17 deletions
|
@ -2,6 +2,7 @@
|
|||
- DIAMETER SIGN (`U+2300`) (#1923).
|
||||
- CIRCLE WITH SUPERIMPOSED X (`U+29BB`).
|
||||
- CLOCK FACE ONE OCLOCK (`U+1F550`) ... CLOCK FACE TWELVE-THIRTY (`U+1F567`) (#1850).
|
||||
* Make below marks to avoid bottom-right Ogoneks (#1789).
|
||||
* Use oval shape for Empty Set symbols to distinguish with O-Slash (#1822).
|
||||
* Implement leaning mark mechanism for `F`, `L`, `P`, `b`, `d`, `h`, `k`, `p`, `q`, `r` to get better mark placement. Now, "narrow" marks will align to these letters' extension parts (#1851).
|
||||
* Fix detached cedilla in Hookless asymmetric LATIN SMALL LETTER T WITH CEDILLA (`U+0163`) (#1914).
|
||||
|
|
|
@ -98,21 +98,33 @@ glyph-block AutoBuild-Accents : begin
|
|||
return { g }
|
||||
|
||||
define [markSubst uk] : begin
|
||||
local fromGlyphs : new Set
|
||||
local mapping : new Map
|
||||
foreach { k v } [Object.entries uk] : begin
|
||||
local gFrom : query-glyph k
|
||||
local gTo : query-glyph v
|
||||
if (gFrom && gTo) : begin
|
||||
fromGlyphs.add gFrom
|
||||
mapping.set gFrom gTo
|
||||
mapping.set gFrom gTo
|
||||
|
||||
define [matcher g] : fromGlyphs.has g
|
||||
define [matcher g] : mapping.has g
|
||||
define [ignore g] : g && g.markAnchors && [Object.keys g.markAnchors].length && ![matcher g]
|
||||
define [production g] : list ([mapping.get g] || g)
|
||||
|
||||
return : object matcher ignore production
|
||||
|
||||
define [markSplit uk] : begin
|
||||
local mapping : new Map
|
||||
foreach { k v } [Object.entries uk] : begin
|
||||
local gFrom : query-glyph k
|
||||
local gsTo : v.map query-glyph
|
||||
mapping.set gFrom gsTo
|
||||
|
||||
define [matcher g] : mapping.has g
|
||||
define [ignore g] : g && g.markAnchors && [Object.keys g.markAnchors].length && ![matcher g]
|
||||
define [production g] : begin
|
||||
console.log g [mapping.get g]
|
||||
return : [mapping.get g] || { g }
|
||||
|
||||
return : object matcher ignore production
|
||||
|
||||
define [markCombine uk] : begin
|
||||
local first : new Set
|
||||
local second : new Set
|
||||
|
@ -145,7 +157,7 @@ glyph-block AutoBuild-Accents : begin
|
|||
return : object matchFirst matchSecond production
|
||||
|
||||
define iotaLF : markSubst UnicodeKnowledge.iotaBelowToLfTf
|
||||
define ogonek : markSubst UnicodeKnowledge.ogonekBelowToTRTf
|
||||
define ogonek : markSplit UnicodeKnowledge.ogonekBelowToTRTf
|
||||
define upperTonos : markSubst UnicodeKnowledge.upperGrekMarkToTonosTf
|
||||
|
||||
define markComposition : markCombine UnicodeKnowledge.markCompositionTf
|
||||
|
|
|
@ -426,7 +426,7 @@ glyph-block Letter-Latin-K : begin
|
|||
|
||||
create-glyph "grek/KaiSymbol.\(suffix)" : glyph-proc
|
||||
include [refer-glyph "K.\(suffix)"] AS_BASE ALSO_METRICS
|
||||
include : MarkSet.capDesc
|
||||
include : ExtendBelowBaseAnchors Descender
|
||||
include : refer-glyph : match slabKS
|
||||
0 'UpperKaiSymbolAttachment/sans'
|
||||
1 'UpperKaiSymbolAttachment/serifed'
|
||||
|
|
|
@ -164,6 +164,7 @@ glyph-block Letter-Latin-Lower-E : begin
|
|||
create-glyph "eOgonek.\(suffix)" : glyph-proc
|
||||
include : MarkSet.e
|
||||
local lastKnot : include : Body [DivFrame 1] XH [AdviceStroke2 2 3 XH]
|
||||
include : refer-glyph 'ogonekTR/spacer'
|
||||
|
||||
# Connected Ogonek shape
|
||||
local fine : AdviceStroke 8
|
||||
|
|
|
@ -20,11 +20,13 @@ glyph-block Letter-Shared : begin
|
|||
|
||||
glyph-block-export CreateOgonekComposition
|
||||
define [CreateOgonekComposition dst u srcGid]
|
||||
derive-multi-part-glyphs dst u { srcGid 'ogonekBelow' 'ogonekTR' } : function [gns gr] : glyph-proc
|
||||
local { base markBelow markTR } gns
|
||||
derive-multi-part-glyphs dst u { srcGid 'ogonekBelow' 'ogonekTR/spacer' 'ogonekTR' } : function [gns gr] : glyph-proc
|
||||
local { base markBelow spacer markTR } gns
|
||||
include [refer-glyph base] AS_BASE ALSO_METRICS
|
||||
if currentGlyph.baseAnchors.trailing
|
||||
then : include [refer-glyph markTR]
|
||||
then : begin
|
||||
include [refer-glyph spacer]
|
||||
include [refer-glyph markTR]
|
||||
else : include [refer-glyph markBelow]
|
||||
|
||||
glyph-block-export CreateCommaCaronComposition
|
||||
|
|
|
@ -181,11 +181,12 @@ glyph-block Mark-Horn-And-Angle : begin
|
|||
'ogonekTR_Y' { (3/16) 1 6 0.5 }
|
||||
|
||||
foreach { glyphName { pExtL pExtR cwMidStrokeWidth paren } } [Object.entries ogonekTrConfig] : do
|
||||
local depth : 0 - Descender - markStroke
|
||||
|
||||
create-glyph glyphName : glyph-proc
|
||||
set-width 0
|
||||
|
||||
local fine : AdviceStroke 8
|
||||
local depth : 0 - Descender - markStroke
|
||||
local extL : pExtL * depth + 0.125 * markStress
|
||||
local extR : Math.max (pExtR * markExtend) (1.5 * TanSlope * markStroke)
|
||||
|
||||
|
@ -207,3 +208,7 @@ glyph-block Mark-Horn-And-Angle : begin
|
|||
set-mark-anchor 'trailing' markMiddle 0 (markMiddle + extR) (-depth - 0.5 * O - markStroke)
|
||||
set-base-anchor 'belowBraceL' (markMiddle - extL - paren * markExtend - [HSwToV : 0.25 * swMid]) (-0.75 * depth)
|
||||
set-base-anchor 'belowBraceR' (markMiddle - 0.75 * extL + paren * markExtend) (-0.75 * depth)
|
||||
|
||||
create-glyph "\(glyphName)/spacer" : glyph-proc
|
||||
set-width 0
|
||||
set-mark-anchor 'below' 0 0 0 (-depth - 0.5 * O - markStroke)
|
||||
|
|
|
@ -2,7 +2,7 @@ export : define iotaBelowToLfTf : object
|
|||
'iotaBelow' 'iotaLF'
|
||||
|
||||
export : define ogonekBelowToTRTf : object
|
||||
'ogonekBelow' 'ogonekTR'
|
||||
'ogonekBelow' { 'ogonekTR/spacer' 'ogonekTR' }
|
||||
|
||||
export : define ogonekBelowToTRTf_Y : object
|
||||
'ogonekBelow' 'ogonekTR_Y'
|
||||
|
|
|
@ -278,7 +278,6 @@ export : define [buildCCMPPostCvSs sink ccmpFeature glyphStore markGlyphs] : beg
|
|||
local rec : BeginLookupBlock sink
|
||||
|
||||
define ccmp : AddFeature sink 'ccmp'
|
||||
define {chain-rule} : ChainRuleBuilder sink
|
||||
|
||||
define triggerGlyphs_Normal { }
|
||||
define triggerGlyphs_Y { }
|
||||
|
@ -287,15 +286,27 @@ export : define [buildCCMPPostCvSs sink ccmpFeature glyphStore markGlyphs] : beg
|
|||
[OgonekTrY.get g] : triggerGlyphs_Y.push gid
|
||||
true : triggerGlyphs_Normal.push gid
|
||||
|
||||
define [markTransform_Normal] : UkMapToLookup UnicodeKnowledge.ogonekBelowToTRTf
|
||||
define [markTransform_Y] : UkMapToLookup UnicodeKnowledge.ogonekBelowToTRTf_Y
|
||||
define ogonekSpacerNormal : AddLookup sink : object
|
||||
.type 'gsub_multiple'
|
||||
.substitutions UnicodeKnowledge.ogonekBelowToTRTf
|
||||
define ogonekSpacerY : AddLookup sink : object
|
||||
.type 'gsub_single'
|
||||
.substitutions UnicodeKnowledge.ogonekBelowToTRTf_Y
|
||||
|
||||
define lookupMarks1 : AddLookup sink : object
|
||||
.type 'gsub_chaining'
|
||||
.ignoreGlyphs [filterMarkByClassNegated markGlyphs 'below']
|
||||
.rules : list
|
||||
chain-rule triggerGlyphs_Normal [markTransform_Normal]
|
||||
chain-rule triggerGlyphs_Y [markTransform_Y]
|
||||
object
|
||||
.match { triggerGlyphs_Y [Object.keys UnicodeKnowledge.ogonekBelowToTRTf_Y] }
|
||||
.inputBegins 1
|
||||
.inputEnds 2
|
||||
.apply {{.at 1 .lookup ogonekSpacerY}}
|
||||
object
|
||||
.match { triggerGlyphs_Normal [Object.keys UnicodeKnowledge.ogonekBelowToTRTf] }
|
||||
.inputBegins 1
|
||||
.inputEnds 2
|
||||
.apply {{.at 1 .lookup ogonekSpacerNormal}}
|
||||
|
||||
ccmpFeature.lookups.push lookupMarks1
|
||||
EndLookupBlock rec sink
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue