Add almost-flat-top variant for W and w (#2693). (#2695)

This commit is contained in:
Belleve 2025-02-26 19:42:05 -10:00 committed by GitHub
parent c6eee3535e
commit 42f1a21f77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 144 additions and 110 deletions

View file

@ -5,6 +5,7 @@
* \[**Breaking**\] Add variants for Capital Thorn (`Þ`) with symmetric/asymmetric bowl position.
* \[**Breaking**\] Add variant selector for Greek Lower Theta (#2630).
- As a result, character variant feature tags are reordered.
* Add almost-flat-top variant for `W` and `w` (#2693).
* Add `closed-contour` variant for Partial derivative symbol (#2148).
* Refine shape of the following characters:
- GREEK CAPITAL LETTER HETA (`U+0370`).

View file

@ -13,12 +13,13 @@ glyph-block Letter-Latin-W : begin
glyph-block-import Letter-Latin-Lower-M : EarlessRoundedDoubleArchSmallMShape
glyph-block-import Letter-Latin-Upper-M : MShape
define FORM-CURLY 0
define FORM-STRAIGHT 1
define FORM-FLAT-TOP 2
define FORM-DOUBLE-V 3
define FORM-ASYMMETRIC 4
define FORM-CYRL-OMEGA 5
define FORM-CURLY 0
define FORM-STRAIGHT 1
define FORM-ALMOST-FLAT-TOP 2
define FORM-FLAT-TOP 3
define FORM-DOUBLE-V 4
define FORM-ASYMMETRIC 5
define FORM-CYRL-OMEGA 6
define SERIFS-NONE 0
define SERIFS-AUTO 1
@ -47,61 +48,66 @@ glyph-block Letter-Latin-W : begin
define PXBot1Curly 0.25
define PXBot1Straight 0.235
define [WDim df top bodyType] : begin
define [WDim df top bodyType slabType] : begin
local strokeOuter : match bodyType
[Just FORM-CURLY] : AdviceStroke CwOuterStrokeCurly : Math.sqrt df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwOuterStrokeStraight1 : Math.sqrt df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwOuterStrokeStraight2 : Math.sqrt df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega : Math.sqrt df.adws
[Just FORM-CURLY] : AdviceStroke CwOuterStrokeCurly : Math.sqrt df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwOuterStrokeStraight1 : Math.sqrt df.adws
[Just FORM-ALMOST-FLAT-TOP] : AdviceStroke CwOuterStrokeStraight2 : Math.sqrt df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwOuterStrokeStraight2 : Math.sqrt df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega : Math.sqrt df.adws
local fineOuter : match bodyType
[Just FORM-CURLY] : AdviceStroke CwFineOuter df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwFineOuterStraight : Math.sqrt df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwFineOuterStraight : Math.sqrt df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega : Math.sqrt df.adws
[Just FORM-CURLY] : AdviceStroke CwFineOuter df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwFineOuterStraight : Math.sqrt df.adws
[Just FORM-ALMOST-FLAT-TOP] : AdviceStroke CwFineOuterStraight : Math.sqrt df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwFineOuterStraight : Math.sqrt df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega : Math.sqrt df.adws
local fineInner : match bodyType
[Just FORM-CURLY] : AdviceStroke CwFineInner df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwFineInnerStraight : Math.sqrt df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwFineInnerStraight : Math.sqrt df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwFineInnerDoubleV : Math.sqrt df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega : Math.sqrt df.adws
[Just FORM-CURLY] : AdviceStroke CwFineInner df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwFineInnerStraight : Math.sqrt df.adws
[Just FORM-ALMOST-FLAT-TOP] : AdviceStroke CwFineInnerStraight : Math.sqrt df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwFineInnerStraight : Math.sqrt df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwFineInnerDoubleV : Math.sqrt df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwDoubleV : Math.sqrt df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega : Math.sqrt df.adws
local fineHeight : (fineOuter + fineInner) / 2
local wCo : match bodyType
[Just FORM-CURLY] : AdviceStroke CwWCoCurly df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwWCoStraight df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwWCoStraight df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwWCoDoubleV df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwWCoDoubleV df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwWCoDoubleV df.adws
[Just FORM-CURLY] : AdviceStroke CwWCoCurly df.adws
[Just FORM-STRAIGHT] : AdviceStroke CwWCoStraight df.adws
[Just FORM-ALMOST-FLAT-TOP] : AdviceStroke CwWCoStraight df.adws
[Just FORM-FLAT-TOP] : AdviceStroke CwWCoStraight df.adws
[Just FORM-DOUBLE-V] : AdviceStroke CwWCoDoubleV df.adws
[Just FORM-ASYMMETRIC] : AdviceStroke CwWCoDoubleV df.adws
[Just FORM-CYRL-OMEGA] : AdviceStroke CwWCoDoubleV df.adws
local wCo2 : match bodyType
[Just FORM-CYRL-OMEGA] : AdviceStroke CwCyrlOmega df.adws
_ wCo
local kWCoShrink CThin
local pxBot1 : match bodyType
[Just FORM-CURLY] 0.25
[Just FORM-STRAIGHT] 0.235
[Just FORM-FLAT-TOP] 0.235
[Just FORM-DOUBLE-V] 0.315
[Just FORM-ASYMMETRIC] 0.3
[Just FORM-CYRL-OMEGA] 0.265
[Just FORM-CURLY] 0.25
[Just FORM-STRAIGHT] 0.235
[Just FORM-ALMOST-FLAT-TOP] 0.235
[Just FORM-FLAT-TOP] 0.235
[Just FORM-DOUBLE-V] 0.315
[Just FORM-ASYMMETRIC] 0.3
[Just FORM-CYRL-OMEGA] 0.265
local botMixOffset : HSwToV : 0.5 * wCo2
local xBot1 : [if bodyType O 0] + [mix (df.leftSB + botMixOffset) (df.rightSB - botMixOffset) pxBot1]
local xBot2 : df.width - xBot1
local topWithoutSerif : if SLAB (top - Stroke) top
local wMidHeight : match bodyType
[Just FORM-CURLY] : top * 0.6
[Just FORM-STRAIGHT] : topWithoutSerif * 0.72
[Just FORM-FLAT-TOP] topWithoutSerif
[Just FORM-DOUBLE-V] top
[Just FORM-ASYMMETRIC] top
[Just FORM-CYRL-OMEGA] top
[Just FORM-CURLY] : top * 0.6
[Just FORM-STRAIGHT] : top * 0.72
[Just FORM-ALMOST-FLAT-TOP] : top - Stroke
[Just FORM-FLAT-TOP] top
[Just FORM-DOUBLE-V] top
[Just FORM-ASYMMETRIC] top
[Just FORM-CYRL-OMEGA] top
local xRight1 : match bodyType
([Just FORM-DOUBLE-V] || [Just FORM-ASYMMETRIC] || [Just FORM-CYRL-OMEGA])
@ -133,7 +139,7 @@ glyph-block Letter-Latin-W : begin
### W and w
define [WShapeImpl df top bodyType slabType] : glyph-proc
local dim : WDim df top bodyType
local dim : WDim df top bodyType slabType
include : tagged 'strokeDown1' : match bodyType
([Just FORM-CURLY] || [Just FORM-CYRL-OMEGA]) : dispiro
@ -221,10 +227,10 @@ glyph-block Letter-Latin-W : begin
HSerif.mtAsymmetric (df.leftSB + [HSwToV : 0.5 * dim.strokeOuter]) dim.wMidHeight jut jut
HSerif.mtAsymmetric dim.xLeft2 dim.wMidHeight jut jut
define [WHooktopShape df top bodyType serifsType] : glyph-proc
include : WShapeImpl df top bodyType serifsType
define [WHooktopShape df top bodyType slabType] : glyph-proc
include : WShapeImpl df top bodyType slabType
local dim : WDim df top bodyType
local dim : WDim df top bodyType slabType
# Eject unnecessary contours
eject-contour 'strokeUp2'
@ -255,8 +261,8 @@ glyph-block Letter-Latin-W : begin
[Just SERIFS-MOTION] : begin sf.lt.outer
___ : glyph-proc
define [WVSHookTopShape df top bodyType serifsType] : glyph-proc
include : WVertSides df top bodyType serifsType
define [WVSHookTopShape df top bodyType slabType] : glyph-proc
include : WVertSides df top bodyType slabType
# Eject unnecessary contours
eject-contour 'strokeLeftBar'
@ -342,21 +348,22 @@ glyph-block Letter-Latin-W : begin
[Just SERIFS-MOTION] : begin sf.lt.outer
___ : glyph-proc
define [WCursiveImpl df top bodyType serifsType] : WCursiveImplImpl false df top bodyType serifsType
define [WHookTopCursive df top bodyType serifsType] : WCursiveImplImpl true df top bodyType serifsType
define [WCursiveImpl df top bodyType slabType] : WCursiveImplImpl false df top bodyType slabType
define [WHookTopCursive df top bodyType slabType] : WCursiveImplImpl true df top bodyType slabType
define WConfig : SuffixCfg.weave
# Body
object
straight { WShapeImpl WHooktopShape FORM-STRAIGHT para.advanceScaleM para.advanceScaleM }
straightAsymmetric { WShapeImpl WHooktopShape FORM-ASYMMETRIC para.advanceScaleM para.advanceScaleM }
straightDoubleV { WShapeImpl WHooktopShape FORM-DOUBLE-V para.advanceScaleM para.advanceScaleM }
straightFlatTop { WShapeImpl WHooktopShape FORM-FLAT-TOP para.advanceScaleMM para.advanceScaleM }
straightVerticalSides { WVertSides WVSHookTopShape FORM-STRAIGHT para.advanceScaleM para.advanceScaleT }
roundedVerticalSides { WRounded WHookTopRounded FORM-CURLY para.advanceScaleMM para.advanceScaleM }
curly { WShapeImpl WHooktopShape FORM-CURLY para.advanceScaleM para.advanceScaleM }
cursive { WCursiveImpl WHookTopCursive FORM-CURLY para.advanceScaleM para.advanceScaleM }
cyrlOmega { WShapeImpl WHooktopShape FORM-CYRL-OMEGA para.advanceScaleMM para.advanceScaleM }
straight { WShapeImpl WHooktopShape FORM-STRAIGHT para.advanceScaleM para.advanceScaleM }
straightAsymmetric { WShapeImpl WHooktopShape FORM-ASYMMETRIC para.advanceScaleM para.advanceScaleM }
straightDoubleV { WShapeImpl WHooktopShape FORM-DOUBLE-V para.advanceScaleM para.advanceScaleM }
straightAlmostFlatTop { WShapeImpl WHooktopShape FORM-ALMOST-FLAT-TOP para.advanceScaleMM para.advanceScaleM }
straightFlatTop { WShapeImpl WHooktopShape FORM-FLAT-TOP para.advanceScaleMM para.advanceScaleM }
straightVerticalSides { WVertSides WVSHookTopShape FORM-STRAIGHT para.advanceScaleM para.advanceScaleT }
roundedVerticalSides { WRounded WHookTopRounded FORM-CURLY para.advanceScaleMM para.advanceScaleM }
curly { WShapeImpl WHooktopShape FORM-CURLY para.advanceScaleM para.advanceScaleM }
cursive { WCursiveImpl WHookTopCursive FORM-CURLY para.advanceScaleM para.advanceScaleM }
cyrlOmega { WShapeImpl WHooktopShape FORM-CYRL-OMEGA para.advanceScaleMM para.advanceScaleM }
# Serifs
function [body] : if (body == 'cyrlOmega')

View file

@ -1794,53 +1794,70 @@ next = "serifs"
[prime.capital-w.variants-buildup.stages.body.straight]
rank = 1
groupRank = 1
descriptionAffix = "standard, straight body"
selectorAffix.W = "straight"
selectorAffix."W/sansSerif" = "straight"
selectorAffix.WHookTop = "straight"
[prime.capital-w.variants-buildup.stages.body.curly]
[prime.capital-w.variants-buildup.stages.body.straight-almost-flat-top]
rank = 2
descriptionAffix = "curly body"
selectorAffix.W = "curly"
selectorAffix."W/sansSerif" = "curly"
selectorAffix.WHookTop = "curly"
[prime.capital-w.variants-buildup.stages.body.straight-vertical-sides]
rank = 3
descriptionAffix = "straight body shape with vertical sides"
selectorAffix.W = "straightVerticalSides"
selectorAffix."W/sansSerif" = "straightVerticalSides"
selectorAffix.WHookTop = "straightVerticalSides"
[prime.capital-w.variants-buildup.stages.body.rounded-vertical-sides]
rank = 4
descriptionAffix = "rounded body shape with vertical sides"
selectorAffix.W = "roundedVerticalSides"
selectorAffix."W/sansSerif" = "roundedVerticalSides"
selectorAffix.WHookTop = "roundedVerticalSides"
groupRank = 1
descriptionAffix = "straight body shape that the middle is forced to be aligned the top"
selectorAffix.W = "straightAlmostFlatTop"
selectorAffix."W/sansSerif" = "straightAlmostFlatTop"
selectorAffix.WHookTop = "straightAlmostFlatTop"
[prime.capital-w.variants-buildup.stages.body.straight-flat-top]
rank = 5
rank = 3
groupRank = 1
descriptionAffix = "straight body shape that the middle is forced to be aligned the top"
selectorAffix.W = "straightFlatTop"
selectorAffix."W/sansSerif" = "straightFlatTop"
selectorAffix.WHookTop = "straightFlatTop"
[prime.capital-w.variants-buildup.stages.body.straight-double-v]
rank = 6
rank = 4
groupRank = 2
descriptionAffix = "body shape like double V"
selectorAffix.W = "straightDoubleV"
selectorAffix."W/sansSerif" = "straightDoubleV"
selectorAffix.WHookTop = "straightDoubleV"
[prime.capital-w.variants-buildup.stages.body.straight-asymmetric]
rank = 7
rank = 5
groupRank = 2
descriptionAffix = "asymmetric shape"
selectorAffix.W = "straightAsymmetric"
selectorAffix."W/sansSerif" = "straightAsymmetric"
selectorAffix.WHookTop = "straightAsymmetric"
[prime.capital-w.variants-buildup.stages.body.straight-vertical-sides]
rank = 6
groupRank = 3
descriptionAffix = "straight body shape with vertical sides"
selectorAffix.W = "straightVerticalSides"
selectorAffix."W/sansSerif" = "straightVerticalSides"
selectorAffix.WHookTop = "straightVerticalSides"
[prime.capital-w.variants-buildup.stages.body.rounded-vertical-sides]
rank = 7
groupRank = 3
descriptionAffix = "rounded body shape with vertical sides"
selectorAffix.W = "roundedVerticalSides"
selectorAffix."W/sansSerif" = "roundedVerticalSides"
selectorAffix.WHookTop = "roundedVerticalSides"
[prime.capital-w.variants-buildup.stages.body.curly]
rank = 8
groupRank = 3
descriptionAffix = "curly body"
selectorAffix.W = "curly"
selectorAffix."W/sansSerif" = "curly"
selectorAffix.WHookTop = "curly"
[prime.capital-w.variants-buildup.stages.serifs.serifless]
rank = 1
descriptionAffix = "serifs"
@ -4719,40 +4736,24 @@ selectorAffix.w = "straight"
selectorAffix."w/sansSerif" = "straight"
selectorAffix.wHookTop = "straight"
[prime.w.variants-buildup.stages.body.curly]
[prime.w.variants-buildup.stages.body.straight-almost-flat-top]
rank = 2
groupRank = 1
descriptionAffix = "curly body"
selectorAffix.w = "curly"
selectorAffix."w/sansSerif" = "curly"
selectorAffix.wHookTop = "curly"
[prime.w.variants-buildup.stages.body.straight-vertical-sides]
rank = 3
groupRank = 1
descriptionAffix = "straight body shape with vertical sides"
selectorAffix.w = "straightVerticalSides"
selectorAffix."w/sansSerif" = "straightVerticalSides"
selectorAffix.wHookTop = "straightVerticalSides"
[prime.w.variants-buildup.stages.body.rounded-vertical-sides]
rank = 4
groupRank = 1
descriptionAffix = "rounded body shape with vertical sides"
selectorAffix.w = "roundedVerticalSides"
selectorAffix."w/sansSerif" = "roundedVerticalSides"
selectorAffix.wHookTop = "roundedVerticalSides"
descriptionAffix = "straight body shape that the middle is forced to be aligned the top"
selectorAffix.w = "straightAlmostFlatTop"
selectorAffix."w/sansSerif" = "straightAlmostFlatTop"
selectorAffix.wHookTop = "straightAlmostFlatTop"
[prime.w.variants-buildup.stages.body.straight-flat-top]
rank = 5
groupRank = 2
rank = 3
groupRank = 1
descriptionAffix = "straight body shape that the middle is forced to be aligned the top"
selectorAffix.w = "straightFlatTop"
selectorAffix."w/sansSerif" = "straightFlatTop"
selectorAffix.wHookTop = "straightFlatTop"
[prime.w.variants-buildup.stages.body.straight-double-v]
rank = 6
rank = 4
groupRank = 2
descriptionAffix = "body shape like double V"
selectorAffix.w = "straightDoubleV"
@ -4760,21 +4761,46 @@ selectorAffix."w/sansSerif" = "straightDoubleV"
selectorAffix.wHookTop = "straightDoubleV"
[prime.w.variants-buildup.stages.body.straight-asymmetric]
rank = 7
rank = 5
groupRank = 2
descriptionAffix = "asymmetric shape"
selectorAffix.w = "straightAsymmetric"
selectorAffix."w/sansSerif" = "straightAsymmetric"
selectorAffix.wHookTop = "straightAsymmetric"
[prime.w.variants-buildup.stages.body.cursive]
rank = 8
[prime.w.variants-buildup.stages.body.straight-vertical-sides]
rank = 6
groupRank = 3
descriptionAffix = "straight body shape with vertical sides"
selectorAffix.w = "straightVerticalSides"
selectorAffix."w/sansSerif" = "straightVerticalSides"
selectorAffix.wHookTop = "straightVerticalSides"
[prime.w.variants-buildup.stages.body.rounded-vertical-sides]
rank = 7
groupRank = 3
descriptionAffix = "rounded body shape with vertical sides"
selectorAffix.w = "roundedVerticalSides"
selectorAffix."w/sansSerif" = "roundedVerticalSides"
selectorAffix.wHookTop = "roundedVerticalSides"
[prime.w.variants-buildup.stages.body.curly]
rank = 8
groupRank = 4
descriptionAffix = "curly body"
selectorAffix.w = "curly"
selectorAffix."w/sansSerif" = "curly"
selectorAffix.wHookTop = "curly"
[prime.w.variants-buildup.stages.body.cursive]
rank = 9
groupRank = 4
descriptionAffix = "cursive shape"
selectorAffix.w = "cursive"
selectorAffix."w/sansSerif" = "cursive"
selectorAffix.wHookTop = "cursive"
[prime.w.variants-buildup.stages.serifs.serifless]
rank = 1
descriptionAffix = "serifs"