Fix leaning marks of turned capital F/L (#2137).

This commit is contained in:
be5invis 2023-12-31 08:56:32 -08:00
parent f3ecfc94c9
commit b3cad12960
33 changed files with 127 additions and 90 deletions

1
changes/28.0.4.md Normal file
View file

@ -0,0 +1 @@
* Fix leaning marks of turned capital F/L (#2137).

View file

@ -138,10 +138,10 @@ glyph-block Common-Derivatives : begin
if [not newid] : throw : new Error "Target ID not specified"
derive-glyphs newid unicode id
lambda [src gr] : glyph-proc
include [refer-glyph src] [if mark false AS_BASE] ALSO_METRICS
if mark : include mark
include [refer-glyph src] AS_BASE ALSO_METRICS
define x : if (_x <@ Function) [_x.call currentGlyph] _x
define y : if (_y <@ Function) [_y.call currentGlyph] _y
if mark : include mark
# This is [FlipAround], but we cannot use it because common-shapes depends on this
# glyph block
@ -164,31 +164,6 @@ glyph-block Common-Derivatives : begin
glyph-block-export HalfAdvance
define [HalfAdvance] : this.advanceWidth / 2
glyph-block-export TurnMarks
define [TurnMarks k fnOverride] : glyph-proc
local df : DivFrame (currentGlyph.advanceWidth / Width)
local mx : compositeBaseAnchors [df.markSet.(k)]
if fnOverride [fnOverride df] {.baseAnchors {.}}
include mx
glyph-block-export SwapMarks
define [SwapMarks k1 k2] : glyph-proc
# Swap markAnchors
local m1 currentGlyph.markAnchors.(k1)
local m2 currentGlyph.markAnchors.(k2)
currentGlyph.deleteMarkAnchor k1
currentGlyph.deleteMarkAnchor k2
if m1 : set currentGlyph.markAnchors.(k2) m1
if m2 : set currentGlyph.markAnchors.(k1) m2
# Swap baseAnchors
local b1 currentGlyph.baseAnchors.(k1)
local b2 currentGlyph.baseAnchors.(k2)
currentGlyph.deleteBaseAnchor k1
currentGlyph.deleteBaseAnchor k2
if b1 : set currentGlyph.baseAnchors.(k2) b1
if b2 : set currentGlyph.baseAnchors.(k1) b2
# Dual derivatives
glyph-block-export HCombine
define [HCombine newid unicode id1 id2 spacing] : begin

View file

@ -8,6 +8,7 @@ glyph-block Letter-Cyrillic-Che : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifFrame RightwardTailedBar DToothlessRise
glyph-block-import Letter-Shared-Shapes : CyrDescender BottomExtension
@ -101,7 +102,7 @@ glyph-block Letter-Cyrillic-Che : begin
refer-glyph 'cyrl/che.standard'
CyrDescender.lSideJut (RightSB - [HSwToV Stroke]) 0 (jut -- MidJutSide)
turned 'cyrl/Shha' 0x4BA 'cyrl/Che' Middle (CAP / 2)
CreateTurnedLetter 'cyrl/Shha' 0x4BA 'cyrl/Che' HalfAdvance (CAP / 2)
derive-composites 'cyrl/ShhaDescender' 0x526 'cyrl/Shha' [CyrDescender.rSideJut RightSB 0]
define [ChrVBar top] : begin

View file

@ -7,6 +7,7 @@ glyph-module
glyph-block Letter-Greek-Lower-Delta : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateTurnedLetter
create-glyph 'grek/delta.rounded' : glyph-proc
include : MarkSet.b
@ -70,4 +71,4 @@ glyph-block Letter-Greek-Lower-Delta : begin
alias 'cyrl/be.SRB' null 'grek/delta.rounded'
alias 'latindelta' 0x1E9F 'grek/delta'
turned 'turndelta' 0x18D 'grek/delta' Middle (XH / 2) [MarkSet.p]
CreateTurnedLetter 'turndelta' 0x18D 'grek/delta' HalfAdvance (XH / 2)

View file

@ -10,7 +10,7 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendBelowBaseAnchors
glyph-block-import Letter-Shared : CreateAccentedComposition
glyph-block-import Letter-Shared : CreateAccentedComposition CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifedArcStart SerifedArcEnd SerifFrame
glyph-block-import Letter-Shared-Shapes : InwardSlabArcStart InwardSlabArcEnd
glyph-block-import Letter-Shared-Shapes : ArcStartSerif ArcEndSerif
@ -473,7 +473,7 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
alias 'grek/epsilon' 0x3B5 'latn/epsilon.serifless'
select-variant 'latn/Epsilon' 0x190
select-variant 'latn/epsilon' 0x25B
turned 'turnepsilon' 0x1D08 'latn/epsilon' Middle (XH / 2)
CreateTurnedLetter 'turnepsilon' 0x1D08 'latn/epsilon' HalfAdvance (XH / 2)
alias 'cyrl/ZeRev' 0x510 'latn/Epsilon'
alias 'cyrl/zeRev' 0x511 'latn/epsilon'

View file

@ -8,7 +8,7 @@ glyph-module
glyph-block Letter-Greek-Upper-Omega : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : SetGrekUpperTonos
glyph-block-import Letter-Shared : SetGrekUpperTonos CreateTurnedLetter
define [UpperOmegaShape top extend ada adb] : glyph-proc
local fine : Stroke * CThin
@ -46,4 +46,4 @@ glyph-block Letter-Greek-Upper-Omega : begin
include : UpperOmegaShape CAP 0.08 ArchDepthA ArchDepthB
include : FlipAround Middle (CAP / 2)
turned 'latn/upsilon' 0x28A 'grek/smcpOmega' Middle (XH / 2)
CreateTurnedLetter 'latn/upsilon' 0x28A 'grek/smcpOmega' HalfAdvance (XH / 2)

View file

@ -9,6 +9,7 @@ glyph-block Letter-Latin-Glottal-Stop : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay
create-glyph 'glottalStop' 0x294 : glyph-proc
@ -65,7 +66,7 @@ glyph-block Letter-Latin-Glottal-Stop : begin
if SLAB : begin
include : HSerif.mb Middle 0 Jut
turned 'invGlottalStop' 0x296 'revGlottalStop' Middle (Ascender / 2)
CreateTurnedLetter 'invGlottalStop' 0x296 'revGlottalStop' HalfAdvance (Ascender / 2)
create-glyph 'glottalStopBar' 0x2A1 : glyph-proc
include [refer-glyph 'glottalStop'] AS_BASE

View file

@ -7,6 +7,7 @@ glyph-module
glyph-block Letter-Latin-Insular-G : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateTurnedLetter
define [InsularGShape top bot] : glyph-proc
local fine : AdviceStroke 4
@ -63,5 +64,5 @@ glyph-block Letter-Latin-Insular-G : begin
include : MarkSet.capital
include : InsularGShape CAP 0
turned 'GInsularTurned' 0xA77E 'GInsular' Middle (CAP / 2)
turned 'gInsularTurned' 0xA77F 'gInsular' Middle [mix Descender XH 0.5]
CreateTurnedLetter 'GInsularTurned' 0xA77E 'GInsular' HalfAdvance (CAP / 2)
CreateTurnedLetter 'gInsularTurned' 0xA77F 'gInsular' HalfAdvance [mix Descender XH 0.5]

View file

@ -9,6 +9,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : nShoulder OBarLeft
glyph-block-export SubDfAndShift
@ -407,8 +408,8 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
alias 'cyrl/ae' 0x4D5 'ae'
alias 'cyrl/oo' 0xA699 'oo'
turned 'turnae' 0x1D02 'ae' [DivFrame para.diversityM 3].middle (XH / 2)
turned 'turnoe' 0x1D14 'oe' [DivFrame para.diversityM 3].middle (XH / 2)
CreateTurnedLetter 'turnae' 0x1D02 'ae' HalfAdvance (XH / 2) [DivFrame para.diversityM 3]
CreateTurnedLetter 'turnoe' 0x1D14 'oe' HalfAdvance (XH / 2) [DivFrame para.diversityM 3]
derive-composites 'turnoeSlashO' 0xAB41 'turnoe' 'rightHalfSlashOverlay'
derive-composites 'turnoeBarO' 0xAB42 'turnoe' 'rightHalfBarOverlay'

View file

@ -10,7 +10,7 @@ glyph-block Letter-Latin-C : begin
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors ExtendBelowBaseAnchors
glyph-block-import Mark-Shared-Metrics : markStroke
glyph-block-import Letter-Shared : CreateDependentComposite
glyph-block-import Letter-Shared : CreateDependentComposite CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifFrame CurlyTail DToothlessRise
glyph-block-import Letter-Shared-Shapes : SerifedArcStart SerifedArcEnd InwardSlabArcStart
glyph-block-import Letter-Shared-Shapes : ArcStartSerif ArcEndSerif
@ -395,13 +395,13 @@ glyph-block Letter-Latin-C : begin
'std' 'c/centKernelStd'
'cap' 'c/centKernelCap'
turned 'turnC' 0x186 'C' Middle (CAP / 2)
turned 'turnc' 0x254 'c' Middle (XH / 2)
turned 'turnSmcpC' 0x1D10 'smcpC' Middle (XH / 2)
CreateTurnedLetter 'turnC' 0x186 'C' HalfAdvance (CAP / 2)
CreateTurnedLetter 'turnc' 0x254 'c' HalfAdvance (XH / 2)
CreateTurnedLetter 'turnSmcpC' 0x1D10 'smcpC' HalfAdvance (XH / 2)
alias 'grek/revLunateSigma' 0x3FD 'revC'
alias 'grek/revLunateSmallSigma' 0x37B 'revSmallC.serifless'
turned 'turnc/turnDescBase' null 'c/turnDescBase' Middle (XH / 2)
CreateTurnedLetter 'turnc/turnDescBase' null 'c/turnDescBase' HalfAdvance (XH / 2)
derive-composites 'turncRetroflexHook' 0x1D97 'turnc/turnDescBase'
RetroflexHook.l SB 0 (yAttach -- DToothlessRise)

View file

@ -12,7 +12,7 @@ glyph-block Letter-Latin-K : begin
glyph-block-import Mark-Shared-Metrics : markExtend
glyph-block-import Mark-Above : aboveMarkMid
glyph-block-import Mark-Adjustment : ExtendBelowBaseAnchors LeaningAnchor
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : DiagTail CyrDescender
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook TopHook
@ -456,10 +456,6 @@ glyph-block Letter-Latin-K : begin
if slabLT : include : UpperKLTSerif CAP Stroke xBarLeft slabLT
if slabLB : include : UpperKLBSerif CAP Stroke xBarLeft slabLB
turned "turnK.\(suffix)" nothing "K.\(suffix)" Middle (CAP / 2)
turned "smcpTurnK.\(suffix)" nothing "smcpK.\(suffix)" Middle (XH / 2)
define [BashkirKaShape df top] : glyph-proc
local left : if slabLT ([mix SB RightSB 0.35] - [HSwToV : 0.5 * df.mvs]) [mix SB RightSB 0.2]
local leftNB : left - [KBalance slabLT straightBar]
@ -591,9 +587,10 @@ glyph-block Letter-Latin-K : begin
derive-composites 'KStrokeLegStroke' 0xA744 'KStroke' 'legSlashOver'
derive-composites 'kStrokeLegStroke' 0xA745 'kStroke' 'legSlashOver'
select-variant 'turnK' 0xA7B0 (follow -- 'K')
CreateTurnedLetter 'turnK' 0xA7B0 'K' HalfAdvance (CAP / 2)
CreateTurnedLetter 'smcpTurnK' 0x1DF10 'smcpK' HalfAdvance (XH / 2)
select-variant 'turnk' 0x29E (follow -- 'k')
select-variant 'smcpTurnK' 0x1DF10 (follow -- 'K')
select-variant 'cyrl/BashkirUpperKa' 0x4A0 (follow -- 'cyrl/Ka')
select-variant 'cyrl/BashkirKa' 0x4A1 (follow -- 'cyrl/ka')

View file

@ -10,6 +10,7 @@ glyph-block Letter-Latin-Lower-A : begin
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Letter-Shared : CreateAccentedComposition CreateOgonekComposition
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifFrame OBarLeft OBarRight ArcStartSerif
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar InvRightwardTailedBar
glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend RetroflexHook
@ -300,7 +301,7 @@ glyph-block Letter-Latin-Lower-A : begin
link-reduced-variant 'a/turnABase' 'a'
alias 'cyrl/a' 0x430 'a'
turned 'turna' 0x250 'a/turnABase' Middle (XH / 2)
CreateTurnedLetter 'turna' 0x250 'a/turnABase' HalfAdvance (XH / 2)
derive-composites 'artail' 0x1D8F 'a/rtailBase'
RetroflexHook.rSideJut RightSB 0 (yOverflow -- Stroke)
@ -311,11 +312,11 @@ glyph-block Letter-Latin-Lower-A : begin
select-variant 'scripta' 0x0251
select-variant 'largescripta' 0x2C6D (follow -- 'scripta')
select-variant 'invscripta' 0xAB64 (follow -- 'scripta')
turned 'turnlargescripta' 0x2C70 'largescripta' Middle (CAP / 2)
turned 'turnscripta' 0x252 'scripta' Middle (XH / 2)
derive-composites 'alphaRetroflexHook' 0x1D90 'scripta.singleStoreySerifless'
RetroflexHook.rSideJut RightSB 0 (yOverflow -- Stroke)
CreateTurnedLetter 'turnscripta' 0x252 'scripta' HalfAdvance (XH / 2)
CreateTurnedLetter 'turnlargescripta' 0x2C70 'largescripta' HalfAdvance (CAP / 2)
CreateAccentedComposition 'aDieresis' 0xE4 'a' 'dieresisAbove'
CreateAccentedComposition 'aSbRsbUnderlineBelow' null 'a' 'sbRsbUnderlineBelow'

View file

@ -8,7 +8,7 @@ glyph-module
glyph-block Letter-Latin-Lower-E : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateSelectorVariants DefineSelectorGlyph
glyph-block-import Letter-Shared : CreateSelectorVariants DefineSelectorGlyph CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : FlatHookDepth RetroflexHook
glyph-block-import Letter-Shared-Shapes : SerifedArcEnd ArcEndSerif DToothlessRise
glyph-block-import Mark-Shared-Metrics : markExtend markStroke markStress markFine
@ -273,7 +273,7 @@ glyph-block Letter-Latin-Lower-E : begin
select-variant 'e' 'e'
alias 'cyrl/ie' 0x435 'e'
turned 'turne' 0x1DD 'e' Middle (XH / 2)
CreateTurnedLetter 'turne' 0x1DD 'e' HalfAdvance (XH / 2)
select-variant 'eOgonek' 0x119 (follow -- 'e')
select-variant 'eRetroflexHook' 0x1D92 (follow -- 'e')

View file

@ -9,6 +9,7 @@ glyph-block Letter-Latin-Lower-G : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : OBarLeft OBarRight DToothlessRise DMBlend
glyph-block-import Letter-Shared-Shapes : FlatHookDepth CurlyTail PalatalHook TopHook
@ -209,7 +210,7 @@ glyph-block Letter-Latin-Lower-G : begin
select-variant 'g' 'g'
link-reduced-variant 'g/sansSerif' 'g' MathSansSerif
turned 'turng' 0x1D77 'g' Middle [mix Descender XH 0.5]
CreateTurnedLetter 'turng' 0x1D77 'g' HalfAdvance [mix Descender XH 0.5]
select-variant "gBar" 0x1E5 (follow -- 'g')
select-variant 'g/single' null (shapeFrom -- 'g')

View file

@ -11,6 +11,7 @@ glyph-block Letter-Latin-Lower-I : begin
glyph-block-import Mark-Adjustment : ExtendBelowBaseAnchors
glyph-block-import Letter-Shared : CreateAccentedComposition CreateMultiAccentedComposition
glyph-block-import Letter-Shared : CreateCommaCaronComposition CreateOgonekComposition
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : FlatHookDepth DiagTail
glyph-block-import Letter-Shared-Shapes : CurlyTail BeltOverlay PalatalHook
glyph-block-import Letter-Shared-Shapes : RetroflexHook LetterBarOverlay RightwardTailedBar
@ -321,7 +322,7 @@ glyph-block Letter-Latin-Lower-I : begin
select-variant 'latn/Iota' 0x196 (follow -- 'latn/iota')
alias 'cyrl/Iota' 0xA646 'latn/Iota'
turned 'turni' 0x1D09 'i' HalfAdvance (XH / 2) [TurnMarks 'p']
CreateTurnedLetter 'turni' 0x1D09 'i' HalfAdvance (XH / 2)
CreateAccentedComposition 'cyrl/ghe.SRB' null 'dotlessi/tailed' 'macronAbove'
CreateMultiAccentedComposition 'cyrl/gje.SRB' null 'dotlessi/tailed' { 'macronAbove' 'acuteAbove' }
@ -337,7 +338,7 @@ glyph-block Letter-Latin-Lower-I : begin
select-variant 'lRTail/decompress' (follow -- 'l/reduced/rtailDec') (shapeFrom -- 'lRTail')
alias 'cyrl/palochka' 0x4CF 'l'
turned 'turnl' 0xA781 'l' HalfAdvance (XH / 2) [TurnMarks 'p']
CreateTurnedLetter 'turnl' 0xA781 'l' HalfAdvance (XH / 2)
select-variant 'l/phoneticLeft' (shapeFrom -- 'l')
select-variant 'l/compLigRight' (shapeFrom -- 'l')
select-variant 'lDotBase' null (follow -- 'l')

View file

@ -9,7 +9,7 @@ glyph-block Letter-Latin-Lower-T : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared : CreateCommaCaronComposition
glyph-block-import Letter-Shared : CreateCommaCaronComposition CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth ConnectedCedilla SerifedArcEnd
glyph-block-import Letter-Shared-Shapes : DiagTail DToothlessRise
glyph-block-import Letter-Shared-Shapes : TopHook PalatalHook
@ -276,8 +276,6 @@ glyph-block Letter-Latin-Lower-T : begin
local attach : currentGlyph.gizmo.unapply currentGlyph.baseAnchors.hooktopAttach
include : TopHook.mBarInner attach.x XH Ascender
turned "turnt.\(suffix)" nothing "t.\(suffix)" df.middle (XH / 2) [df.markSet.p]
create-glyph "tCurlyTail.\(suffix)" : glyph-proc
include : MarkSet.b
@ -305,7 +303,6 @@ glyph-block Letter-Latin-Lower-T : begin
select-variant 't/phoneticLeft1' (shapeFrom -- 't')
select-variant 't/phoneticLeft2'
select-variant 't/phoneticRight'
select-variant 'turnt' 0x287 (follow -- 't')
CreateCommaCaronComposition 'tcaron' 0x165 't'
derive-glyphs 'tCedilla' 0x163 't' ConnectedCedilla
@ -316,6 +313,8 @@ glyph-block Letter-Latin-Lower-T : begin
select-variant "tHookTopRTail" 0x1DF09
CreateTurnedLetter "turnt" 0x287 "t" HalfAdvance (XH / 2)
# U+01BE is actually "t" and "s" combined together
define SLAB-NONE 0
define SLAB-CLASSICAL 1

View file

@ -11,7 +11,7 @@ glyph-block Letter-Latin-Lower-Y : begin
glyph-block-import Mark-Shared-Metrics : markExtend markStroke markStress markFine
glyph-block-import Mark-Above : aboveMarkTop aboveMarkBot aboveMarkMid aboveMarkStack
glyph-block-import Mark-Below : belowMarkStack
glyph-block-import Letter-Shared : CreateAccentedComposition
glyph-block-import Letter-Shared : CreateAccentedComposition CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : nShoulder FlatHookDepth SerifFrame BeltOverlay TopHook
define SLAB-NONE { false false false }
@ -413,7 +413,7 @@ glyph-block Letter-Latin-Lower-Y : begin
link-reduced-variant 'y/sansSerif' 'y' MathSansSerif
select-variant 'cyrl/u' 0x443 (shapeFrom -- 'y')
turned 'turny' 0x28E 'y/nonCursive' Middle (XH / 2) [MarkSet.b]
CreateTurnedLetter 'turny' 0x28E 'y/nonCursive' HalfAdvance (XH / 2)
derive-glyphs 'turnyBelt' 0x1DF06 'y/nonCursive' : function [src sel] : glyph-proc
include : MarkSet.b
include [refer-glyph src]

View file

@ -11,7 +11,7 @@ glyph-block Letter-Latin-Upper-A : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Letter-Shared : SetGrekUpperTonos CreateOgonekComposition
glyph-block-import Letter-Shared : SetGrekUpperTonos CreateOgonekComposition CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifFrame
glyph-block-import Letter-Latin-V : VShapeOutline VShape VCornerHalfWidth
@ -156,7 +156,7 @@ glyph-block Letter-Latin-Upper-A : begin
select-variant 'currency/australSign' 0x20B3 (follow -- 'A')
link-reduced-variant 'grek/Alpha/sansSerif' 'grek/Alpha' MathSansSerif (follow -- 'A/sansSerif')
alias 'cyrl/A' 0x410 'A'
turned 'turnA' 0x2C6F 'A' Middle (CAP / 2)
CreateTurnedLetter 'turnA' 0x2C6F 'A' HalfAdvance (CAP / 2)
select-variant 'grek/Lambda' 0x39B
link-reduced-variant 'grek/Lambda/sansSerif' 'grek/Lambda' MathSansSerif
@ -224,9 +224,9 @@ glyph-block Letter-Latin-Upper-A : begin
select-variant 'increment.aplForm' [CodeApl 0x2206] (follow -- 'grek/Delta')
select-variant 'increment.aplThin' (follow -- 'grek/Delta')
turned 'nabla' [CodeNonApl 0x2207] 'increment' Middle (CAP / 2)
turned 'nabla.aplForm' [CodeApl 0x2207] 'increment.aplForm' Middle SymbolMid
turned 'nabla.aplThin' null 'increment.aplThin' Middle SymbolMid
CreateTurnedLetter 'nabla' [CodeNonApl 0x2207] 'increment' HalfAdvance (CAP / 2)
CreateTurnedLetter 'nabla.aplForm' [CodeApl 0x2207] 'increment.aplForm' HalfAdvance SymbolMid
CreateTurnedLetter 'nabla.aplThin' null 'increment.aplThin' HalfAdvance SymbolMid
derive-glyphs 'cyrl/De.BGR' null 'grek/Delta' : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS

View file

@ -9,7 +9,7 @@ glyph-block Letter-Latin-Upper-E : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Letter-Shared : SetGrekUpperTonos CreateOgonekComposition
glyph-block-import Letter-Shared : SetGrekUpperTonos CreateOgonekComposition CreateTurnedLetter
glyph-block-import Letter-Latin-Upper-F : xMidBarShrink yMidBar EFVJutLength
define kSB 1
@ -74,7 +74,7 @@ glyph-block Letter-Latin-Upper-E : begin
alias 'cyrl/Ie' 0x415 'E'
select-variant 'revE' 0x18E (follow -- 'E')
turned 'turnSmcpE' 0x2C7B 'smcpE' Middle (XH / 2)
CreateTurnedLetter 'turnSmcpE' 0x2C7B 'smcpE' HalfAdvance (XH / 2)
glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/E' 0x1D53C : glyph-proc

View file

@ -9,6 +9,7 @@ glyph-block Letter-Latin-Upper-F : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay PalatalHook
glyph-block-export xMidBarShrink
@ -95,9 +96,8 @@ glyph-block Letter-Latin-Upper-F : begin
FShape CAP (stroke -- BBS)
Rect (CAP - BBS) BBS (xFBarLeft + [HSwToV BBS]) (xFBarLeft + BBD)
turned 'turnF' 0x2132 'F' Middle (CAP / 2)
turned 'turnSmcpF' 0x214E 'smcpF' Middle (XH / 2)
CreateTurnedLetter 'turnF' 0x2132 'F' HalfAdvance (CAP / 2)
CreateTurnedLetter 'turnSmcpF' 0x214E 'smcpF' HalfAdvance (XH / 2)
derive-glyphs 'Fltail' 0x191 'F' : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS

View file

@ -9,6 +9,7 @@ glyph-block Letter-Latin-Upper-G : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : DToothlessRise ShoulderMidKnotLhs
glyph-block-import Letter-Shared-Shapes : SerifedArcStart TopHook
glyph-block-import Letter-Shared-Shapes : ArcStartSerif LetterBarOverlay SerifFrame
@ -111,7 +112,7 @@ glyph-block Letter-Latin-Upper-G : begin
select-variant 'smcpG' 0x262 (follow -- 'G')
select-variant 'GHookTop' 0x193
select-variant 'smcpGHookTop' 0x29B (follow -- 'GHookTop')
turned 'turnSmcpG' 0x1DF02 'smcpG' Middle (XH / 2)
CreateTurnedLetter 'turnSmcpG' 0x1DF02 'smcpG' HalfAdvance (XH / 2)
derive-composites 'Gbar' 0x1E4 'G' 'GBarOverlay'

View file

@ -12,6 +12,7 @@ glyph-block Letter-Latin-Upper-L : begin
glyph-block-import Mark-Above : aboveMarkMid
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : BeltOverlay LetterBarOverlay
define [LBarLeftX df] : df.leftSB * 1.5
@ -71,7 +72,7 @@ glyph-block Letter-Latin-Upper-L : begin
select-variant 'LLWelsh' 0x1EFA (follow -- 'L')
select-variant 'LHighBar' 0xA748 (follow -- 'L')
turned 'turnL' 0xA780 'L' Middle (CAP / 2)
CreateTurnedLetter 'turnL' 0xA780 'L' HalfAdvance (CAP / 2)
create-glyph 'mathbb/L' 0x1D543 : glyph-proc
local df : include : DivFrame 1

View file

@ -8,6 +8,7 @@ glyph-module
glyph-block Letter-Latin-Upper-M : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifFrame CyrTailDescender PalatalHook
define FORM-FLAT 0
@ -179,7 +180,7 @@ glyph-block Letter-Latin-Upper-M : begin
alias 'grek/San' 0x3FA 'M.grekCapitalSan'
alias 'grek/san' 0x3FB 'smcpMWithDescender.grekSmallSan'
turned 'turnM' null 'M' HalfAdvance (CAP / 2)
CreateTurnedLetter 'turnM' null 'M' HalfAdvance (CAP / 2)
glyph-block-import Letter-Blackboard : BBS BBD BBBarRight
create-glyph 'mathbb/M' 0x1D544 : glyph-proc

View file

@ -8,9 +8,10 @@ glyph-module
glyph-block Letter-Latin-Upper-R : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Latin-Upper-P : PShape RevPShape PBarPosY PRotundaShape BBPShape PShapeOutline
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar RetroflexHook
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-import Letter-Latin-Upper-P : PShape RevPShape PBarPosY PRotundaShape BBPShape PShapeOutline
glyph-block-export RConfig RevRShape RBarPos
define LEG-SHAPE-CURLY 0
@ -258,7 +259,7 @@ glyph-block Letter-Latin-Upper-R : begin
select-variant 'RRTail' 0x2C64
select-variant 'smcpR' 0x280 (follow -- 'R')
turned 'turnSmapR' 0x1D1A 'smcpR' Middle (XH / 2)
CreateTurnedLetter 'turnSmapR' 0x1D1A 'smcpR' HalfAdvance (XH / 2)
select-variant 'RRotunda' 0xA75A
select-variant 'rRotunda' 0xA75B (follow -- 'RRotunda')
@ -266,7 +267,7 @@ glyph-block Letter-Latin-Upper-R : begin
select-variant 'cyrl/Ya' 0x42F
select-variant 'cyrl/ya' 0x44F
select-variant 'revSmcpR' 0x1D19 (shapeFrom -- 'cyrl/ya') (follow -- 'R')
turned 'invSmcpR' 0x281 'revSmcpR' Middle (XH / 2)
CreateTurnedLetter 'invSmcpR' 0x281 'revSmcpR' HalfAdvance (XH / 2)
select-variant 'Yr' 0x1A6 (follow -- 'R')
select-variant 'smcpRLongRightLeg' 0xAB46 (follow -- 'R')

View file

@ -10,6 +10,7 @@ glyph-block Letter-Latin-Upper-T : begin
glyph-block-import Common-Derivatives
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-import Letter-Latin-Lower-M
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay UpwardHookShape
glyph-block-import Letter-Shared-Shapes : CyrDescender SerifFrame FlatHookDepth LeftHook RetroflexHook
@ -139,8 +140,6 @@ glyph-block Letter-Latin-Upper-T : begin
y -- 0
jut -- [if doSB MidJutCenter Jut]
turned "turnT.\(suffix)" nothing "T.\(suffix)" df.middle (CAP / 2)
create-glyph "TRTailBR.\(suffix)" : glyph-proc
include [refer-glyph "T.\(suffix)"] AS_BASE ALSO_METRICS
include : MarkSet.capital
@ -167,7 +166,7 @@ glyph-block Letter-Latin-Upper-T : begin
select-variant "TStroke" 0x166 (follow -- 'T')
select-variant "Thookleft" 0x1AC (follow -- 'T')
select-variant "cyrl/TeDescender" 0x4AC (follow -- 'T')
select-variant 'turnT' 0xA7B1 (follow -- 'T')
CreateTurnedLetter 'turnT' 0xA7B1 'T' HalfAdvance (CAP / 2)
alias 'grek/Tau' 0x3A4 'T'
alias-reduced-variant 'grek/Tau/sansSerif' 'grek/Tau' 'T/sansSerif' MathSansSerif

View file

@ -9,6 +9,7 @@ glyph-block Letter-Latin-V : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-export VShape VShapeOutline
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : DiagTail SerifFrame PalatalHook
glyph-block-import Letter-Blackboard : BBS BBD
@ -321,8 +322,8 @@ glyph-block Letter-Latin-V : begin
select-variant 'cyrl/Yn' 0xA65E (follow -- 'VHookRight')
alias 'cyrl/izhitsa' 0x475 'vHookRight'
turned 'turnV' 0x245 'V' Middle (CAP / 2)
turned 'turnv' 0x28C 'v' Middle (XH / 2)
CreateTurnedLetter 'turnV' 0x245 'V' HalfAdvance (CAP / 2)
CreateTurnedLetter 'turnv' 0x28C 'v' HalfAdvance (XH / 2)
glyph-block-export BBVShape BBVInnerMaskShape BBVOuterMaskShape
define [BBVShape l r kd ks top] : glyph-proc

View file

@ -8,6 +8,7 @@ glyph-module
glyph-block Letter-Latin-W : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : DiagTail SerifFrame VerticalHook
glyph-block-import Letter-Latin-Upper-M : MShape
@ -387,7 +388,7 @@ glyph-block Letter-Latin-W : begin
select-variant 'wHookTop' 0x2C73
alias 'cyrl/We' 0x51C 'W'
alias 'cyrl/we' 0x51D 'w'
turned 'turnw' 0x28D 'w' (Middle * para.diversityM) (XH / 2)
CreateTurnedLetter 'turnw' 0x28D 'w' HalfAdvance (XH / 2)
alias 'cyrl/Omega' 0x460 'W.cyrlCapialOmega'
alias 'cyrl/omega' 0x461 [if para.isItalic 'w.cyrlSmallOmega' 'w.cyrlCapialOmega']

View file

@ -9,6 +9,7 @@ glyph-module
glyph-block Letter-Shared : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : TurnMarks
glyph-block-export CreateAccentedComposition
define [CreateAccentedComposition dst u srcGid accentGid]
@ -80,6 +81,14 @@ glyph-block Letter-Shared : begin
define [SetGrekUpperTonos kern] : glyph-proc
set-base-anchor 'grekUpperTonos' kern (CAP - 0.75 * AccentStackOffset)
glyph-block-export CreateTurnedLetter
define [CreateTurnedLetter dstGid unicode srcGid _cx _cy _df] : begin
derive-glyphs dstGid unicode srcGid : lambda [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
define cx : if (_cx <@ Function) [_cx.call currentGlyph] _cx
define cy : if (_cy <@ Function) [_cy.call currentGlyph] _cy
include : FlipAround cx cy
include : TurnMarks cx cy _df
glyph-block Letter-Blackboard : begin
glyph-block-import CommonShapes

View file

@ -24,6 +24,38 @@ glyph-block Mark-Adjustment : begin
local a : currentGlyph.gizmo.unapply currentGlyph.baseAnchors.leaningAbove
if (a.y < y) : set-base-anchor 'leaningAbove' a.x y
glyph-block-export TurnMarks
define [TurnMarks cx cy _df] : glyph-proc
# Get position of existing marks, prior to flipping
local bAbove : currentGlyph.gizmo.unapplyIfPresent currentGlyph.baseAnchors.above
local bBelow : currentGlyph.gizmo.unapplyIfPresent currentGlyph.baseAnchors.below
local bLeaningAbove : currentGlyph.gizmo.unapplyIfPresent currentGlyph.baseAnchors.leaningAbove
local bLeaningBelow : currentGlyph.gizmo.unapplyIfPresent currentGlyph.baseAnchors.leaningBelow
# If there are no marks, or if there are no marks above or below, do nothing
if (!bAbove || !bBelow) : return nothing
# Apply the new mark set, with flipped dimensions
local df : _df || [if currentGlyph.divFrameParams
[DivFrame.fromParams currentGlyph.divFrameParams]
[DivFrame (currentGlyph.advanceWidth / Width)]]
local topAfterFlip : mix cy bBelow.y (-1)
local botAfterFlip : mix cy bAbove.y (-1)
local markSet : df.markSet.OfZone { .top topAfterFlip .bot botAfterFlip }
include : markSet
# Set the new marks' X coordinates to the flipped X coordinates of the old marks
if (bBelow && currentGlyph.baseAnchors.above)
set-base-anchor 'above' [mix cx bBelow.x (-1)] currentGlyph.baseAnchors.above.y
if (bAbove && currentGlyph.baseAnchors.below)
set-base-anchor 'below' [mix cx bAbove.x (-1)] currentGlyph.baseAnchors.below.y
# Handle leaning marks
if (bLeaningBelow && currentGlyph.baseAnchors.above)
set-base-anchor 'leaningAbove' [mix cx bLeaningBelow.x (-1)] currentGlyph.baseAnchors.above.y
if (bLeaningAbove && currentGlyph.baseAnchors.below)
set-base-anchor 'leaningBelow' [mix cx bLeaningAbove.x (-1)] currentGlyph.baseAnchors.below.y
glyph-block-export LeaningAnchor
define LeaningAnchor : namespace
define [SetProcImpl mkCenter mkLeaning x] : glyph-proc

View file

@ -429,6 +429,7 @@ export : define [GenDivFrame metrics] : begin
local mvs : fallback _mvs : if _hPack [metrics.AdviceStroke _hPack div] metrics.Stroke
local sbMul : fallback _sbMul : Math.min 1 : (metrics.Width * div - hPack * mvs) / (2 * hPack * metrics.SB)
set this.params : object div hPack sbMul mvs ox
set this.div div
set this.hPack hPack
set this.width : metrics.Width * div
@ -472,6 +473,11 @@ export : define [GenDivFrame metrics] : begin
public [applyToGlyph g] : begin
g.setWidth this.width
set g.divFrameParams this.params
return this
return : lambda [_div _hPack _sbMul _mvs _ox] : new CDivFrame _div _hPack _sbMul _mvs _ox
define [F _div _hPack _sbMul _mvs _ox] : begin
return : new CDivFrame _div _hPack _sbMul _mvs _ox
set F.fromParams : lambda [params] : begin
return : new CDivFrame params.div params.hPack params.sbMul params.mvs params.ox
return F

View file

@ -164,8 +164,8 @@ define-macro glyph-block-import : syntax-rules
define allExports : object
Common-Derivatives `[select-variant orthographic-italic orthographic-slanted
refer-glyph query-glyph alias turned HDual HCombine VDual VCombine derive-glyphs
derive-composites link-reduced-variant alias-reduced-variant HalfAdvance TurnMarks
SwapMarks derive-multi-part-glyphs DeriveMeshT]
derive-composites link-reduced-variant alias-reduced-variant HalfAdvance
derive-multi-part-glyphs DeriveMeshT]
CommonShapes `[no-shape tagged KnotAdj Rect SquareAt Ring RingAt DotAt RingStroke
RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt RoundStrokeTerminalAt

View file

@ -55,6 +55,10 @@ export class Transform {
this.unapplyToSink(pt, sink);
return sink;
}
unapplyIfPresent(pt) {
if (pt) return this.unapply(pt);
else return null;
}
inverse() {
const denom = this.xx * this.yy - this.xy * this.yx;
return new Transform(

View file

@ -18,6 +18,7 @@ export class Glyph {
this.gizmo = Transform.Id();
// Metrics
this.advanceWidth = 500;
this.divFrameParams = null;
this.markAnchors = {};
this.baseAnchors = {};
// Tracking