Fix feature application on OBJECT REPLACEMENT CHARACTER (U+FFFC) and REPLACEMENT CHARACTER (U+FFFD) (#1314).

This commit is contained in:
be5invis 2022-02-22 21:38:06 -08:00
parent 6af084ecbc
commit fe940318c9
8 changed files with 36 additions and 44 deletions

View file

@ -2,4 +2,4 @@
* Add variant selector for dot and comma diacritics (#1309).
* Fix enclosed glyphs' placement when having glyphs with different Y-shifting (#1310).
* Add metric override for `archDepth` and `smallArchDepth` (#1313).
* Fix feature application on OBJECT REPLACEMENT CHARACTER (`U+FFFC`) and REPLACEMENT CHARACTER (`U+FFFD`) (#1314).

View file

@ -734,7 +734,7 @@ glyph-block AutoBuild-Enclosure : begin
do "triple-digit dashed-boxed"
createDashedBoxedGlyphs 3 : list
list 0xFFFC {'O' 'B.standardSerifless' 'J.serifless'} WideWidth1
list 0xFFFC {'O' 'B' 'J/noDescend'} WideWidth1
do "inset boxed"
local compositions {}
@ -743,7 +743,7 @@ glyph-block AutoBuild-Enclosure : begin
do "inset diamond"
createInsetDiamondGlyphs 1 : list
list 0xFFFD { 'question' } WideWidth2
list 0xFFFD { "question" } WideWidth2
do "double-digit inset boxed"
createInsetBoxedGlyphs 2 : list
@ -757,7 +757,7 @@ glyph-block AutoBuild-Enclosure : begin
local compositions {}
compositions.push { 0x1FBB1 { [[glyphStore.queryNameOfUnicode (0x2714)].replace [regex '.WWID$'] ".NWID"] } WideWidth4 }
compositions.push { 0x1FBB4 { [[glyphStore.queryNameOfUnicode (0x21B2)].replace [regex '.WWID$'] ".NWID"] } WideWidth4 }
compositions.push { 0x1FBC4 { "question/hookPart" "question/dotPart" } WideWidth4 }
compositions.push { 0x1FBC4 { "question" } WideWidth4 }
createInsetMosaicGlyphs 1 compositions
do "Single-digit double circled"

View file

@ -204,12 +204,13 @@ glyph-block Common-Derivatives : begin
# Two-part glyphs
glyph-block-export create-two-part-glyph
define [create-two-part-glyph newid unicode id1 id2] : begin
create-glyph newid unicode : glyph-proc
set-width ([query-glyph id1].advanceWidth + [query-glyph id2].advanceWidth)
include [refer-glyph id1] AS_BASE
include [refer-glyph id2]
CvDecompose.set currentGlyph { id1 id2 }
derive-multi-part-glyphs newid unicode { id1 id2 } : function [src] : glyph-proc
local { a b } src
local awA [query-glyph a].advanceWidth
local awB [query-glyph b].advanceWidth
set-width (awA + awB)
include [refer-glyph a] AS_BASE
include [refer-glyph b]
glyph-block Recursive-Build : begin
define [Fork gs ps] : begin

View file

@ -124,6 +124,7 @@ glyph-block Letter-Latin-Upper-J : begin
if serif : include : serif df xSerifAttach XH
select-variant 'J' 'J'
select-variant 'J/noDescend' (shapeFrom -- 'J')
link-reduced-variant 'J/sansSerif' 'J' MathSansSerif
select-variant 'smcpJ' 0x1D0A (follow -- 'J')
alias 'cyrl/Je' 0x408 'J'

View file

@ -37,12 +37,12 @@ glyph-block Letter-Shared : begin
glyph-block-export CreateRightDependentComposite
define [CreateRightDependentComposite gidDst unicode gidPart1 gidPart2] : begin
create-glyph gidDst unicode : glyph-proc
local trigger : RightDependentTrigger.get : query-glyph gidPart2
local kernel : [RightDependentLink.get [query-glyph gidPart1] trigger] || gidPart1
derive-multi-part-glyphs gidDst unicode { gidPart1 gidPart2 } : function [src] : glyph-proc
local { a b } src
local trigger : RightDependentTrigger.get : query-glyph b
local kernel : [RightDependentLink.get [query-glyph a] trigger] || a
include [refer-glyph kernel] AS_BASE ALSO_METRICS
include [refer-glyph gidPart2]
CvDecompose.set currentGlyph { gidPart1 gidPart2 }
include [refer-glyph b]
glyph-block-export SetGrekUpperTonos
define [SetGrekUpperTonos kern] : glyph-proc

View file

@ -155,17 +155,10 @@ glyph-block Symbol-Math-APL : begin
create-glyph 0x235E : aplBoxed : refer-glyph 'asciiSingleQuote.straight'
create-glyph 0x236F : aplBoxed : refer-glyph 'notequal'
derive-glyphs 'apl/boxedDivide' 0x2339 'divide' : function [src gr] : aplBoxed : refer-glyph src
derive-glyphs 'apl/boxedColon' 0x2360 'colon/mid' : function [src gr] : aplBoxed : refer-glyph src
derive-glyphs 'apl/quadQuestion/hookPart' null 'question/hookPart' : function [src gr] : glyph-proc
include : aplBoxed : refer-glyph src
set-base-anchor 'cvDecompose' 0 0
derive-glyphs 'apl/quadQuestion/dotPart' null 'question/dotPart' : function [src gr] : glyph-proc
set-width 0
include : aplBoxedPhantom : WithTransform [Translate Width 0] : refer-glyph src
set-mark-anchor 'cvDecompose' 0 0
create-two-part-glyph 'apl/quadQuestion' 0x2370 'apl/quadQuestion/hookPart' 'apl/quadQuestion/dotPart'
define [DeriveBoxed src] : aplBoxed : refer-glyph src
derive-glyphs 'apl/boxedDivide' 0x2339 'divide' DeriveBoxed
derive-glyphs 'apl/boxedColon' 0x2360 'colon/mid' DeriveBoxed
derive-glyphs 'apl/quadQuestion' 0x2370 'question' DeriveBoxed
# Simple Composites
create-glyph 0x233D : composite-proc [refer-glyph 'apl/bar'] [refer-glyph 'whiteCircle.NWID']

View file

@ -23,9 +23,7 @@ glyph-block Symbol-Punctuation-Ligation-Variants : begin
* "bar"
* "slash"
* "backslash"
define dotLikeTwoPartPunctuations : list
* { "question" "question/hookPart" "question/dotPart" }
* "question"
define deltas : object
"dRight" 1.0
@ -41,21 +39,6 @@ glyph-block Symbol-Punctuation-Ligation-Variants : begin
refer-glyph src
Translate (delta * pDelta ) 0
define [LigDTwoParts baseName aPart bPart suffix pDelta] : if [glyph-is-needed baseName] : begin
local delta : Math.max 0 : Width / 2 - (XH - PeriodSize) / 2
derive-glyphs (aPart + '.lig.' + suffix) null aPart : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : Translate (delta * pDelta ) 0
set-base-anchor 'cvDecompose' 0 0
derive-glyphs (bPart + '.lig.' + suffix) null bPart : function [src gr] : glyph-proc
set-width 0
include [refer-glyph src] AS_BASE
include : Translate (delta * pDelta ) 0
set-mark-anchor 'cvDecompose' (-Width) 0
create-two-part-glyph (baseName + '.lig.' + suffix) null (aPart + '.lig.' + suffix) (bPart + '.lig.' + suffix)
foreach { suffix pDelta } [Object.entries deltas] : begin
foreach baseName [items-of dotLikePunctuations] : begin
LigD baseName suffix pDelta
foreach {baseName aPart bPart} [items-of dotLikeTwoPartPunctuations] : begin
LigDTwoParts baseName aPart bPart suffix pDelta

View file

@ -563,84 +563,98 @@ tag = "cv10"
rank = 1
description = "J without top serif"
selector.J = "serifless"
selector."J/noDescend" = "serifless"
selector."J/sansSerif" = "serifless"
[prime.capital-j.variants.serifed]
rank = 2
description = "J with top serif at left side"
selector.J = "serifed"
selector."J/noDescend" = "serifed"
selector."J/sansSerif" = "serifless"
[prime.capital-j.variants.serifed-both-sides]
rank = 3
description = "J with top serif at both sides (asymmetric)"
selector.J = "serifedBothSides"
selector."J/noDescend" = "serifedBothSides"
selector."J/sansSerif" = "serifless"
[prime.capital-j.variants.serifed-symmetric]
rank = 4
description = "J with top serif at both sides (symmetric)"
selector.J = "serifedSymmetric"
selector."J/noDescend" = "serifedSymmetric"
selector."J/sansSerif" = "serifless"
[prime.capital-j.variants.flat-hook-serifless]
rank = 5
description = "J with flat hook and without top serif"
selector.J = "flatHookSerifless"
selector."J/noDescend" = "flatHookSerifless"
selector."J/sansSerif" = "flatHookSerifless"
[prime.capital-j.variants.flat-hook-serifed]
rank = 6
description = "J with flat hook and top serif at left side"
selector.J = "flatHookSerifed"
selector."J/noDescend" = "flatHookSerifed"
selector."J/sansSerif" = "flatHookSerifless"
[prime.capital-j.variants.flat-hook-serifed-both-sides]
rank = 7
description = "J with flat hook and top serif at both sides (asymmetric)"
selector.J = "flatHookSeriflessBothSides"
selector."J/noDescend" = "flatHookSeriflessBothSides"
selector."J/sansSerif" = "flatHookSerifless"
[prime.capital-j.variants.flat-hook-serifed-symmetric]
rank = 8
description = "J with flat hook and top serif at both sides (symmetric)"
selector.J = "flatHookSerifedSymmetric"
selector."J/noDescend" = "flatHookSerifedSymmetric"
selector."J/sansSerif" = "flatHookSerifless"
[prime.capital-j.variants.descending-serifless]
rank = 9
description = "J with hook goes below descender and without serif"
selector.J = "descendingSerifless"
selector."J/noDescend" = "serifless"
selector."J/sansSerif" = "descendingSerifless"
[prime.capital-j.variants.descending-serifed]
rank = 10
description = "J with hook goes below descender and top serif at left side"
selector.J = "descendingSerifed"
selector."J/noDescend" = "serifed"
selector."J/sansSerif" = "descendingSerifless"
[prime.capital-j.variants.descending-serifed-both-sides]
rank = 11
description = "J with hook goes below descender and top serif at both sides (asymmetric)"
selector.J = "descendingSerifedBothSides"
selector."J/noDescend" = "serifedBothSides"
selector."J/sansSerif" = "descendingSerifless"
[prime.capital-j.variants.descending-serifed-symmetric]
rank = 12
description = "J with hook goes below descender and top serif at both sides (symmetric)"
selector.J = "descendingSerifedSymmetric"
selector."J/noDescend" = "serifedSymmetric"
selector."J/sansSerif" = "descendingSerifless"
[prime.capital-j.variants.descending-flat-hook-serifless]
rank = 13
description = "J with flat hook goes below descender and without serif"
selector.J = "descendingFlatHookSerifless"
selector."J/noDescend" = "flatHookSerifless"
selector."J/sansSerif" = "descendingFlatHookSerifless"
[prime.capital-j.variants.descending-flat-hook-serifed]
rank = 14
description = "J with flat hook goes below descender and top serif at left side"
selector.J = "descendingFlatHookSerifed"
selector."J/noDescend" = "flatHookSerifed"
selector."J/sansSerif" = "descendingFlatHookSerifless"