* Add Characters

- LATIN CAPITAL LETTER AA (`U+A732`).
  - LATIN SMALL LETTER AA (`U+A733`).
  - LATIN CAPITAL LETTER AO (`U+A734`) (#1623).
This commit is contained in:
be5invis 2023-03-20 23:22:11 -07:00
parent 011e5fb39b
commit 07d49ce68b
10 changed files with 268 additions and 88 deletions

View file

@ -1,5 +1,8 @@
* Add Characters * Add Characters
- KIP SIGN (`U+20AD`). - KIP SIGN (`U+20AD`).
- LATIN CAPITAL LETTER AA (`U+A732`).
- LATIN SMALL LETTER AA (`U+A733`).
- LATIN CAPITAL LETTER AO (`U+A734`) (#1623).
* Fix shape artifacts of `U+499`, `U+1D93`, `U+1D94`, `U+A731` (#1580, #1617, #1618). * Fix shape artifacts of `U+499`, `U+1D93`, `U+1D94`, `U+A731` (#1580, #1617, #1618).
* Fix shape artifacts of cursive `k` (#1619). * Fix shape artifacts of cursive `k` (#1619).
* Fix shape artifacts of R-derivatives (#1620). * Fix shape artifacts of R-derivatives (#1620).

View file

@ -10,6 +10,15 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
glyph-block-import Common-Derivatives glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared-Shapes : nShoulder OBarLeft glyph-block-import Letter-Shared-Shapes : nShoulder OBarLeft
glyph-block-export SubDfAndShift
define [SubDfAndShift pShift df _o] : begin
local o : fallback _o 0
local subDfWidth : df.middle + 0.5 * HVContrast * df.mvs + df.leftSB + OX
local subDfFullShift : df.middle - 0.5 * HVContrast * df.mvs - df.leftSB - OX
local subDf : DivFrame (subDfWidth / Width) 2 (df.leftSB / SB)
local shift : pShift * subDfFullShift
return { subDf shift }
define [GetSm df stroke] : begin define [GetSm df stroke] : begin
local ada : ArchDepthAOf [Math.max (stroke * 1.125) (SmallArchDepth * 0.6 * df.div)] (0.5 * Width * df.div) local ada : ArchDepthAOf [Math.max (stroke * 1.125) (SmallArchDepth * 0.6 * df.div)] (0.5 * Width * df.div)
local adb : ArchDepthBOf [Math.max (stroke * 1.125) (SmallArchDepth * 0.6 * df.div)] (0.5 * Width * df.div) local adb : ArchDepthBOf [Math.max (stroke * 1.125) (SmallArchDepth * 0.6 * df.div)] (0.5 * Width * df.div)
@ -212,3 +221,41 @@ glyph-block Letter-Latin-Lower-AE-OE : begin
include : aoOPart df include : aoOPart df
derive-composites 'uo' 0xAB63 'ue/u' 'uo/o' derive-composites 'uo' 0xAB63 'ue/u' 'uo/o'
do "aa"
define [AAShape pShift df body] : begin
local { subDf shift } : SubDfAndShift pShift df OX
return : WithTransform [ApparentTranslate shift 0] [body subDf]
glyph-block-import Letter-Latin-Lower-A : DoubleStorey
define DoubleStoreyConfig : object
doubleStoreySerifless { DoubleStorey.Serifless }
doubleStoreySerifed { DoubleStorey.Serifed }
doubleStoreyTailed { DoubleStorey.Tailed }
doubleStoreyToothlessCorner { DoubleStorey.ToothlessCorner }
doubleStoreyToothlessRounded { DoubleStorey.ToothlessRounded }
foreach { suffix { bodyR } } [Object.entries DoubleStoreyConfig] : do
create-glyph "aa.\(suffix)" : glyph-proc
define df : DivFrame para.diversityM 3
set-width df.width
include : df.markSet.e
local [left] : AAShape 0 df DoubleStorey.ToothlessRounded
local [right] : AAShape 1 df bodyR
include : difference [right] : intersection
MaskAbove (XH * OverlayPos * 1.02)
union
WithTransform [ApparentTranslate (-0.25 * df.mvs) 0] [left]
WithTransform [ApparentTranslate (-0.50 * df.mvs) 0] [left]
WithTransform [ApparentTranslate (-0.75 * df.mvs) 0] [left]
WithTransform [ApparentTranslate (-1.00 * df.mvs) 0] [left]
include : difference [left] : intersection
MaskBelow (XH * OverlayPos * 1.02)
union
WithTransform [ApparentTranslate (+0.25 * df.mvs) 0] [right]
WithTransform [ApparentTranslate (+0.50 * df.mvs) 0] [right]
WithTransform [ApparentTranslate (+0.75 * df.mvs) 0] [right]
WithTransform [ApparentTranslate (+1.00 * df.mvs) 0] [right]
select-variant "aa" 0xA733 (follow -- 'a/turnABase')

View file

@ -0,0 +1,94 @@
$$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs"
import [Dotless CvDecompose RequireCcmpDecompose] from"../../../support/gr.mjs"
import [bitOr] from"../../../support/util/mask-bit.mjs"
glyph-module
glyph-block Letter-Latin-Upper-AE-OE : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Latin-Upper-F : EFVJutLength
glyph-block-import Letter-Latin-Upper-A : AMaskShape ALetterShape
glyph-block-import Letter-Latin-Lower-AE-OE : SubDfAndShift
define [AHalfShape pShift df top fStraightBar slabKind] : begin
local { subDf shift } : SubDfAndShift pShift df
return : WithTransform [ApparentTranslate shift 0]
ALetterShape subDf top df.mvs fStraightBar slabKind
define [AHalfShapeMask pShift df top fStraightBar slabKind] : begin
local { subDf shift } : SubDfAndShift pShift df
return : WithTransform [ApparentTranslate shift 0]
AMaskShape subDf top df.mvs fStraightBar
define SLAB-NONE 0
define SLAB-TOP 1
define SLAB-LEFT 2
define SLAB-RIGHT 4
define AConfig : object
straightSerifless { true SLAB-NONE SLAB-NONE }
curlySerifless { false SLAB-NONE SLAB-NONE }
straightTopSerifed { true SLAB-TOP SLAB-TOP }
curlyTopSerifed { false SLAB-TOP SLAB-TOP }
straightBaseSerifed { true SLAB-LEFT SLAB-RIGHT }
curlyBaseSerifed { false SLAB-LEFT SLAB-RIGHT }
straightTriSerifed { true [bitOr SLAB-TOP SLAB-LEFT] [bitOr SLAB-TOP SLAB-RIGHT] }
curlyTriSerifed { false [bitOr SLAB-TOP SLAB-LEFT] [bitOr SLAB-TOP SLAB-RIGHT] }
foreach { suffix { fStraightBar skLeft skRight } } [Object.entries AConfig] : do
create-glyph "AA/Left.\(suffix)" : glyph-proc
define df : DivFrame para.diversityM 3.5
set-width df.width
include : df.markSet.capital
set-base-anchor 'cvDecompose' 0 0
include : AHalfShape 0 df CAP fStraightBar skLeft
create-glyph "AA/LeftMask.\(suffix)" : glyph-proc
define df : DivFrame para.diversityM 3.5
set-width df.width
include : df.markSet.capital
set-base-anchor 'cvDecompose' 0 0
include : AHalfShapeMask 0 df CAP fStraightBar skLeft
create-glyph "AA/Right.\(suffix)" : glyph-proc
define df : DivFrame para.diversityM 3.5
set-width 0
include : df.markSet.capital
set-mark-anchor 'cvDecompose' 0 0 0 0
include : AHalfShape 1 df CAP fStraightBar skRight
create-glyph "AA/RightMask.\(suffix)" : glyph-proc
define df : DivFrame para.diversityM 3.5
set-width 0
include : df.markSet.capital
set-mark-anchor 'cvDecompose' 0 0 0 0
include : AHalfShapeMask 1 df CAP fStraightBar skRight
select-variant 'AA/Left' (follow -- 'A')
select-variant 'AA/LeftMask' (follow -- 'A')
select-variant 'AA/Right' (follow -- 'A')
select-variant 'AA/RightMask' (follow -- 'A')
derive-multi-part-glyphs 'AA' 0xA732 {"AA/Left" "AA/LeftMask" "AA/Right" "AA/RightMask"} : function [srcs gr] : glyph-proc
define df : DivFrame para.diversityM 3.5
define topSerifGap : Math.max (0.1 * (df.rightSB - df.leftSB)) [AdviceStroke 6]
define { left leftMask right rightMask } srcs
include [refer-glyph left] AS_BASE ALSO_METRICS
include : difference
refer-glyph right
refer-glyph leftMask
difference
intersection
MaskAbove (CAP - Stroke)
WithTransform [ApparentTranslate topSerifGap 0] [refer-glyph leftMask]
WithTransform [ApparentTranslate (OX - 0.1) 0] [refer-glyph rightMask]
derive-multi-part-glyphs 'AO' 0xA734 {"AA/Left" "AA/LeftMask" "OO/Right"} : function [srcs gr] : glyph-proc
define df : DivFrame para.diversityM 3.5
define topSerifGap : Math.max (0.1 * (df.rightSB - df.leftSB)) [AdviceStroke 6]
define { left leftMask right } srcs
include [refer-glyph left] AS_BASE ALSO_METRICS
include : difference [refer-glyph right] [refer-glyph leftMask]

View file

@ -211,16 +211,28 @@ glyph-block Letter-Latin-Upper-AE-OE : begin
select-variant 'OE' 0x152 (follow -- 'AE/EHalf') select-variant 'OE' 0x152 (follow -- 'AE/EHalf')
select-variant 'smcpOE' 0x276 (follow -- 'AE/EHalf') select-variant 'smcpOE' 0x276 (follow -- 'AE/EHalf')
define [getAd df] : begin
local ada : ArchDepthAOf [Math.max (df.mvs * 1.125) (ArchDepth * 0.6 * df.div)] (0.5 * Width * df.div)
local adb : ArchDepthBOf [Math.max (df.mvs * 1.125) (ArchDepth * 0.6 * df.div)] (0.5 * Width * df.div)
return { ada adb }
create-glyph 'OO/Left' : glyph-proc
local df : DivFrame para.diversityM 3
local centerBarRight : df.middle + 0.5 * HVContrast * df.mvs
local { ada adb } : getAd df
include : OShape CAP 0 df.leftSB (centerBarRight + OX) df.mvs ada adb
create-glyph 'OO/Right' : glyph-proc
local df : DivFrame para.diversityM 3
local centerBarLeft : df.middle - 0.5 * HVContrast * df.mvs
local { ada adb } : getAd df
include : OShape CAP 0 (centerBarLeft - OX) df.rightSB df.mvs ada adb
create-glyph 'OO' 0xA74E : glyph-proc create-glyph 'OO' 0xA74E : glyph-proc
local df : DivFrame para.diversityM 3 local df : DivFrame para.diversityM 3
set-width df.width set-width df.width
include : df.markSet.capital include : df.markSet.capital
local abarRight : df.middle + df.mvs / 2 * HVContrast include : refer-glyph 'OO/Left'
local ada : ArchDepthAOf [Math.max (df.mvs * 1.125) (SmallArchDepth * 0.6 * df.div)] (0.5 * Width * df.div) include : refer-glyph 'OO/Right'
local adb : ArchDepthBOf [Math.max (df.mvs * 1.125) (SmallArchDepth * 0.6 * df.div)] (0.5 * Width * df.div)
include : OShape CAP 0 (df.leftSB + OX) (abarRight + OX) df.mvs ada adb
include : FlipAround (df.width / 2) (CAP / 2)
include : OShape CAP 0 (df.leftSB + OX) (abarRight + OX) df.mvs ada adb
alias 'cyrl/OO' 0xA698 'OO' alias 'cyrl/OO' 0xA698 'OO'

View file

@ -64,6 +64,7 @@ export : define [apply] : begin
run-glyph-module "./latin-ext/rhotic.mjs" run-glyph-module "./latin-ext/rhotic.mjs"
run-glyph-module "./latin-ext/thorn.mjs" run-glyph-module "./latin-ext/thorn.mjs"
run-glyph-module "./latin-ext/upper-ae-oe.mjs" run-glyph-module "./latin-ext/upper-ae-oe.mjs"
run-glyph-module "./latin-ext/upper-aa-ao.mjs"
run-glyph-module "./latin-ext/wynn.mjs" run-glyph-module "./latin-ext/wynn.mjs"
run-glyph-module "./latin-ext/yogh.mjs" run-glyph-module "./latin-ext/yogh.mjs"

View file

@ -2,7 +2,7 @@ $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix linreg clamp fallback] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
import [maskBit maskBits] from"../../../support/util/mask-bit.mjs" import [maskBit] from"../../../support/util/mask-bit.mjs"
glyph-module glyph-module

View file

@ -14,75 +14,76 @@ glyph-block Letter-Latin-Lower-A : begin
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar InvRightwardTailedBar glyph-block-import Letter-Shared-Shapes : RightwardTailedBar InvRightwardTailedBar
glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend RetroflexHook glyph-block-import Letter-Shared-Shapes : DToothlessRise DMBlend RetroflexHook
glyph-block-export DoubleStorey
define DoubleStorey : namespace define DoubleStorey : namespace
define ADoubleStoreyStroke : AdviceStroke2 2 3 XH define [ADoubleStoreyStroke df] : AdviceStroke2 2 3 XH df.div
define ADoubleStoreySmoothA : ArchDepthAOf (ArchDepth * [StrokeWidthBlend 0.9 0.81 ADoubleStoreyStroke]) Width define [ADoubleStoreySmoothA df] : ArchDepthAOf (ArchDepth * [StrokeWidthBlend 0.9 0.81 : ADoubleStoreyStroke df]) df.width
define ADoubleStoreySmoothB : ArchDepthBOf (ArchDepth * [StrokeWidthBlend 0.9 0.81 ADoubleStoreyStroke]) Width define [ADoubleStoreySmoothB df] : ArchDepthBOf (ArchDepth * [StrokeWidthBlend 0.9 0.81 : ADoubleStoreyStroke df]) df.width
define [ADoubleStoreyHookAndBarT sink y0 stroke] : glyph-proc define [ADoubleStoreyHookAndBarT df sink y0 stroke] : glyph-proc
local isMask : sink == spiro-outline local isMask : sink == spiro-outline
include : sink include : sink
widths.lhs stroke widths.lhs stroke
[if isMask corner flat] RightSB y0 [heading Upward] [if isMask corner flat] df.rightSB y0 [heading Upward]
curl RightSB (XH - ADoubleStoreySmoothB) curl df.rightSB (XH - [ADoubleStoreySmoothB df])
hookend (XH - O) hookend (XH - O)
g4 SB (XH - AHook) g4 df.leftSB (XH - AHook)
if [not isMask] {} {[corner SB y0]} if [not isMask] {} {[corner df.leftSB y0]}
export : define [HookAndBar y0 _stroke] : ADoubleStoreyHookAndBarT dispiro y0 export : define [HookAndBar df y0 _stroke] : ADoubleStoreyHookAndBarT df dispiro y0
fallback _stroke ADoubleStoreyStroke fallback _stroke [ADoubleStoreyStroke df]
export : define [HookAndBarMask y0 _stroke] : ADoubleStoreyHookAndBarT spiro-outline y0 export : define [HookAndBarMask df y0 _stroke] : ADoubleStoreyHookAndBarT df spiro-outline y0
fallback _stroke ADoubleStoreyStroke fallback _stroke [ADoubleStoreyStroke df]
define [ADoubleStoreyArcT sink kind rise stroke] : glyph-proc define [ADoubleStoreyArcT df sink kind rise stroke] : glyph-proc
local isMask : sink == spiro-outline local isMask : sink == spiro-outline
local bartop (XH * OverlayPos * 1.02 + stroke * 0.425) local bartop : XH * OverlayPos * 1.02 + stroke * 0.425
local bowlArcY1 : YSmoothMidL 0 bartop SmallArchDepthA SmallArchDepthB local bowlArcY1 : YSmoothMidL 0 bartop SmallArchDepthA SmallArchDepthB
local bowlArcY2 : YSmoothMidR 0 bartop SmallArchDepthA SmallArchDepthB local bowlArcY2 : YSmoothMidR 0 bartop SmallArchDepthA SmallArchDepthB
local lowSkew : shoulderMidSkew ShoulderFine nothing local lowSkew : shoulderMidSkew ShoulderFine nothing
local leftSlopeS : 0.1 * (Width / HalfUPM) local leftSlopeS : 0.1 * (df.width / HalfUPM)
local leftSlope : leftSlopeS - TanSlope local leftSlope : leftSlopeS - TanSlope
local lowMiddle : mix (SB + OX) (RightSB - stroke / 2 * HVContrast) [linreg 72 0.51 126 0.58 stroke] local lowMiddle : mix (df.leftSB + OX) (df.rightSB - stroke / 2 * HVContrast) [linreg 72 0.51 126 0.58 stroke]
local barSmooth : mix SB RightSB 0.55 local barSmooth : mix df.leftSB df.rightSB 0.55
include : sink include : sink
widths.lhs stroke widths.lhs stroke
[if isMask corner flat] (RightSB + O) bartop [heading Leftward] [if isMask corner flat] (df.rightSB + O) bartop [heading Leftward]
curl barSmooth bartop curl barSmooth bartop
archv archv
g4 (SB + OX) (bowlArcY1 - Stroke * HVContrast * leftSlopeS) [heading {.x HVContrast .y leftSlope}] g4 (df.leftSB + OX) (bowlArcY1 - Stroke * HVContrast * leftSlopeS) [heading {.x HVContrast .y leftSlope}]
arcvh arcvh
match kind match kind
0 : list 0 : list
g4 (lowMiddle + (-lowSkew) * stroke + CorrectionOMidX * stroke * 0.5) O [heading {.y 1 .x lowSkew}] g4 (lowMiddle + (-lowSkew) * stroke + CorrectionOMidX * stroke * 0.5) O [heading {.y 1 .x lowSkew}]
archv 16 archv 16
straight.up.end (RightSB - stroke * HVContrast + ShoulderFine * HVContrast) (SmallArchDepthB * 0.9) [widths.lhs ShoulderFine] straight.up.end (df.rightSB - stroke * HVContrast + ShoulderFine * HVContrast) (SmallArchDepthB * 0.9) [widths.lhs ShoulderFine]
if [not isMask] {} {[ corner (RightSB - stroke * HVContrast + ShoulderFine * HVContrast) bartop ]} if [not isMask] {} {[ corner (df.rightSB - stroke * HVContrast + ShoulderFine * HVContrast) bartop ]}
1 : list 1 : list
g4 (Middle + CorrectionOMidX * stroke) O g4 (df.middle + CorrectionOMidX * stroke) O
g4 RightSB rise g4 df.rightSB rise
2 : list 2 : list
g4 (Middle + CorrectionOMidX * stroke) O g4 (df.middle + CorrectionOMidX * stroke) O
archv archv
flat RightSB bowlArcY2 flat df.rightSB bowlArcY2
curl RightSB ([Math.max bowlArcY2 rise] + stroke * TanSlope + 1) [heading Upward] curl df.rightSB ([Math.max bowlArcY2 rise] + stroke * TanSlope + 1) [heading Upward]
export : define [Arc kind rise _sw] : ADoubleStoreyArcT dispiro kind rise export : define [Arc df kind rise _sw] : ADoubleStoreyArcT df dispiro kind rise
fallback _sw ADoubleStoreyStroke fallback _sw [ADoubleStoreyStroke df]
export : define [ArcMask kind rise _sw] : ADoubleStoreyArcT spiro-outline kind rise export : define [ArcMask df kind rise _sw] : ADoubleStoreyArcT df spiro-outline kind rise
fallback _sw ADoubleStoreyStroke fallback _sw [ADoubleStoreyStroke df]
export : define [Serifless] : union [HookAndBar 0] [Arc 0] export : define [Serifless df] : union [HookAndBar df 0] [Arc df 0]
export : define [Serifed] : union [Serifless] [HSerif.rb RightSB 0 SideJut] export : define [Serifed df] : union [Serifless df] [HSerif.rb df.rightSB 0 SideJut]
export : define [Tailed] : union export : define [Tailed df] : union
HookAndBar (XH - ADoubleStoreySmoothB + O) HookAndBar df (XH - [ADoubleStoreySmoothB df] + O)
Arc 0 Arc df 0
RightwardTailedBar RightSB 0 (XH - ADoubleStoreySmoothB) (sw -- ADoubleStoreyStroke) RightwardTailedBar df.rightSB 0 (XH - [ADoubleStoreySmoothB df]) (sw -- [ADoubleStoreyStroke df])
export : define [ToothlessCorner] : union export : define [ToothlessCorner df] : union
HookAndBar DToothlessRise HookAndBar df DToothlessRise
Arc 1 DToothlessRise Arc df 1 DToothlessRise
export : define [ToothlessRounded] : union export : define [ToothlessRounded df] : union
HookAndBar ADoubleStoreySmoothA HookAndBar df [ADoubleStoreySmoothA df]
Arc 2 ADoubleStoreySmoothA Arc df 2 [ADoubleStoreySmoothA df]
define DoubleStoreyConfig : object define DoubleStoreyConfig : object
doubleStoreySerifless { DoubleStorey.Serifless (RightSB ) } doubleStoreySerifless { DoubleStorey.Serifless (RightSB ) }
@ -93,22 +94,27 @@ glyph-block Letter-Latin-Lower-A : begin
foreach { suffix { body xTrailing } } [Object.entries DoubleStoreyConfig] : do foreach { suffix { body xTrailing } } [Object.entries DoubleStoreyConfig] : do
create-glyph "a.\(suffix)" : glyph-proc create-glyph "a.\(suffix)" : glyph-proc
include : MarkSet.e local df : DivFrame 1
set-width df.width
include : df.markSet.e
if xTrailing : set-base-anchor 'trailing' xTrailing 0 if xTrailing : set-base-anchor 'trailing' xTrailing 0
include : body include : body df
glyph-block-import Letter-Blackboard : BBS BBD glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/a' 0x1D552 : glyph-proc create-glyph 'mathbb/a' 0x1D552 : glyph-proc
include : MarkSet.e local df : DivFrame 1
include : DoubleStorey.HookAndBar 0 BBS set-width df.width
include : df.markSet.e
include : DoubleStorey.HookAndBar df 0 BBS
include : intersection include : intersection
DoubleStorey.HookAndBarMask 0 DoubleStorey.HookAndBarMask df 0
VBar.r (RightSB - BBD) 0 XH BBS VBar.r (RightSB - BBD) 0 XH BBS
include : difference include : difference
union union
DoubleStorey.Arc 0 0 BBS DoubleStorey.Arc df 0 0 BBS
intersection intersection
DoubleStorey.ArcMask 0 0 BBS DoubleStorey.ArcMask df 0 0 BBS
VBar.l (SB + OX + BBD) 0 XH BBS VBar.l (SB + OX + BBD) 0 XH BBS
Rect XH 0 (RightSB - BBD) Width Rect XH 0 (RightSB - BBD) Width
include : HBar.b (RightSB - BBD) RightSB 0 BBS include : HBar.b (RightSB - BBD) RightSB 0 BBS

View file

@ -2,6 +2,7 @@ $$include '../../../meta/macros.ptl'
import [mix linreg clamp fallback] from"../../../support/utils.mjs" import [mix linreg clamp fallback] from"../../../support/utils.mjs"
import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs"
import [maskBits bitOr] from"../../../support/util/mask-bit.mjs"
glyph-module glyph-module
@ -16,46 +17,57 @@ glyph-block Letter-Latin-Upper-A : begin
define SLAB-NONE 0 define SLAB-NONE 0
define SLAB-TOP 1 define SLAB-TOP 1
define SLAB-BASE 2 define SLAB-LEFT 2
define SLAB-TRI 3 define SLAB-RIGHT 4
glyph-block-export AMaskShape
define [AMaskShape df top sw barStraight] : new-glyph : glyph-proc define [AMaskShape df top sw barStraight] : new-glyph : glyph-proc
include : VShapeOutline df top sw barStraight include : VShapeOutline df top sw barStraight
include : FlipAround ([DivFrame df.div].width / 2) (top / 2) include : FlipAround ([DivFrame df.div].width / 2) (top / 2)
define [ABarPosition slab top] : mix [if fBaseSlabs Stroke 0] top (XH / 2 / CAP) define [ABarPosition fBaseSlabs top] : mix [if fBaseSlabs Stroke 0] top (XH / 2 / CAP)
define AConfig : object define AConfig : object
straightSerifless { true SLAB-NONE false } straightSerifless { true SLAB-NONE }
curlySerifless { false SLAB-NONE false } curlySerifless { false SLAB-NONE }
straightTopSerifed { true SLAB-TOP false } straightTopSerifed { true SLAB-TOP }
curlyTopSerifed { false SLAB-TOP false } curlyTopSerifed { false SLAB-TOP }
straightBaseSerifed { true SLAB-BASE true } straightBaseSerifed { true [bitOr SLAB-LEFT SLAB-RIGHT] }
curlyBaseSerifed { false SLAB-BASE true } curlyBaseSerifed { false [bitOr SLAB-LEFT SLAB-RIGHT] }
straightTriSerifed { true SLAB-TRI true } straightTriSerifed { true [bitOr SLAB-TOP SLAB-LEFT SLAB-RIGHT] }
curlyTriSerifed { false SLAB-TRI true } curlyTriSerifed { false [bitOr SLAB-TOP SLAB-LEFT SLAB-RIGHT] }
define [ASerifs df top fBaseSlabs kind] : glyph-proc : begin define [ASerifs df top sw slabKind] : glyph-proc : begin
local sf : SerifFrame top 0 df.leftSB df.rightSB local sf : SerifFrame top 0 df.leftSB df.rightSB
if fBaseSlabs : include : composite-proc sf.lb.full sf.rb.full if [maskBits slabKind SLAB-LEFT] : include sf.lb.full
match kind if [maskBits slabKind SLAB-RIGHT] : include sf.rb.full
[Just SLAB-TRI] : begin if [maskBits slabKind SLAB-TOP] : include : intersection [MaskLeft df.middle]
include : HSerif.lt df.middle top (MidJutSide + Stroke * HVContrast * 0.25) if [maskBits slabKind : bitOr SLAB-LEFT SLAB-RIGHT]
[Just SLAB-TOP] : begin : then : HSerif.lt df.middle top (MidJutSide + sw * HVContrast * 0.25)
include : HSerif.lt df.middle top [mix MidJutSide LongJut 0.5] : else : HSerif.lt df.middle top [mix MidJutSide LongJut 0.5]
foreach { suffix { fStraightBar slabKind fBaseSlabs } } [Object.entries AConfig] : do glyph-block-export ALetterShape
define [ALetterShape] : params [df top sw fStraightBar slabKind] : new-glyph : glyph-proc
include : VShape df top sw fStraightBar
include : FlipAround df.middle (top / 2)
define yBar : ABarPosition [maskBits slabKind : bitOr SLAB-LEFT SLAB-RIGHT] top
include : intersection [HBar.t 0 Width yBar] [AMaskShape df top sw fStraightBar]
include : ASerifs df top sw slabKind
foreach { suffix { fStraightBar slabKind } } [Object.entries AConfig] : do
define [AShapeImpl mak top fGrek] : glyph-proc define [AShapeImpl mak top fGrek] : glyph-proc
local df : DivFrame 1 local df : DivFrame 1
include : df.markSet.(mak) include : df.markSet.(mak)
set-base-anchor 'trailing' df.rightSB 0 set-base-anchor 'trailing' df.rightSB 0
if fGrek : include : SetGrekUpperTonos if fGrek : include : SetGrekUpperTonos
[if (slabKind === SLAB-TOP || slabKind === SLAB-TRI) 0 0.2] * (df.rightSB - df.leftSB) (df.rightSB - df.leftSB) * [if [maskBits slabKind SLAB-TOP] 0 0.2]
include : VShape df top Stroke fStraightBar
include : FlipAround Middle (top / 2) include : ALetterShape
define yBar : ABarPosition fBaseSlabs top df -- df
include : intersection [HBar.t 0 Width yBar] [AMaskShape df top Stroke fStraightBar] top -- top
include : ASerifs df top fBaseSlabs slabKind sw -- Stroke
fStraightBar -- fStraightBar
slabKind -- slabKind
create-glyph "A.\(suffix)" : AShapeImpl "capital" CAP create-glyph "A.\(suffix)" : AShapeImpl "capital" CAP
create-glyph "grek/Alpha.\(suffix)" : AShapeImpl "capital" CAP true create-glyph "grek/Alpha.\(suffix)" : AShapeImpl "capital" CAP true

View file

@ -25,7 +25,6 @@ glyph-block Letter-Latin-V : begin
define [VShapeTopFlat top] : if SLAB [Math.min (top - Stroke) (top * 0.9)] (top * 0.9) define [VShapeTopFlat top] : if SLAB [Math.min (top - Stroke) (top * 0.9)] (top * 0.9)
define [VShapeOutline] : params [df top [sw Stroke] barStraight] : glyph-proc define [VShapeOutline] : params [df top [sw Stroke] barStraight] : glyph-proc
define fine : [if barStraight VShapeFineStraight VShapeFine] * sw / Stroke
define cornerHW : VCornerHalfWidth * sw / Stroke define cornerHW : VCornerHalfWidth * sw / Stroke
define dgCor : DiagCor top (Width / 2) 0 (sw * 2) define dgCor : DiagCor top (Width / 2) 0 (sw * 2)
define clearance : 0 - OX define clearance : 0 - OX
@ -63,8 +62,8 @@ glyph-block Letter-Latin-V : begin
corner df.middle [Math.min sw : if barStraight VShapeFineStraight VShapeFine] corner df.middle [Math.min sw : if barStraight VShapeFineStraight VShapeFine]
define [VShape] : params [df top [sw Stroke] barStraight] : glyph-proc define [VShape] : params [df top [sw Stroke] barStraight] : glyph-proc
define cornerHW : VCornerHalfWidth * sw / Stroke define cornerHW : VCornerHalfWidth * (sw / Stroke)
define fine : Math.min sw : if barStraight VShapeFineStraight VShapeFine define fine : Math.min sw : [if barStraight VShapeFineStraight VShapeFine] * (sw / Stroke)
define dgCor : DiagCor (2 * top) Width 0 (2 * sw) define dgCor : DiagCor (2 * top) Width 0 (2 * sw)
local sbScale : if barStraight StraightSbShrink 1 local sbScale : if barStraight StraightSbShrink 1
@ -91,13 +90,13 @@ glyph-block Letter-Latin-V : begin
flat vxStartL top [heading Downward] flat vxStartL top [heading Downward]
curl vxStartL [VShapeTopFlat top] [heading Downward] curl vxStartL [VShapeTopFlat top] [heading Downward]
quadControls 0 VCurviness 9 unimportant quadControls 0 VCurviness 9 unimportant
g4 (df.middle - cornerHW) 0 [widths.lhs fine] g4 vxEndL 0 [widths.lhs fine]
include : tagged 'strokeUp' : dispiro include : tagged 'strokeUp' : dispiro
widths.rhs sw widths.rhs sw
flat vxStartR top [heading Downward] flat vxStartR top [heading Downward]
curl vxStartR [VShapeTopFlat top] [heading Downward] curl vxStartR [VShapeTopFlat top] [heading Downward]
quadControls 0 VCurviness 9 unimportant quadControls 0 VCurviness 9 unimportant
g4 (df.middle + cornerHW) 0 [widths.rhs fine] g4 vxEndR 0 [widths.rhs fine]
#bottom cap #bottom cap
include : VBottomCapShape df barStraight sw include : VBottomCapShape df barStraight sw

View file

@ -1,10 +1,16 @@
const pcNibbleLookup = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];
export function maskBit(x, y) { export function maskBit(x, y) {
return x & (1 << y); return x & (1 << y);
} }
export function maskBits(x, y) { export function maskBits(x, y) {
return x & y; return x & y;
} }
export function bitOr(...xs) {
let x = 0;
for (const a of xs) x |= a;
return x;
}
const pcNibbleLookup = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];
export function popCountByte(x) { export function popCountByte(x) {
return pcNibbleLookup[x & 0x0f] + pcNibbleLookup[(x >>> 4) & 0x0f]; return pcNibbleLookup[x & 0x0f] + pcNibbleLookup[(x >>> 4) & 0x0f];
} }