Start diversity work
This commit is contained in:
parent
b8535b964d
commit
13de3ee48a
13 changed files with 763 additions and 498 deletions
|
@ -121,6 +121,9 @@ design = ["ss11"]
|
|||
family = "Iosevka Term SS11"
|
||||
design = ["term", "ss11"]
|
||||
|
||||
[buildPlans.iosevka-poly1]
|
||||
family = "Iosevka Poly1"
|
||||
design = ["shape-straight-bar", "diversity-1", "v-at-fourfold"]
|
||||
|
||||
# Export plans
|
||||
# This mapping affects the process of creating ZIP archives only
|
||||
|
|
|
@ -41,32 +41,34 @@ export as build : define [buildFont para recursive recursiveCodes] : begin
|
|||
return nothing
|
||||
|
||||
define metrics : calculateMetrics para
|
||||
define [object globalTransform MIDDLE CAP XH SB RIGHTSB CONTRAST STROKE SUPERNESS WIDTH TANSLANT OVERLAYPOS DESCENDER symbolMid parenTop parenBot operTop operBot plusTop plusBot tackTop tackBot] metrics
|
||||
define [object globalTransform MIDDLE CAP XH SB RIGHTSB CONTRAST STROKE SUPERNESS WIDTH TANSLANT OVERLAYPOS DESCENDER MVERTSTROKE_D symbolMid parenTop parenBot operTop operBot plusTop plusBot tackTop tackBot] metrics
|
||||
|
||||
# Anchor parameters
|
||||
define [object MARK BASE] Anchor
|
||||
define {AS_BASE ALSO_METRICS} {'AS-BASE' 'ALSO-METRICS'}
|
||||
|
||||
define markset : do
|
||||
define [MarksetDiv p] : begin
|
||||
define middle : p * MIDDLE
|
||||
define rightSB : WIDTH * p - SB
|
||||
define [ta anchor] : return : new Anchor
|
||||
* (anchor.x * globalTransform.xx + anchor.y * TANSLANT + globalTransform.x)
|
||||
* (anchor.x * globalTransform.xy + anchor.y * globalTransform.yy + globalTransform.y)
|
||||
* anchor.type
|
||||
|
||||
define markAboveLower {.anchors {.above [ta : new Anchor MIDDLE XH BASE]}}
|
||||
define markAboveOper {.anchors {.above [ta : new Anchor MIDDLE operTop BASE]}}
|
||||
define markAboveTack {.anchors {.above [ta : new Anchor MIDDLE tackTop BASE]}}
|
||||
define markAbovePlus {.anchors {.above [ta : new Anchor MIDDLE plusTop BASE]}}
|
||||
define markAboveCap {.anchors {.above [ta : new Anchor MIDDLE CAP BASE]}}
|
||||
define markBelowLower {.anchors {.below [ta : new Anchor MIDDLE DESCENDER BASE]}}
|
||||
define markBelowTack {.anchors {.below [ta : new Anchor MIDDLE tackBot BASE]}}
|
||||
define markBelowOper {.anchors {.below [ta : new Anchor MIDDLE operBot BASE]}}
|
||||
define markBelowPlus {.anchors {.below [ta : new Anchor MIDDLE plusBot BASE]}}
|
||||
define markBelowZero {.anchors {.below [ta : new Anchor MIDDLE 0 BASE]}}
|
||||
define markToprightLower {.anchors {.topright [ta : new Anchor RIGHTSB XH BASE]}}
|
||||
define markToprightCap {.anchors {.topright [ta : new Anchor RIGHTSB CAP BASE]}}
|
||||
define markBottomrightLower {.anchors {.bottomright [ta : new Anchor RIGHTSB DESCENDER BASE]}}
|
||||
define markBottomrightZero {.anchors {.bottomright [ta : new Anchor RIGHTSB 0 BASE]}}
|
||||
define markAboveLower {.anchors {.above [ta : new Anchor middle XH BASE]}}
|
||||
define markAboveOper {.anchors {.above [ta : new Anchor middle operTop BASE]}}
|
||||
define markAboveTack {.anchors {.above [ta : new Anchor middle tackTop BASE]}}
|
||||
define markAbovePlus {.anchors {.above [ta : new Anchor middle plusTop BASE]}}
|
||||
define markAboveCap {.anchors {.above [ta : new Anchor middle CAP BASE]}}
|
||||
define markBelowLower {.anchors {.below [ta : new Anchor middle DESCENDER BASE]}}
|
||||
define markBelowTack {.anchors {.below [ta : new Anchor middle tackBot BASE]}}
|
||||
define markBelowOper {.anchors {.below [ta : new Anchor middle operBot BASE]}}
|
||||
define markBelowPlus {.anchors {.below [ta : new Anchor middle plusBot BASE]}}
|
||||
define markBelowZero {.anchors {.below [ta : new Anchor middle 0 BASE]}}
|
||||
define markToprightLower {.anchors {.topright [ta : new Anchor rightSB XH BASE]}}
|
||||
define markToprightCap {.anchors {.topright [ta : new Anchor rightSB CAP BASE]}}
|
||||
define markBottomrightLower {.anchors {.bottomright [ta : new Anchor rightSB DESCENDER BASE]}}
|
||||
define markBottomrightZero {.anchors {.bottomright [ta : new Anchor rightSB 0 BASE]}}
|
||||
|
||||
define [buildStandardMarkSet] : begin
|
||||
local a : compsiteMarkSet.apply null arguments
|
||||
|
@ -90,6 +92,17 @@ export as build : define [buildFont para recursive recursiveCodes] : begin
|
|||
p : buildStandardMarkSet markAboveLower markBelowLower markToprightLower markBottomrightLower
|
||||
if : buildStandardMarkSet markAboveCap markBelowLower markToprightCap markBottomrightLower
|
||||
|
||||
define markset : MarksetDiv 1
|
||||
|
||||
define [DivFrame _div] : begin
|
||||
local div : fallback _div 1
|
||||
return : object
|
||||
div div
|
||||
width : WIDTH * div
|
||||
middle : MIDDLE * div
|
||||
rightSB : WIDTH * div - SB
|
||||
mvs : MVERTSTROKE_D div
|
||||
markSet: MarksetDiv div
|
||||
|
||||
### Glyph slots and dependency profile generation (used for recursive subfonts)
|
||||
local dependencyProfile {.}
|
||||
|
@ -190,7 +203,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin
|
|||
save 'space' ' '
|
||||
|
||||
# IDKY, but wrapping "metrics" prevents Node.js on Arch modifying it.
|
||||
define capture : object [metrics : Object.create metrics] $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ save-glyph spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged TempFont includeGlyphPart compsiteMarkSet
|
||||
define capture : object [metrics : Object.create metrics] $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ save-glyph spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged TempFont includeGlyphPart compsiteMarkSet MarksetDiv DivFrame
|
||||
|
||||
### HERE WE GO
|
||||
set capture.commonShapes : [import '../glyphs/common-shapes.js'].apply.call capture
|
||||
|
|
|
@ -137,16 +137,11 @@ const font = (function() {
|
|||
|
||||
if (argv.charmap) {
|
||||
const charmap = font.glyf.map(function(glyph) {
|
||||
const isSpace = glyph.contours && glyph.contours.length ? 2 : 0;
|
||||
return [
|
||||
glyph.name,
|
||||
glyph.unicode,
|
||||
glyph.advanceWidth === 0
|
||||
? hasv(glyph.anchors)
|
||||
? 1
|
||||
: glyph.contours && glyph.contours.length
|
||||
? 2
|
||||
: 0
|
||||
: 0
|
||||
glyph.advanceWidth === 0 ? (hasv(glyph.anchors) ? 1 : isSpace ? 2 : 0) : 0
|
||||
];
|
||||
});
|
||||
fs.writeFileSync(argv.charmap, JSON.stringify(charmap), "utf8");
|
||||
|
@ -207,10 +202,10 @@ if (argv.o) {
|
|||
const excludeUnicodes = new Set();
|
||||
excludeUnicodes.add(0x80);
|
||||
for (let c = 0x2500; c <= 0x259f; c++) excludeUnicodes.add(c);
|
||||
// autoref
|
||||
autoref(font.glyf, excludeUnicodes);
|
||||
// regulate
|
||||
for (let g of font.glyf) regulateGlyph(g, skew);
|
||||
// // autoref
|
||||
// autoref(font.glyf, excludeUnicodes);
|
||||
// // regulate
|
||||
// for (let g of font.glyf) regulateGlyph(g, skew);
|
||||
|
||||
// reorder
|
||||
font.glyf = font.glyf.sort((a, b) => a.gord - b.gord);
|
||||
|
|
|
@ -505,6 +505,7 @@ export : define [apply] : begin
|
|||
foreach {unicode glyphid tfm} [items-of records] : create-glyph [suggestName : 'smcp' + glyphid] : glyph-construction
|
||||
if unicode : assign-unicode unicode
|
||||
include sf.(glyphid) AS_BASE
|
||||
set-width sf.(glyphid).advanceWidth
|
||||
if tfm : include tfm
|
||||
|
||||
define [createMedievalCombs records] : if [not recursive] : begin
|
||||
|
@ -859,11 +860,14 @@ export : define [apply] : begin
|
|||
list 0x1DF4 'udieresis'
|
||||
|
||||
# Unicode Ligatures
|
||||
define [createLigatures shrink1 shrink2 wadj1 wadj2 records] : if [not recursive] : begin
|
||||
define [createLigatures _shrink1 _shrink2 wadj1 wadj2 records] : if [not recursive] : begin
|
||||
local pendingGlyphs1 : records.map : [record] => record.1
|
||||
local pendingGlyphs2 : records.map : [record] => record.2
|
||||
local df1 : Thinner pendingGlyphs1 [if (para.spacing > 1) 1 shrink1]
|
||||
local df2 : Thinner pendingGlyphs2 [if (para.spacing > 1) 1 shrink2]
|
||||
local wide : para.spaing > 1 || para.diversityW > 1
|
||||
local shrink1 : if (wide) 1 [clamp 0 1 (_shrink1 * para.diversityW)]
|
||||
local shrink2 : if (wide) 1 [clamp 0 1 (_shrink2 * para.diversityW)]
|
||||
local df1 : Thinner pendingGlyphs1 shrink1
|
||||
local df2 : Thinner pendingGlyphs2 shrink2
|
||||
|
||||
foreach [{unicode c1 c2 mark} : items-of records] : begin
|
||||
local glyphName "\(c1)_\(c2)"
|
||||
|
@ -871,7 +875,7 @@ export : define [apply] : begin
|
|||
local j 2
|
||||
while glyphs.(glyphName + j) : inc j
|
||||
set glyphName (glyphName + j)
|
||||
if (para.spacing > 1) : begin
|
||||
if wide : begin
|
||||
sketch
|
||||
include df2.(c2)
|
||||
include : Translate WIDTH 0
|
||||
|
@ -880,19 +884,20 @@ export : define [apply] : begin
|
|||
save glyphName unicode
|
||||
: else
|
||||
local kern : SB * 7/8 * (shrink1 + shrink2)
|
||||
local refw : WIDTH * (shrink1 * wadj1 + shrink2 * wadj2) - kern
|
||||
local refW : WIDTH * (shrink1 * wadj1 + shrink2 * wadj2) - kern
|
||||
local targetW : WIDTH * para.diversityW
|
||||
sketch
|
||||
include df2.(c2)
|
||||
include : Translate (WIDTH * shrink1 * wadj1 - kern) 0
|
||||
include df1.(c1)
|
||||
include : Translate (-WIDTH * shrink1 * (1 - wadj1) / 2) 0
|
||||
include : Upright
|
||||
include : Translate (-refw / 2) 0
|
||||
include : Scale ((WIDTH - SB * 1.25) / (WIDTH - SB * 2) * WIDTH / refw) 1
|
||||
include : Translate (WIDTH / 2) 0
|
||||
include : Translate (-refW / 2) 0
|
||||
include : Scale ((targetW - SB * 1.25) / (targetW - SB * 2) * targetW / refW) 1
|
||||
include : Translate (targetW / 2) 0
|
||||
include : Italify
|
||||
|
||||
if mark : include mark
|
||||
if mark : include [MarksetDiv para.diversityW].(mark)
|
||||
save glyphName unicode
|
||||
|
||||
define stdShrink : clamp 0.75 0.9 : linreg 72 0.75 108 0.9 STROKE
|
||||
|
@ -918,8 +923,8 @@ export : define [apply] : begin
|
|||
list 0x2A9 'f' 'eng'
|
||||
list 0x2AA 'l' 's'
|
||||
list 0x2AB 'l' 'z'
|
||||
list 0x478 'O' 'y' markset.if
|
||||
list 0x479 'o' 'y' markset.p
|
||||
list 0x478 'O' 'y' 'if'
|
||||
list 0x479 'o' 'y' 'p'
|
||||
list 0x20A7 'P' 's'
|
||||
list 0x20A8 'R' 's'
|
||||
createLigatures 0.7 0.8 0.75 0.9 : list
|
||||
|
|
|
@ -31,9 +31,9 @@ export : define [apply] : begin
|
|||
set this.cmpPriority chosenGlyph.cmpPriority
|
||||
|
||||
define [italic-variant name unicode] : create-glyph name : glyph-construction
|
||||
if para.isItalic
|
||||
then : include glyphs.(name + '.italic') AS_BASE
|
||||
else : include glyphs.(name + '.upright') AS_BASE
|
||||
define base : if para.isItalic glyphs.(name + '.italic') glyphs.(name + '.upright')
|
||||
include base AS_BASE
|
||||
set-width base.advanceWidth
|
||||
if unicode : assign-unicode unicode
|
||||
|
||||
define [alias newid unicode oldid] : begin
|
||||
|
@ -132,6 +132,20 @@ export : define [apply] : begin
|
|||
|
||||
|
||||
###### COMMON SHAPES
|
||||
define [Rect u d l r transformShiftOnly] : create-glyph : glyph-construction
|
||||
local my ((u + d) / 2)
|
||||
local mx ((l + r) / 2)
|
||||
currentGlyph.gizmo = [if transformShiftOnly [Translate 0 0] globalTransform]
|
||||
include : spiro-outline
|
||||
begin [lambda : set this.gizmo currentGlyph.gizmo]
|
||||
corner l d
|
||||
corner l u
|
||||
corner u u
|
||||
corner r d
|
||||
close [lambda : begin [set this.angles 4] [set this.fairGizmo currentGlyph.gizmo]]
|
||||
if transformShiftOnly : begin
|
||||
local {.x mx1 .y my1} [tp globalTransform {.x mx .y my}]
|
||||
apply-transform : Translate (mx1 - mx) (my1 - my)
|
||||
define [Ring u d l r transformShiftOnly] : create-glyph : glyph-construction
|
||||
local my ((u + d) / 2)
|
||||
local mx ((l + r) / 2)
|
||||
|
@ -410,7 +424,7 @@ export : define [apply] : begin
|
|||
include : dispiro : nShoulderKnots.apply null a
|
||||
|
||||
|
||||
define [mShoulderSpiro] : params [left right top bottom width fine] : glyph-construction
|
||||
define [mShoulderSpiro] : params [left right top bottom width fine diversity] : glyph-construction
|
||||
local fix : TANSLANT * STROKE * HVCONTRAST * width / STROKE
|
||||
local sm : SMALLSMOOTH * 0.7
|
||||
include : spiro-outline
|
||||
|
@ -430,6 +444,7 @@ export : define [apply] : begin
|
|||
corner right bottom
|
||||
close
|
||||
|
||||
|
||||
define [HBar xleft xright y _fine] : glyph-construction
|
||||
include : dispiro
|
||||
widths.center [fallback _fine STROKE]
|
||||
|
@ -653,6 +668,10 @@ export : define [apply] : begin
|
|||
forkedPara.accentx = ACCENTX * p
|
||||
forkedPara.jut = JUT * p
|
||||
forkedPara.longjut = LONGJUT * p
|
||||
forkedPara.diversityM = 1
|
||||
forkedPara.diversityW = 1
|
||||
forkedPara.diversityI = 1
|
||||
forkedPara.diversityF = 1
|
||||
#forkedPara.hookx = HOOKX * p
|
||||
return : Fork glyphs forkedPara
|
||||
|
||||
|
@ -712,4 +731,4 @@ export : define [apply] : begin
|
|||
include : difference background [union.apply null candidates]
|
||||
include overlay
|
||||
|
||||
return [object queryFeatureSelector select-variant italic-variant alias composite into-unicode turned dual hcombine vdual vcombine fwl fwr dwl dwr dwc Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright Overlay]
|
||||
return [object queryFeatureSelector select-variant italic-variant alias composite into-unicode turned dual hcombine vdual vcombine fwl fwr dwl dwr dwc Rect Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright Overlay]
|
||||
|
|
|
@ -469,27 +469,41 @@ export : define [apply] : begin
|
|||
save 'looprevesh' 0x1AA
|
||||
|
||||
### V and v
|
||||
local cornerdist : HALFSTROKE * HVCONTRAST * [if SLAB 1.2 1]
|
||||
local cornerdist : HALFSTROKE * HVCONTRAST * 1.15
|
||||
local vcurviness : if (SLAB && !para.isItalic) 0.15 0.3
|
||||
define [VShape] : params [top [sw STROKE]] : glyph-construction
|
||||
include : dispiro
|
||||
widths.lhs sw
|
||||
flat SB top [heading DOWNWARD]
|
||||
curl SB (top * 0.9) [heading DOWNWARD]
|
||||
quadcontrols 0 vcurviness 9 unimportant
|
||||
g4 (MIDDLE - cornerdist) 0 [widths.lhs (VShape.fine * sw / STROKE)]
|
||||
define [VShape] : params [top [sw STROKE] barStraight div] : glyph-construction
|
||||
local df : DivFrame div
|
||||
local fine : if barStraight STROKE (VShape.fine * sw / STROKE)
|
||||
if barStraight : begin
|
||||
include : dispiro
|
||||
widths.lhs sw
|
||||
flat (SB + O * 2) top [heading DOWNWARD]
|
||||
g4 (df.middle - cornerdist) 0 [widths.lhs fine]
|
||||
: else : begin
|
||||
include : dispiro
|
||||
widths.lhs sw
|
||||
flat SB top [heading DOWNWARD]
|
||||
curl SB (top * 0.9) [heading DOWNWARD]
|
||||
quadcontrols 0 vcurviness 9 unimportant
|
||||
g4 (df.middle - cornerdist) 0 [widths.lhs fine]
|
||||
|
||||
#bottom cap
|
||||
start-from (MIDDLE + cornerdist) 0
|
||||
line-to (MIDDLE - cornerdist) 0
|
||||
line-to MIDDLE (VShape.fine * sw / STROKE)
|
||||
start-from (df.middle + cornerdist) 0
|
||||
line-to (df.middle - cornerdist) 0
|
||||
line-to df.middle fine
|
||||
|
||||
include : dispiro
|
||||
widths.rhs sw
|
||||
flat RIGHTSB top [heading DOWNWARD]
|
||||
curl RIGHTSB (top * 0.9) [heading DOWNWARD]
|
||||
quadcontrols 0 vcurviness 9 unimportant
|
||||
g4 (MIDDLE + cornerdist) 0 [widths.rhs (VShape.fine * sw / STROKE)]
|
||||
if barStraight : begin
|
||||
include : dispiro
|
||||
widths.rhs sw
|
||||
flat (df.rightSB - O * 2) top [heading DOWNWARD]
|
||||
g4 (df.middle + cornerdist) 0 [widths.rhs fine]
|
||||
: else : begin
|
||||
include : dispiro
|
||||
widths.rhs sw
|
||||
flat df.rightSB top [heading DOWNWARD]
|
||||
curl df.rightSB (top * 0.9) [heading DOWNWARD]
|
||||
quadcontrols 0 vcurviness 9 unimportant
|
||||
g4 (df.middle + cornerdist) 0 [widths.rhs fine]
|
||||
tag-contour 'strokeUp'
|
||||
include : AIVSerifs top
|
||||
set VShape.fine : STROKE * [fallback para.vtipfine : if SLAB 0.9 0.8]
|
||||
|
@ -497,17 +511,17 @@ export : define [apply] : begin
|
|||
sketch # V
|
||||
set-width WIDTH
|
||||
include markset.capital
|
||||
include : VShape CAP
|
||||
include : VShape CAP STROKE para.straightBar
|
||||
|
||||
save 'V' 'V'
|
||||
|
||||
sketch # v
|
||||
include markset.e
|
||||
include : VShape XH
|
||||
include : VShape XH STROKE para.straightBar
|
||||
|
||||
save 'v' 'v'
|
||||
define [VHooktopShape top] : glyph-construction
|
||||
include : VShape top
|
||||
define [VHooktopShape top _stroke barStraight] : glyph-construction
|
||||
include : VShape top [fallback _stroke STROKE] barStraight
|
||||
eject-contour 'serifRT'
|
||||
eject-contour 'strokeUp'
|
||||
|
||||
|
@ -520,13 +534,13 @@ export : define [apply] : begin
|
|||
|
||||
sketch # vhooktop
|
||||
include markset.e
|
||||
include : VHooktopShape XH
|
||||
include : VHooktopShape XH STROKE para.straightBar
|
||||
save 'vhooktop' 0x2C71
|
||||
save 'cyrizhitsa' 0x475
|
||||
|
||||
sketch # cyrIzhitsa
|
||||
include markset.capital
|
||||
include : VHooktopShape CAP
|
||||
include : VHooktopShape CAP STROKE para.straightBar
|
||||
save 'cyrIzhitsa' 0x474
|
||||
|
||||
turned 'turnv' 0x28C 'v' MIDDLE (XH / 2)
|
||||
|
@ -557,10 +571,12 @@ export : define [apply] : begin
|
|||
include markset.capital
|
||||
set-anchor 'trailing' BASE (RIGHTSB - markHalfStroke) 0
|
||||
|
||||
include : VShape CAP
|
||||
include : VShape CAP STROKE para.straightBar
|
||||
include : FlipAround MIDDLE (CAP / 2)
|
||||
|
||||
local p : linreg 18 0.075 108 0.075 STROKE
|
||||
local p : if para.straightBar
|
||||
linreg 18 0.16 108 0.16 STROKE
|
||||
linreg 18 0.075 108 0.075 STROKE
|
||||
if (SLAB && !para.isItalic) : set p : p * 1.33
|
||||
include : HBarTop [mix SB RIGHTSB p] [mix RIGHTSB SB p] (XH / 2)
|
||||
save 'A' 'A'
|
||||
|
@ -651,90 +667,131 @@ export : define [apply] : begin
|
|||
save 'artail' 0x1D8F
|
||||
|
||||
### W and w
|
||||
define [WShape top] : glyph-construction
|
||||
local wheight (top * 0.6)
|
||||
define [WShape top barStraight _div] : glyph-construction
|
||||
local div : fallback _div 1
|
||||
local rightSB : WIDTH * div - SB
|
||||
local middle : MIDDLE * div
|
||||
local fine : if barStraight
|
||||
adviceBlackness WShape.fineS div
|
||||
[adviceBlackness WShape.fine div] / WShape.fineOffset
|
||||
local fineOffset : fine / 2 * HVCONTRAST * WShape.fineOffset
|
||||
local m1 : WIDTH * div * [if barStraight WShape.m1S WShape.m1] + [if barStraight O 0]
|
||||
local m2 : WIDTH * div * [if barStraight WShape.m2S WShape.m2] - [if barStraight O 0]
|
||||
local wheight : if barStraight top (top * 0.6)
|
||||
|
||||
include : dispiro
|
||||
widths.lhs
|
||||
flat SB top [heading DOWNWARD]
|
||||
curl SB (top * 0.75) [heading DOWNWARD]
|
||||
quadcontrols 0 0.3 6 unimportant
|
||||
g4 (WShape.m1 - WShape.fine / 2 * HVCONTRAST) 0 [widths.lhs (WShape.fine * 0.8)]
|
||||
if barStraight : begin
|
||||
include : dispiro
|
||||
widths.lhs
|
||||
flat (SB + O * 2) top [heading DOWNWARD]
|
||||
g4 (m1 - fineOffset) 0 [widths.lhs fine]
|
||||
: else : begin
|
||||
include : dispiro
|
||||
widths.lhs
|
||||
flat SB top [heading DOWNWARD]
|
||||
curl SB (top * 0.75) [heading DOWNWARD]
|
||||
quadcontrols 0 0.3 6 unimportant
|
||||
g4 (m1 - fineOffset) 0 [widths.lhs fine]
|
||||
|
||||
# bottom cap 1
|
||||
start-from (WShape.m1 + WShape.fine / 2 * HVCONTRAST) 0
|
||||
line-to (WShape.m1 - WShape.fine / 2 * HVCONTRAST) 0
|
||||
line-to WShape.m1 WShape.fine
|
||||
start-from (m1 + fineOffset) 0
|
||||
line-to (m1 - fineOffset) 0
|
||||
line-to m1 fine
|
||||
|
||||
include : dispiro
|
||||
widths.rhs WShape.fine
|
||||
flat (MIDDLE + WShape.fine / 2 * HVCONTRAST) wheight [heading DOWNWARD]
|
||||
widths.lhs fine
|
||||
flat (middle - fineOffset) wheight
|
||||
#quadcontrols 0 0.1 6 unimportant
|
||||
g4 (WShape.m1 + WShape.fine / 2 * HVCONTRAST) 0 [widths.rhs WShape.fine]
|
||||
g4 (m1 + fineOffset) 0 [widths.rhs fine]
|
||||
include : dispiro
|
||||
widths.lhs WShape.fine
|
||||
flat (MIDDLE - WShape.fine / 2 * HVCONTRAST) wheight [heading DOWNWARD]
|
||||
widths.rhs fine
|
||||
flat (middle + fineOffset) wheight
|
||||
#quadcontrols 0 0.1 6 unimportant
|
||||
curl (WShape.m2 - WShape.fine / 2 * HVCONTRAST) 0 [widths.lhs WShape.fine]
|
||||
curl (m2 - fineOffset) 0 [widths.lhs fine]
|
||||
|
||||
# middle cap
|
||||
start-from (middle + fineOffset) wheight
|
||||
line-to middle (wheight - fine)
|
||||
line-to (middle - fineOffset) wheight
|
||||
|
||||
# bottom cap 2
|
||||
start-from (WShape.m2 + WShape.fine / 2 * HVCONTRAST) 0
|
||||
line-to (WShape.m2 - WShape.fine / 2 * HVCONTRAST) 0
|
||||
line-to WShape.m2 WShape.fine
|
||||
start-from (m2 + fineOffset) 0
|
||||
line-to (m2 - fineOffset) 0
|
||||
line-to m2 fine
|
||||
|
||||
include : dispiro
|
||||
widths.rhs
|
||||
flat RIGHTSB top [heading DOWNWARD]
|
||||
curl RIGHTSB (top * 0.75) [heading DOWNWARD]
|
||||
quadcontrols 0 0.3 6 unimportant
|
||||
g4 (WShape.m2 + WShape.fine / 2 * HVCONTRAST) 0 [widths.rhs (WShape.fine * 0.8)]
|
||||
include : AIVSerifs top
|
||||
set WShape.fine : adviceBlackness 6
|
||||
set WShape.m1 : WIDTH * 0.325
|
||||
set WShape.m2 : WIDTH * 0.675
|
||||
if barStraight : begin
|
||||
include : dispiro
|
||||
widths.rhs
|
||||
flat (rightSB - O * 2) top [heading DOWNWARD]
|
||||
g4 (m2 + fineOffset) 0 [widths.rhs fine]
|
||||
: else : begin
|
||||
include : dispiro
|
||||
widths.rhs
|
||||
flat rightSB top [heading DOWNWARD]
|
||||
curl rightSB (top * 0.75) [heading DOWNWARD]
|
||||
quadcontrols 0 0.3 6 unimportant
|
||||
g4 (m2 + fineOffset) 0 [widths.rhs fine]
|
||||
include : AIVSerifs top SB rightSB
|
||||
|
||||
set WShape.fine 6.5
|
||||
set WShape.fineS 5.5
|
||||
set WShape.fineOffset 1.375
|
||||
set WShape.m1 0.325
|
||||
set WShape.m2 0.675
|
||||
set WShape.m1S 0.30
|
||||
set WShape.m2S 0.70
|
||||
|
||||
sketch # W
|
||||
set-width WIDTH
|
||||
include markset.capital
|
||||
include : WShape CAP
|
||||
set-width (WIDTH * para.diversityW)
|
||||
include [MarksetDiv para.diversityW].capital
|
||||
include : WShape CAP para.straightBar para.diversityW
|
||||
save 'W' 'W'
|
||||
save 'cyrWe' 0x51C
|
||||
|
||||
sketch # w
|
||||
set-width WIDTH
|
||||
include markset.e
|
||||
include : WShape XH
|
||||
set-width (WIDTH * para.diversityW)
|
||||
include [MarksetDiv para.diversityW].e
|
||||
include : WShape XH para.straightBar para.diversityW
|
||||
save 'w' 'w'
|
||||
save 'cyrwe' 0x51D
|
||||
|
||||
turned nothing 0x28D 'w' MIDDLE (XH / 2)
|
||||
turned nothing 0x28D 'w' (MIDDLE * para.diversityW) (XH / 2)
|
||||
|
||||
define [WHooktopShape top] : glyph-construction
|
||||
include : WShape top
|
||||
define [WHooktopShape top barStraight _div] : glyph-construction
|
||||
local div : fallback _div 1
|
||||
local fine : if barStraight
|
||||
adviceBlackness WShape.fineS div
|
||||
[adviceBlackness WShape.fine div] / WShape.fineOffset
|
||||
local fineOffset : fine / 2 * HVCONTRAST * WShape.fineOffset
|
||||
local rightSB : WIDTH * div - SB
|
||||
local m2 : WIDTH * div * [if barStraight WShape.m2S WShape.m2] - [if barStraight O 0]
|
||||
|
||||
include : WShape top barStraight div
|
||||
|
||||
# Eject unnecessary contours
|
||||
this.contours.pop
|
||||
if SLAB : begin
|
||||
local s : this.contours.pop
|
||||
this.contours.pop
|
||||
this.contours.push s
|
||||
|
||||
|
||||
include : dispiro
|
||||
widths.rhs
|
||||
straight.down.start RIGHTSB (top - HOOK) [heading DOWNWARD]
|
||||
straight.down.start rightSB (top - HOOK) [heading DOWNWARD]
|
||||
quadcontrols 0 0.3 6 unimportant g2
|
||||
g4 (WShape.m2 + WShape.fine / 2 * HVCONTRAST) 0 [widths.rhs (WShape.fine * 0.8)]
|
||||
include : VerticalHook (RIGHTSB - HALFSTROKE * HVCONTRAST) (top - HOOK) (HOOKX * 0.65) (-HOOK + HALFSTROKE)
|
||||
g4 (m2 + fineOffset) 0 [widths.rhs fine]
|
||||
|
||||
include : VerticalHook (rightSB - HALFSTROKE * HVCONTRAST) (top - HOOK) (HOOKX * 0.65) (-HOOK + HALFSTROKE)
|
||||
|
||||
sketch # Whooktop
|
||||
include markset.capital
|
||||
|
||||
include : WHooktopShape CAP
|
||||
set-width (WIDTH * para.diversityW)
|
||||
include [MarksetDiv para.diversityW].capital
|
||||
include : WHooktopShape CAP para.straightBar para.diversityW
|
||||
save 'Whooktop' 0x2C72
|
||||
|
||||
sketch # whooktop
|
||||
include markset.e
|
||||
|
||||
include : WHooktopShape XH
|
||||
|
||||
set-width (WIDTH * para.diversityW)
|
||||
include [MarksetDiv para.diversityW].e
|
||||
include : WHooktopShape XH para.straightBar para.diversityW
|
||||
save 'whooktop' 0x2C73
|
||||
|
||||
sketch # ww
|
||||
|
@ -965,22 +1022,44 @@ export : define [apply] : begin
|
|||
save 'lambdaslash' 0x19B
|
||||
|
||||
### K and k
|
||||
define [KShape top] : glyph-construction
|
||||
define [KShape top straightBar] : glyph-construction
|
||||
local turn (top * 0.99)
|
||||
|
||||
local attach (top * [if SLAB 0.325 0.375])
|
||||
local attach2 [if SLAB [mix SB RIGHTSB 0.48] MIDDLE]
|
||||
|
||||
local fine : adviceBlackness 3.5
|
||||
include : dispiro
|
||||
g4.down.start (RIGHTSB) top [widths.heading 0 (STROKE * [if SLAB 1.15 1.05] * (WIDTH * 2 / UPM)) DOWNWARD]
|
||||
bezcontrols 0 [if SLAB 0.1 0.2] 0.5 [if SLAB 0.55 0.65] 8
|
||||
g4 (SB + STROKE) attach [widths 0 fine]
|
||||
include : dispiro
|
||||
widths.center
|
||||
g4.up.start (RIGHTSB - O - HALFSTROKE * HVCONTRAST) 0 [heading UPWARD]
|
||||
quadcontrols 0 [if SLAB 0.125 0.25] 8
|
||||
g4 attach2 (top * 0.61) [widths.center fine]
|
||||
|
||||
if straightBar : do
|
||||
local attach (top * 0.42 - STROKE)
|
||||
local attach2 (top * 0.72 + STROKE)
|
||||
include : intersection
|
||||
Rect top 0 0 WIDTH
|
||||
dispiro
|
||||
widths.rhs
|
||||
flat (RIGHTSB - O * 2) top
|
||||
curl (SB + STROKE) attach [widths 0 fine]
|
||||
|
||||
include : intersection
|
||||
spiro-outline
|
||||
corner (SB + STROKE) 0
|
||||
corner (SB + STROKE) (attach + 1)
|
||||
corner (RIGHTSB - O * 2 - 1) top
|
||||
corner (RIGHTSB - O * 2) top
|
||||
corner (RIGHTSB - O * 2) 0
|
||||
dispiro
|
||||
widths.lhs
|
||||
flat (RIGHTSB - O * 2) 0
|
||||
curl (SB + STROKE) attach2
|
||||
: else : do
|
||||
local attach (top * [if SLAB 0.325 0.375])
|
||||
local attach2 [if SLAB [mix SB RIGHTSB 0.48] MIDDLE]
|
||||
include : dispiro
|
||||
g4.down.start (RIGHTSB) top [widths.heading 0 (STROKE * [if SLAB 1.15 1.05] * (WIDTH * 2 / UPM)) DOWNWARD]
|
||||
bezcontrols 0 [if SLAB 0.1 0.2] 0.5 [if SLAB 0.55 0.65] 8
|
||||
g4 (SB + STROKE) attach [widths 0 fine]
|
||||
include : dispiro
|
||||
widths.center
|
||||
g4.up.start (RIGHTSB - O - HALFSTROKE * HVCONTRAST) 0 [heading UPWARD]
|
||||
quadcontrols 0 [if SLAB 0.125 0.25] 8
|
||||
g4 attach2 (top * 0.61) [widths.center fine]
|
||||
|
||||
if SLAB : begin
|
||||
include : RightwardTopSerif (RIGHTSB - (STROKE * [if SLAB 1.15 1.05] * (WIDTH * 2 / UPM) / 2 - HALFSTROKE) * HVCONTRAST * [if para.isItalic 1 0] - HALFSTROKE * 0.5 * HVCONTRAST) top (SIDEJUT + HALFSTROKE * 0.5 * HVCONTRAST)
|
||||
include : RightwardBottomSerif (RIGHTSB - O * [if para.isItalic 1 0]) 0 SIDEJUT
|
||||
|
@ -989,7 +1068,7 @@ export : define [apply] : begin
|
|||
set-width WIDTH
|
||||
include markset.capital
|
||||
include : VBarLeft SB 0 CAP
|
||||
include : KShape CAP
|
||||
include : KShape CAP para.straightBar
|
||||
if SLAB : begin
|
||||
include : CenterTopSerif (SB + HALFSTROKE * HVCONTRAST) CAP JUT
|
||||
include : CenterBottomSerif (SB + HALFSTROKE * HVCONTRAST) 0 JUT
|
||||
|
@ -1003,7 +1082,7 @@ export : define [apply] : begin
|
|||
set-width WIDTH
|
||||
include markset.b
|
||||
include : VBarLeft SB 0 CAP
|
||||
include : KShape XH
|
||||
include : KShape XH para.straightBar
|
||||
if SLAB : begin
|
||||
include : LeftwardTopSerif SB CAP SIDEJUT
|
||||
if (!para.isItalic) : begin
|
||||
|
@ -1016,7 +1095,7 @@ export : define [apply] : begin
|
|||
set-width WIDTH
|
||||
include markset.e
|
||||
include : VBarLeft SB 0 XH
|
||||
include : KShape XH
|
||||
include : KShape XH para.straightBar
|
||||
if SLAB : begin
|
||||
include : LeftwardTopSerif SB XH SIDEJUT
|
||||
|
||||
|
@ -1026,7 +1105,7 @@ export : define [apply] : begin
|
|||
set-width WIDTH
|
||||
include markset.e
|
||||
include : VBarLeft SB 0 XH
|
||||
include : KShape XH
|
||||
include : KShape XH para.straightBar
|
||||
if SLAB : begin
|
||||
include : CenterBottomSerif (SB + HALFSTROKE * HVCONTRAST) 0 JUT
|
||||
include : CenterTopSerif (SB + HALFSTROKE * HVCONTRAST) XH JUT
|
||||
|
@ -1037,7 +1116,7 @@ export : define [apply] : begin
|
|||
|
||||
sketch # Khooktop
|
||||
include markset.capital
|
||||
include : KShape CAP
|
||||
include : KShape CAP para.straightBar
|
||||
include : VBarLeft SB 0 (CAP - HOOK - HALFSTROKE)
|
||||
include : VerticalHook (SB + HALFSTROKE * HVCONTRAST) (CAP - HOOK - HALFSTROKE) HOOKX (-HOOK)
|
||||
|
||||
|
@ -1045,7 +1124,7 @@ export : define [apply] : begin
|
|||
|
||||
sketch # khooktop
|
||||
include markset.b
|
||||
include : KShape XH
|
||||
include : KShape XH para.straightBar
|
||||
include : VBarLeft SB 0 (CAP - HOOK - HALFSTROKE)
|
||||
include : VerticalHook (SB + HALFSTROKE * HVCONTRAST) (CAP - HOOK - HALFSTROKE) HOOKX (-HOOK)
|
||||
|
||||
|
@ -2321,30 +2400,34 @@ export : define [apply] : begin
|
|||
save 'latinupsilon2' 0x28B
|
||||
|
||||
### M
|
||||
define [MShape top] : glyph-construction
|
||||
local topstroke : adviceBlackness 5
|
||||
define [MShape top _div] : glyph-construction
|
||||
local div : fallback _div 1
|
||||
local rightSB : WIDTH * div - SB
|
||||
local middle : MIDDLE * div
|
||||
local topstroke : adviceBlackness 5 div
|
||||
local halftopstroke : topstroke / 2
|
||||
local middleY : top * 0.3 / div
|
||||
|
||||
include : dispiro
|
||||
flat SB 0 [widths.heading 0 STROKE UPWARD]
|
||||
curl SB (top * 0.2) [heading UPWARD]
|
||||
straight.up.end SB top [widths.heading 0 topstroke UPWARD]
|
||||
include : dispiro
|
||||
flat RIGHTSB 0 [widths.heading STROKE 0 UPWARD]
|
||||
curl RIGHTSB (top * 0.2) [heading UPWARD]
|
||||
straight.up.end RIGHTSB top [widths.heading topstroke 0 UPWARD]
|
||||
flat rightSB 0 [widths.heading STROKE 0 UPWARD]
|
||||
curl rightSB (top * 0.2) [heading UPWARD]
|
||||
straight.up.end rightSB top [widths.heading topstroke 0 UPWARD]
|
||||
include : dispiro
|
||||
flat (SB + halftopstroke) top [widths.heading topstroke 0 DOWNWARD]
|
||||
curl MIDDLE (top * 0.3) [widths.heading (topstroke / 2) (topstroke / 2) DOWNWARD]
|
||||
curl middle middleY [widths.heading (topstroke / 2) (topstroke / 2) DOWNWARD]
|
||||
include : dispiro
|
||||
flat (RIGHTSB - halftopstroke) top [widths.heading 0 topstroke DOWNWARD]
|
||||
curl MIDDLE (top * 0.3) [widths.heading (topstroke / 2) (topstroke / 2) DOWNWARD]
|
||||
include : AIMSerifs top
|
||||
flat (rightSB - halftopstroke) top [widths.heading 0 topstroke DOWNWARD]
|
||||
curl middle middleY [widths.heading (topstroke / 2) (topstroke / 2) DOWNWARD]
|
||||
include : AIMSerifs top SB rightSB
|
||||
|
||||
sketch # M
|
||||
set-width WIDTH
|
||||
include markset.capital
|
||||
include : MShape CAP
|
||||
set-width (WIDTH * para.diversityM)
|
||||
include [MarksetDiv para.diversityM].capital
|
||||
include : MShape CAP para.diversityM
|
||||
save 'M' 'M'
|
||||
save 'Mu' 0x39C
|
||||
save 'cyrEm' 0x41C
|
||||
|
@ -2355,66 +2438,77 @@ export : define [apply] : begin
|
|||
save 'cyrem' 0x43C
|
||||
|
||||
### m
|
||||
define [SmallMShape top bot mbot] : glyph-construction
|
||||
local m1 : mix (SB + O) (MIDDLE + MVERTSTROKE / 2 * HVCONTRAST) 0.5
|
||||
local m2 : mix (RIGHTSB - O) (MIDDLE - MVERTSTROKE / 2 * HVCONTRAST) 0.5
|
||||
define [SmallMShape top bot mbot _div] : glyph-construction
|
||||
local div : fallback _div 1
|
||||
local rightSB : WIDTH * div - SB
|
||||
local middle : MIDDLE * div
|
||||
local mvs : MVERTSTROKE_D div
|
||||
|
||||
local m1 : mix (SB + O) (middle + mvs / 2 * HVCONTRAST) 0.5
|
||||
local m2 : mix (rightSB - O) (middle - mvs / 2 * HVCONTRAST) 0.5
|
||||
include : mShoulderSpiro
|
||||
left -- (SB + O + MVERTSTROKE * HVCONTRAST)
|
||||
right -- (MIDDLE + MVERTSTROKE / 2 * HVCONTRAST)
|
||||
top -- top
|
||||
bottom -- mbot
|
||||
width -- MVERTSTROKE
|
||||
fine -- (MVERTSTROKE * SHOULDERFINE / STROKE)
|
||||
left -- (SB + O + mvs * HVCONTRAST)
|
||||
right -- (middle + mvs / 2 * HVCONTRAST)
|
||||
top -- top
|
||||
bottom -- mbot
|
||||
width -- mvs
|
||||
fine -- (mvs * SHOULDERFINE / STROKE)
|
||||
diversity -- div
|
||||
include : mShoulderSpiro
|
||||
left -- (MIDDLE + MVERTSTROKE * 0.5 * HVCONTRAST)
|
||||
right -- (RIGHTSB - O)
|
||||
top -- top
|
||||
bottom -- bot
|
||||
width -- MVERTSTROKE
|
||||
fine -- (MVERTSTROKE * SHOULDERFINE / STROKE)
|
||||
include : VBarLeft (SB + O) bot top MVERTSTROKE
|
||||
left -- (middle + mvs * 0.5 * HVCONTRAST)
|
||||
right -- (rightSB - O)
|
||||
top -- top
|
||||
bottom -- bot
|
||||
width -- mvs
|
||||
fine -- (mvs * SHOULDERFINE / STROKE)
|
||||
diversity -- div
|
||||
include : VBarLeft (SB + O) bot top mvs
|
||||
if SLAB : begin
|
||||
include : LeftwardTopSerif SB top SIDEJUT
|
||||
tag-contour 'serifLT'
|
||||
if (!para.isItalic) : include : LeftwardBottomSerif SB bot SIDEJUT
|
||||
include : RightwardBottomSerif RIGHTSB bot SIDEJUT
|
||||
include : RightwardBottomSerif rightSB bot SIDEJUT
|
||||
tag-contour 'serifRB'
|
||||
|
||||
sketch # m
|
||||
set-width WIDTH
|
||||
include markset.e
|
||||
include : SmallMShape XH 0 0
|
||||
set-width (WIDTH * para.diversityM)
|
||||
include [MarksetDiv para.diversityM].e
|
||||
include : SmallMShape XH 0 0 para.diversityM
|
||||
save 'm.longleg'
|
||||
save 'cyrte.italic'
|
||||
sketch # m
|
||||
set-width WIDTH
|
||||
include markset.e
|
||||
include : SmallMShape XH 0 [XH * 0.2]
|
||||
set-width (WIDTH * para.diversityM)
|
||||
include [MarksetDiv para.diversityM].e
|
||||
include : SmallMShape XH 0 [XH * 0.2] para.diversityM
|
||||
save 'm.shortleg'
|
||||
select-variant 'm' 'm'
|
||||
composite 'cyrtedescender.italic' glyphs.'cyrte.italic' [CyrDescender RIGHTSB] markset.e
|
||||
composite 'cyrtedescender.italic' glyphs.'cyrte.italic' [CyrDescender (WIDTH * para.diversityM - SB)] markset.e
|
||||
|
||||
sketch # mltail
|
||||
local mvs : MVERTSTROKE_D para.diversityM
|
||||
include markset.p
|
||||
include glyphs.m
|
||||
eject-contour 'serifRB'
|
||||
include : VerticalHook (RIGHTSB - O - MVERTSTROKE / 2 * HVCONTRAST) 0 (-HOOKX) HOOK MVERTSTROKE
|
||||
include : VerticalHook (WIDTH * para.diversityM - SB - O - mvs / 2 * HVCONTRAST) 0 (-HOOKX) HOOK mvs
|
||||
|
||||
save 'mltail' 0x271
|
||||
turned nothing 0x26F 'm' MIDDLE (XH / 2)
|
||||
turned nothing 0x26F 'm' (MIDDLE * para.diversityM) (XH / 2)
|
||||
|
||||
sketch # capitalTurnm
|
||||
include markset.capital
|
||||
include : SmallMShape CAP 0 0
|
||||
include : FlipAround MIDDLE (CAP / 2)
|
||||
set-width (WIDTH * para.diversityM)
|
||||
include [MarksetDiv para.diversityM].capital
|
||||
include : SmallMShape CAP 0 0 para.diversityM
|
||||
include : FlipAround (MIDDLE * para.diversityM) (CAP / 2)
|
||||
save 'capitalTurnm' 0x19C
|
||||
|
||||
sketch # turnmleg
|
||||
include markset.p
|
||||
local mvs : MVERTSTROKE_D para.diversityM
|
||||
set-width (WIDTH * para.diversityM)
|
||||
include [MarksetDiv para.diversityM].p
|
||||
include glyphs.m
|
||||
eject-contour 'serifLT'
|
||||
include : FlipAround MIDDLE (XH / 2)
|
||||
include : VBarRight (RIGHTSB - O) DESCENDER 0 MVERTSTROKE
|
||||
include : FlipAround (MIDDLE * para.diversityM) (XH / 2)
|
||||
include : VBarRight (WIDTH * para.diversityM - SB - O) DESCENDER 0 mvs
|
||||
save 'turnmleg' 0x270
|
||||
|
||||
### H
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -375,47 +375,49 @@ export : define [apply] : begin
|
|||
curl (RIGHTSB - HALFSTROKE + TANSLANT * sw) (bot + O)
|
||||
save 'at.long'
|
||||
|
||||
sketch # at.tight
|
||||
set-width WIDTH
|
||||
sketch # at.fourfold
|
||||
local div para.diversityM
|
||||
set-width (WIDTH * div)
|
||||
|
||||
local top parenTop
|
||||
local bot parenBot
|
||||
local otop : mix bot top 0.75
|
||||
local obot : mix top bot 0.8
|
||||
|
||||
local sw : adviceBlackness 4
|
||||
local swh : adviceBlackness 3.75
|
||||
local left : SB - sw * HVCONTRAST / 3
|
||||
local right : RIGHTSB + sw * HVCONTRAST / 3
|
||||
local sw : adviceBlackness 4 div
|
||||
local swh : adviceBlackness 3.75 div
|
||||
local left : SB * div - sw * HVCONTRAST / 3
|
||||
local right : (WIDTH * div - SB * div) + sw * HVCONTRAST / 3
|
||||
local middle: MIDDLE * div
|
||||
|
||||
local m1 : [mix (left + sw / 2) (right - sw / 2) (1 / 3)] - sw * HVCONTRAST / 2
|
||||
local m2 : [mix (left + sw / 2) (right - sw / 2) (2 / 3)] + sw * HVCONTRAST / 2
|
||||
|
||||
local sma : SMOOTHA * ((m2 - m1) / (RIGHTSB - SB) * 1.1)
|
||||
local smb : SMOOTHB * ((m2 - m1) / (RIGHTSB - SB) * 1.1)
|
||||
local sma : SMOOTHA * ((m2 - m1) / (WIDTH - SB * 2) * 1.1)
|
||||
local smb : SMOOTHB * ((m2 - m1) / (WIDTH - SB * 2) * 1.1)
|
||||
|
||||
include : dispiro
|
||||
widths.lhs sw
|
||||
flat m2 (obot - O) [heading UPWARD]
|
||||
curl m2 (otop - smb)
|
||||
arcvh
|
||||
g4 (MIDDLE - CORRECTION_OMIDX * sw) (otop - O)
|
||||
g4 (middle - CORRECTION_OMIDX * sw) (otop - O)
|
||||
archv
|
||||
flat m1 (otop - sma)
|
||||
curl m1 (obot + smb)
|
||||
arcvh
|
||||
flat MIDDLE obot
|
||||
flat middle obot
|
||||
curl (right - (m2 - m1) / 2) obot
|
||||
archv
|
||||
flat right (obot + sma)
|
||||
curl right (top - SMOOTHB)
|
||||
curl right (top - SMOOTHB * div)
|
||||
arcvh
|
||||
g4 (MIDDLE - CORRECTION_OMIDS) (top - O) [widths swh 0]
|
||||
g4 (middle - CORRECTION_OMIDS) (top - O) [widths swh 0]
|
||||
archv
|
||||
flat left (top - SMOOTHA) [widths sw 0]
|
||||
curl left (bot + SMOOTHB)
|
||||
flat left (top - SMOOTHA * div) [widths sw 0]
|
||||
curl left (bot + SMOOTHB * div)
|
||||
arcvh
|
||||
flat (MIDDLE + CORRECTION_OMIDS) (bot + O) [widths swh 0 ]
|
||||
flat (middle + CORRECTION_OMIDS) (bot + O) [widths swh 0 ]
|
||||
curl (right - HALFSTROKE + TANSLANT * sw) (bot + O)
|
||||
save 'at.fourfold'
|
||||
|
||||
|
|
|
@ -133,8 +133,9 @@ export : define [calculateMetrics para] : begin
|
|||
# Blackness parameters
|
||||
# We will estimate blackness using lower-case 'e'
|
||||
define WHITENESS : ((XH - STROKE * 3) * (RIGHTSB - SB) * (1 / 3)) / (XH * (RIGHTSB - SB))
|
||||
define [adviceBlackness crowdedness] : Math.min STROKE ((500 - SB * 2) * (1 - WHITENESS) / (crowdedness * HVCONTRAST))
|
||||
define MVERTSTROKE : adviceBlackness : fallback para.lllcrowdedness (3 + 1 / 3)
|
||||
define [adviceBlackness crowdedness div] : Math.min STROKE (((WIDTH * [fallback div 1]) - SB * 2) * (1 - WHITENESS) / (crowdedness * HVCONTRAST))
|
||||
define [MVERTSTROKE_D div] : adviceBlackness [fallback para.lllcrowdedness (3 + 1 / 3)] div
|
||||
define MVERTSTROKE : MVERTSTROKE_D 1
|
||||
define OVERLAYSTROKE : adviceBlackness 3.75
|
||||
define OPERATORSTROKE : adviceBlackness 3.2
|
||||
define GEOMETRYSTROKE : adviceBlackness 4.5
|
||||
|
@ -159,7 +160,7 @@ export : define [calculateMetrics para] : begin
|
|||
TAILADJX TAILADJY LBALANCE IBALANCE LBALANCE2 IBALANCE2 JBALANCE JBALANCE2 TBALANCE TBALANCE2 RBALANCE RBALANCE2
|
||||
FBALANCE ONEBALANCE FULLWIDTH FULLWIDTH1 FULLWIDTH2 FULLWIDTH3 OXE ESS ESSQUESTION XO CAPO HALFSTROKE RIGHTSB FWRSB
|
||||
MIDDLE FWMIDDLE CAPMIDDLE CAP_SMOOTH DOTRADIUS PERIODRADIUS SIDEJUT SMOOTHA SMOOTHB SMALLSMOOTHA SMALLSMOOTHB CORRECTION_OMIDX CORRECTION_OMIDS
|
||||
WHITENESS adviceBlackness MVERTSTROKE OVERLAYSTROKE OPERATORSTROKE GEOMETRYSTROKE SHOULDERFINE SUPERNESS superxy
|
||||
WHITENESS adviceBlackness MVERTSTROKE MVERTSTROKE_D OVERLAYSTROKE OPERATORSTROKE GEOMETRYSTROKE SHOULDERFINE SUPERNESS superxy
|
||||
adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope]
|
||||
|
||||
export : define [setFontMetrics para metrics font] : begin
|
||||
|
|
|
@ -135,7 +135,7 @@ define-macro save : syntax-rules
|
|||
define-macro glyph-module-entry : syntax-rules
|
||||
`[glyph-module-entry @::_opts] : begin
|
||||
define optionalImports : object
|
||||
commonShapes `[define [object queryFeatureSelector select-variant italic-variant alias composite into-unicode turned hcombine vcombine dual vdual fwl fwr dwl dwr dwc Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright Overlay] $capture.commonShapes]
|
||||
commonShapes `[define [object queryFeatureSelector select-variant italic-variant alias composite into-unicode turned hcombine vcombine dual vdual fwl fwr dwl dwr dwc Rect Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign ForceUpright Overlay] $capture.commonShapes]
|
||||
|
||||
overmarks `[define [object markExtend markHalfStroke markStress markFine markMiddle markDotsRadius aboveMarkTop aboveMarkBot aboveMarkMid belowMarkBot belowMarkTop commaOvershoot commaOvershoot2 commaAboveRadius TildeShape] $capture.overmarks]
|
||||
|
||||
|
@ -150,7 +150,7 @@ define-macro glyph-module-entry : syntax-rules
|
|||
for [local j 0] (j < opts.length) [inc j] : if optionalImports.(opts.(j)) : optionalImportStatements.push optionalImports.(opts.(j))
|
||||
dirty `[begin \\
|
||||
define $capture this
|
||||
define [object metrics $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ save-glyph spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged TempFont includeGlyphPart compsiteMarkSet] $capture
|
||||
define [object metrics $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ save-glyph spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged TempFont includeGlyphPart compsiteMarkSet MarksetDiv DivFrame] $capture
|
||||
define [object
|
||||
UPM WIDTH SB CAP XH DESCENDER CONTRAST
|
||||
symbolMid parenTop parenBot operTop operBot tackTop tackBot plusTop plusBot Italify Upright Scale Translate Rotate globalTransform
|
||||
|
@ -160,7 +160,7 @@ define-macro glyph-module-entry : syntax-rules
|
|||
TAILADJX TAILADJY LBALANCE IBALANCE LBALANCE2 IBALANCE2 JBALANCE JBALANCE2 TBALANCE TBALANCE2 RBALANCE RBALANCE2
|
||||
FBALANCE ONEBALANCE FULLWIDTH FULLWIDTH1 FULLWIDTH2 FULLWIDTH3 OXE ESS ESSQUESTION XO CAPO HALFSTROKE RIGHTSB FWRSB
|
||||
MIDDLE FWMIDDLE CAPMIDDLE CAP_SMOOTH DOTRADIUS PERIODRADIUS SIDEJUT SMOOTHA SMOOTHB SMALLSMOOTHA SMALLSMOOTHB CORRECTION_OMIDX CORRECTION_OMIDS
|
||||
WHITENESS adviceBlackness MVERTSTROKE OVERLAYSTROKE OPERATORSTROKE GEOMETRYSTROKE SHOULDERFINE SUPERNESS superxy
|
||||
WHITENESS adviceBlackness MVERTSTROKE MVERTSTROKE_D OVERLAYSTROKE OPERATORSTROKE GEOMETRYSTROKE SHOULDERFINE SUPERNESS superxy
|
||||
adviceSSmooth adviceGlottalStopSmooth shoulderMidSlope] metrics
|
||||
define [object
|
||||
g4 g2 corner flat curl close end straight
|
||||
|
@ -168,4 +168,4 @@ define-macro glyph-module-entry : syntax-rules
|
|||
alsothru alsothruthem bezcontrols quadcontrols archv arcvh complexThru
|
||||
dispiro spiro-outline union intersection difference] spirofns
|
||||
* @optionalImportStatements
|
||||
]
|
||||
]
|
||||
|
|
|
@ -97,7 +97,6 @@ export : define [assignFontNames para metrics font] : begin
|
|||
|
||||
# Weight, width and slantness
|
||||
set font.OS_2.usWeightClass para.naming.weight
|
||||
set font.OS_2.panose.3 9 # Monospaced
|
||||
set font.OS_2.panose.2 : 1 + para.naming.weight / 100
|
||||
set font.OS_2.fsSelection : object
|
||||
oblique : not : not isOblique
|
||||
|
@ -106,8 +105,14 @@ export : define [assignFontNames para metrics font] : begin
|
|||
regular : not : not ([not isBold] && [not isItalic] && [not isOblique])
|
||||
useTypoMetrics true
|
||||
set font.OS_2.sFamilyClass : 8 * 0x100 + 9
|
||||
set font.post.isFixedPitch true
|
||||
set font.OS_2.xAvgCharWidth para.width
|
||||
set font.head.macStyle : object
|
||||
bold : not : not isBold
|
||||
italic : not : not (isItalic || isOblique)
|
||||
|
||||
if (para.diversityW == 1 && para.diversityM == 1 && para.diversityF == 1 && para.diversityI == 1) : begin
|
||||
set font.OS_2.panose.3 9 # Monospaced
|
||||
set font.post.isFixedPitch true
|
||||
: else : begin
|
||||
set font.OS_2.panose.3 0
|
||||
set font.post.isFixedPitch false
|
|
@ -81,6 +81,12 @@ fullwidth_codes = []
|
|||
# Comment the line below to enable CJKV glyph generation
|
||||
noCJKV = true
|
||||
|
||||
# Diversity widths
|
||||
diversityM = 1
|
||||
diversityW = 1
|
||||
diversityF = 1
|
||||
diversityI = 1
|
||||
|
||||
[verbose]
|
||||
verbose = true
|
||||
|
||||
|
@ -248,6 +254,14 @@ sb = 0.9
|
|||
[compressed]
|
||||
inherits = ['wd-compressed']
|
||||
|
||||
# EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
|
||||
# Diversity: Having more width variations
|
||||
[shape-straight-bar]
|
||||
straightBar = 1
|
||||
[diversity-1]
|
||||
diversityM = 1.25
|
||||
diversityW = 1.25
|
||||
|
||||
###### Full-width codes
|
||||
[xx-type]
|
||||
spacing = 2
|
||||
|
|
|
@ -414,6 +414,7 @@ phony(`release`).def(async target => {
|
|||
////// Script Building //////
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
const MARCOS = [`file-updated:meta/macros.ptl`];
|
||||
oracle("{ptl|js}-scripts-under:***").def((target, $ext, $1) =>
|
||||
FileList({ under: $1, pattern: `**/*.${$ext}` })(target)
|
||||
);
|
||||
|
@ -435,6 +436,9 @@ file(`{gen|glyphs|support|meta}/**/*.js`).def(async target => {
|
|||
const [jsFromPtl] = await target.need("scripts:js-from-ptl");
|
||||
if (jsFromPtl.indexOf(target.path.full) >= 0) {
|
||||
const ptl = target.path.full.replace(/\.js$/g, ".ptl");
|
||||
if (/^glyphs\//.test(target.path.full)) {
|
||||
await target.need(MARCOS);
|
||||
}
|
||||
await target.need(`file-updated:${ptl}`);
|
||||
await run(PATEL_C, "--strict", ptl, "-o", target.path.full);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue