diff --git a/packages/font-glyphs/src/auto-build/composite.ptl b/packages/font-glyphs/src/auto-build/composite.ptl index 5acc5b2b8..24133388e 100644 --- a/packages/font-glyphs/src/auto-build/composite.ptl +++ b/packages/font-glyphs/src/auto-build/composite.ptl @@ -187,21 +187,16 @@ glyph-block AutoBuild-Enclosure : begin include : with-transform [Translate x 0] : refer-glyph gniPart set x : x + ([enclosureInnerPartActualWidth.get gniPart] || 0) - define [EnclosureInner inners gnEnclosure miniatureFont job dimens] : begin + define [EnclosureInner dimens inners miniatureFont job] : glyph-proc define { gn unicode parts w bal baly } job define [object width] dimens local finalParts : EnsureInnerSubGlyphSeq inners 'enclosureInner' miniatureFont job dimens 1 0 - if gnEnclosure - : then : begin - return : glyph-proc - include : EnclosureInnerImpl dimens finalParts - CvDecompose.set currentGlyph [{gnEnclosure}.concat finalParts] - : else : begin - return : new-glyph : EnclosureInnerImpl dimens finalParts + include : new-glyph : EnclosureInnerImpl dimens finalParts + return finalParts - define [TwoRowEnclosureInner inners gnEnclosure miniatureFont job dimens] : begin + define [TwoRowEnclosureInner dimens inners miniatureFont job] : glyph-proc define { gn unicode parts w bal baly } job define [object width] dimens local jobFirstHalf { gn unicode [parts.slice 0 (parts.length / 2)] w bal baly } @@ -209,14 +204,10 @@ glyph-block AutoBuild-Enclosure : begin local finalPartsFirstHalf : EnsureInnerSubGlyphSeq inners "enclosureInnerFirstHalf" miniatureFont jobFirstHalf dimens 0.45 (+0.55) local finalPartsSecondHalf : EnsureInnerSubGlyphSeq inners "enclosureInnerSecondHalf" miniatureFont jobSecondHalf dimens 0.45 (+0.00) - if gnEnclosure - : then : return : glyph-proc - include : EnclosureInnerImpl dimens finalPartsFirstHalf - include : EnclosureInnerImpl dimens finalPartsSecondHalf - CvDecompose.set currentGlyph [{gnEnclosure}.concat finalPartsFirstHalf finalPartsSecondHalf] - : else : return : new-glyph : glyph-proc + include : new-glyph : glyph-proc include : EnclosureInnerImpl dimens finalPartsFirstHalf include : EnclosureInnerImpl dimens finalPartsSecondHalf + return : {}.concat finalPartsFirstHalf finalPartsSecondHalf define [CircCrowd digits width] : 2 + 2 * [Math.pow [AdjustDigitCount digits width] (2 / 3)] * [Math.max 1 (HalfUPM / Width)] define [CircScale digits width] : 0.65 / [Math.pow [AdjustDigitCount digits width] 0.5] @@ -286,66 +277,62 @@ glyph-block AutoBuild-Enclosure : begin define forkedPara : inners.getPara para digits rows ww define miniatureFont : CreateDerivedFontFromJobs jobs {} : function [gs] : Fork gs forkedPara define gnEnclosure : CircName null (prefix + digits + '.enclosure') {} suffix + + define [buildImpl job decomposable] : begin + define { gn unicode parts w bal baly } job + if [query-glyph gn] : return nothing + create-glyph gn [if (w == ww) unicode null] : glyph-proc + define dimens : CircleDimens digits ww + set-width dimens.width + include : builder.buildGlyph dimens inners miniatureFont decomposable job gnEnclosure + # if decomposable gnEnclosure null + if [not : query-glyph gnEnclosure] : create-glyph gnEnclosure : fnEnclosure digits ww gap - foreach job [items-of jobs.decomposableJobs] : begin - builder.build (prefix + digits) inners digits ww gap job miniatureFont gnEnclosure true - foreach job [items-of jobs.nonDecomposable] : begin - builder.build (prefix + digits) inners digits ww gap job miniatureFont gnEnclosure false + foreach job [items-of jobs.decomposableJobs] : buildImpl job true + foreach job [items-of jobs.nonDecomposable] : buildImpl job false applyRelations jobs.relApplications # Builders and Enclosure Shapes define CircledBuilder : object decomposable true - build : lambda [prefix inners digits ww gap job miniatureFont gnEnclosure decomposable] : begin - define { gn unicode parts w bal baly } job - define dimens : CircleDimens digits ww - define [object width] dimens - if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc - set-width width - include : EnclosureInner inners [if decomposable gnEnclosure null] miniatureFont job dimens - include : refer-glyph gnEnclosure + buildGlyph : function [dimens inners miniatureFont decomp job gnEnclosure] : glyph-proc + include : refer-glyph gnEnclosure + local parts : include : EnclosureInner dimens inners miniatureFont job + if decomp : CvDecompose.set currentGlyph [{gnEnclosure}.concat parts] + + define DecomposableInsetBuilder : object + decomposable true + buildGlyph : function [dimens inners miniatureFont decomp job gnEnclosure] : glyph-proc + include : CircledBuilder.buildGlyph dimens inners miniatureFont decomp job gnEnclosure + include : radicalize define TwoRowBoxedBuilder : object decomposable true - build : lambda [prefix inners digits ww gap job miniatureFont gnEnclosure decomposable] : begin - define { gn unicode parts w bal baly } job - define dimens : CircleDimens digits ww - define [object width] dimens - if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc - set-width width - include : TwoRowEnclosureInner inners [if decomposable gnEnclosure null] miniatureFont job dimens - include : refer-glyph gnEnclosure + buildGlyph : function [dimens inners miniatureFont decomp job gnEnclosure] : glyph-proc + include : refer-glyph gnEnclosure + local parts : include : TwoRowEnclosureInner dimens inners miniatureFont job + if decomp : CvDecompose.set currentGlyph [{gnEnclosure}.concat parts] define InsetBuilder : object decomposable false - build : lambda [prefix inners digits ww gap job miniatureFont gnEnclosure decomposable] : begin - define { gn unicode parts w bal baly } job - define dimens : CircleDimens digits ww - define [object width] dimens - if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc - set-width width - include : difference - refer-glyph gnEnclosure - EnclosureInner inners [if decomposable gnEnclosure null] miniatureFont job dimens + buildGlyph : function [dimens inners miniatureFont decomp job gnEnclosure] : difference + refer-glyph gnEnclosure + EnclosureInner dimens inners miniatureFont job define InsetWithGapBuilder : object decomposable false - build : lambda [prefix inners digits ww gap job miniatureFont gnEnclosure decomposable] : begin - define { gn unicode parts w bal baly } job - define dimens : CircleDimens digits ww - define [object width top bot left right] dimens - if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc - set-width width - local gap : Math.max [AdviceStroke 6] (Width * 0.08) - local [inner] : EnclosureInner inners null miniatureFont job dimens - include : difference - intersection - Rect top bot left right - union - refer-glyph gnEnclosure - remove-holes [inner] - with-outlined gap [inner] - inner + buildGlyph : function [dimens inners miniatureFont decomp job gnEnclosure] : begin + define [object top bot left right] dimens + local gap : Math.max [AdviceStroke 6] (Width * 0.08) + local [inner] : EnclosureInner dimens inners miniatureFont job + return : difference + intersection + Rect top bot left right + union + refer-glyph gnEnclosure + remove-holes [inner] + with-outlined gap [inner] + inner define [AddEnclosureMark digits dimens] : glyph-proc define [object width dscale mockInnerWidth] dimens @@ -440,7 +427,7 @@ glyph-block AutoBuild-Enclosure : begin include : AddEnclosureMark digits : CircleDimens digits ww define [createDecomposableInsetCircledGlyphs digits demands] - EnclosureT 'inset-circle-decomp' CircledBuilder DecomposableInsetInners digits 1 demands DecomposableInsetCircleEnclosureShape + EnclosureT 'inset-circle-decomp' DecomposableInsetBuilder DecomposableInsetInners digits 1 demands DecomposableInsetCircleEnclosureShape define [DecomposableInsetCircleEnclosureShape digits ww gap] : glyph-proc define [object width sw top bot left right archDepthA archDepthB] : CircleDimens digits ww set-width width @@ -450,7 +437,7 @@ glyph-block AutoBuild-Enclosure : begin include : AddEnclosureMark digits : CircleDimens digits ww define [createDecomposableInsetBoxedGlyphs digits demands] - EnclosureT 'inset-boxed-decomp' CircledBuilder DecomposableInsetInners digits 1 demands DecomposableInsetBoxEnclosureShape + EnclosureT 'inset-boxed-decomp' DecomposableInsetBuilder DecomposableInsetInners digits 1 demands DecomposableInsetBoxEnclosureShape define [DecomposableInsetBoxEnclosureShape digits ww gap] : glyph-proc define [object width top bot left right] : CircleDimens digits ww set-width width @@ -546,8 +533,10 @@ glyph-block AutoBuild-Enclosure : begin define dimens : bracedDottdeDimens digits ww define [object width] dimens set-width width - include : EnclosureInner StandardInners [if jobDecomposable gnb null] miniatureFont job dimens + include : refer-glyph gnb + local parts : include : EnclosureInner dimens StandardInners miniatureFont job + if jobDecomposable : CvDecompose.set currentGlyph [{gnb}.concat parts] foreach job [items-of jobs.decomposableJobs] : CreateGlyphImpl true job foreach job [items-of jobs.nonDecomposable] : CreateGlyphImpl false job diff --git a/packages/font-glyphs/src/common/shapes.ptl b/packages/font-glyphs/src/common/shapes.ptl index 3392a2c93..5c530b354 100644 --- a/packages/font-glyphs/src/common/shapes.ptl +++ b/packages/font-glyphs/src/common/shapes.ptl @@ -3,8 +3,7 @@ $$include '../meta/macros.ptl' import [mix linreg clamp fallback boole boolePn] from "@iosevka/util" import [Transform] from "@iosevka/geometry/transform" import [Interpolator] from "@iosevka/geometry/spiro-control" -import [Radical] from "@iosevka/glyph/relation" -import [StrokeGeometry RemoveHolesGeometry] from "@iosevka/geometry" +import [RadicalGeometry StrokeGeometry RemoveHolesGeometry] from "@iosevka/geometry" glyph-module @@ -41,8 +40,6 @@ glyph-block CommonShapes : begin glyph-block-export SquareAt define [SquareAt x y r] : Rect (y + r) (y - r) (x - r) (x + r) - glyph-block-export VERY-FAR - define VERY-FAR : UPM * 16 glyph-block-export MaskAbove define [MaskAbove y] : Rect (VERY-FAR) y (-VERY-FAR) (VERY-FAR) glyph-block-export MaskBelow @@ -685,6 +682,11 @@ glyph-block CommonShapes : begin local gizmo : currentGlyph.gizmo || GlobalTransform set currentGlyph.geometry : new RemoveHolesGeometry g gizmo + glyph-block-export radicalize + define [radicalize] : glyph-proc + local g currentGlyph.geometry + set currentGlyph.geometry : new RadicalGeometry g + glyph-block-export clear-geometry define [clear-geometry] : glyph-proc currentGlyph.clearGeometry @@ -694,11 +696,6 @@ glyph-block CommonShapes : begin set currentGlyph.markAnchors {.} set currentGlyph.markBnchors {.} - glyph-block-export AsRadical - define [AsRadical gr] : glyph-proc - Radical.set currentGlyph - include gr true true - glyph-block-export ExtLineCenter define [ExtLineCenter k sw x1 y1 x2 y2] : dispiro widths.center sw diff --git a/packages/font-glyphs/src/index.ptl b/packages/font-glyphs/src/index.ptl index 493261ca0..ad81981eb 100644 --- a/packages/font-glyphs/src/index.ptl +++ b/packages/font-glyphs/src/index.ptl @@ -77,6 +77,7 @@ export : define [buildGlyphs para recursive] : begin Contrast Metrics.Contrast Stroke Metrics.Stroke CorrectionOMidX Metrics.CorrectionOMidX + TINY Metrics.TINY Superness DesignParameters.superness define BooleFns : BooleKit.SetupBuilders : object globalTransform Metrics.GlobalTransform diff --git a/packages/font-glyphs/src/letter/cyrillic/yeri.ptl b/packages/font-glyphs/src/letter/cyrillic/yeri.ptl index 4eba80107..45f8a2308 100644 --- a/packages/font-glyphs/src/letter/cyrillic/yeri.ptl +++ b/packages/font-glyphs/src/letter/cyrillic/yeri.ptl @@ -87,7 +87,7 @@ glyph-block Letter-Cyrillic-Yeri : begin local yTurnBottomR : YSmoothMidR bowl 0 ada adb include : dispiro - flat left [Math.max yStart (yTurnBottomL + 0.1)] [widths.lhs.heading stroke Downward] + flat left [Math.max yStart (yTurnBottomL + TINY)] [widths.lhs.heading stroke Downward] curl left yTurnBottomL arch.lhs 0 (sw -- stroke) g4 (right - OX) yTurnBottomR @@ -109,7 +109,7 @@ glyph-block Letter-Cyrillic-Yeri : begin local yTurnBottomR : YSmoothMidR bowl 0 ada adb include : dispiro - flat left [Math.max yStart (yTurnBottomL + 0.1)] [widths.lhs.heading stroke Downward] + flat left [Math.max yStart (yTurnBottomL + TINY)] [widths.lhs.heading stroke Downward] curl left yTurnBottomL arch.lhs 0 (sw -- stroke) g4 (right - OX) yTurnBottomR @@ -152,7 +152,7 @@ glyph-block Letter-Cyrillic-Yeri : begin local yTurnBottomR : YSmoothMidR bowl 0 ada adb include : dispiro - flat right [Math.max yStart (yTurnBottomR + 0.1)] [widths.rhs.heading stroke Downward] + flat right [Math.max yStart (yTurnBottomR + TINY)] [widths.rhs.heading stroke Downward] curl right yTurnBottomR arch.rhs 0 (sw -- stroke) g4 (left + OX) yTurnBottomL diff --git a/packages/font-glyphs/src/letter/cyrillic/zhe.ptl b/packages/font-glyphs/src/letter/cyrillic/zhe.ptl index 2ee61cf97..99860dd98 100644 --- a/packages/font-glyphs/src/letter/cyrillic/zhe.ptl +++ b/packages/font-glyphs/src/letter/cyrillic/zhe.ptl @@ -50,10 +50,10 @@ glyph-block Letter-Cyrillic-Zhe : begin define attach2Y : [mix bot top 0.72] + fine define [mask] : spiro-outline - corner (df.leftSB + overshoot + 0.1) top - corner attach1X (attach1Y + 0.1) - corner (df.width - attach1X) (attach1Y + 0.1) - corner (df.rightSB - overshoot - 0.1) top + corner (df.leftSB + overshoot + TINY) top + corner attach1X (attach1Y + TINY) + corner (df.width - attach1X) (attach1Y + TINY) + corner (df.rightSB - overshoot - TINY) top local rightHalf : union intersection [MaskRight df.middle] @@ -96,9 +96,9 @@ glyph-block Letter-Cyrillic-Zhe : begin lowerCurvature g4 (df.width - attach1X) attach2Y [widths.center fine2] intersection [MaskRight df.middle] : spiro-outline - corner.down.start (df.rightSB - overshoot - 0.1) top + corner.down.start (df.rightSB - overshoot - TINY) top lowerCurvature - corner (df.width - attach1X) (attach1Y + 0.1) + corner (df.width - attach1X) (attach1Y + TINY) corner df.middle top local leftHalf : union @@ -112,9 +112,9 @@ glyph-block Letter-Cyrillic-Zhe : begin lowerCurvature g4 attach1X attach2Y [widths.center fine2] intersection [MaskLeft df.middle] : spiro-outline - corner.down.start (df.leftSB + overshoot + 0.1) top + corner.down.start (df.leftSB + overshoot + TINY) top lowerCurvature - corner attach1X (attach1Y + 0.1) + corner attach1X (attach1Y + TINY) corner df.middle top local fullShape : if fHalf rightHalf : union rightHalf leftHalf diff --git a/packages/font-glyphs/src/letter/greek/lower-kappa-symbol.ptl b/packages/font-glyphs/src/letter/greek/lower-kappa-symbol.ptl index 3805c6222..7a26bf0e7 100644 --- a/packages/font-glyphs/src/letter/greek/lower-kappa-symbol.ptl +++ b/packages/font-glyphs/src/letter/greek/lower-kappa-symbol.ptl @@ -19,8 +19,8 @@ glyph-block Letter-Greek-Lower-Kappa : begin define yBottom : 0 + 0.2 * Stroke define yTop : XH - 0.2 * Stroke - define deltaX : 0.001 * (xRight - xLeft) - define deltaY : 0.001 * (yTop - yBottom) + define deltaX : TINY * (xRight - xLeft) + define deltaY : TINY * (yTop - yBottom) define swTerm : AdviceStroke 3 define swTermThin : swTerm * CThinB diff --git a/packages/font-glyphs/src/letter/greek/upper-phi.ptl b/packages/font-glyphs/src/letter/greek/upper-phi.ptl index fc911bf88..241193758 100644 --- a/packages/font-glyphs/src/letter/greek/upper-phi.ptl +++ b/packages/font-glyphs/src/letter/greek/upper-phi.ptl @@ -56,14 +56,14 @@ glyph-block Letter-Greek-Upper-Phi : begin include : dispiro flat xCrossRight top [widths.lhs] - curl [Math.min (xBarLeft + hd.x) (xCrossRight - 0.1)] top + curl [Math.min (xBarLeft + hd.x) (xCrossRight - TINY)] top archv flat xBarLeft [Math.max y2 (top - hd.y)] curl xBarLeft (y2 + O) include : dispiro flat xCrossLeft bot [widths.lhs] - curl [Math.max (xBarRight - hd.x) (xCrossLeft + 0.1)] bot + curl [Math.max (xBarRight - hd.x) (xCrossLeft + TINY)] bot archv flat xBarRight [Math.min y1 (bot + hd.y)] curl xBarRight (y1 - O) diff --git a/packages/font-glyphs/src/letter/latin-ext/eszet.ptl b/packages/font-glyphs/src/letter/latin-ext/eszet.ptl index 9f0904229..a33cae902 100644 --- a/packages/font-glyphs/src/letter/latin-ext/eszet.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/eszet.ptl @@ -82,7 +82,7 @@ glyph-block Letter-Latin-Lower-Eszet : begin mix (SB + [HSwToV Stroke]) RightSB 0.1 mix SB RightSB 0.3 define xMiddle : Math.max xFinal (SB + [HSwToV : 1.2 * Stroke]) (RightSB - ymiddle / 2 - Stroke * 0.75) - define xMiddleBot : Math.max xMiddle (xFinal + 0.01 + TanSlope * Stroke) + define xMiddleBot : Math.max xMiddle (xFinal + TINY + TanSlope * Stroke) define ada : ArchDepthAOf (0.75 * ArchDepth) (0.5 * Width) define adb : ArchDepthBOf (0.75 * ArchDepth) (0.5 * Width) @@ -145,7 +145,7 @@ glyph-block Letter-Latin-Lower-Eszet : begin alsoThru.g2 0.5 0.50 [widths.center swInner] g4 (RightSB - OX) (innerSmoothB - 2 * TanSlope * swInner) [widths.rhs.heading swInner Downward] arcvh - flat [arch.adjust-x.bot ([Math.max (sEndX + 0.1 + TanSlope * swInner) : Math.min (RightSB - innerSmoothB) [mix sEndX RightSB 0.375]] + TanSlope * swInner) (swInner / 2)] 0 + flat [arch.adjust-x.bot ([Math.max (sEndX + TINY + TanSlope * swInner) : Math.min (RightSB - innerSmoothB) [mix sEndX RightSB 0.375]] + TanSlope * swInner) (swInner / 2)] 0 curl sEndX 0 [heading Leftward] include : EszetSerifs [DivFrame 1] false slab @@ -191,7 +191,7 @@ glyph-block Letter-Latin-Upper-Eszet : begin mix (SB + [HSwToV Stroke]) RightSB 0.1 mix SB RightSB 0.3 define xMiddle : Math.max xFinal (SB + [HSwToV : 1.2 * Stroke]) (RightSB - ymiddle / 2 - Stroke * 0.75) - define xMiddleBot : Math.max xMiddle (xFinal + 0.01 + TanSlope * Stroke) + define xMiddleBot : Math.max xMiddle (xFinal + TINY + TanSlope * Stroke) define rightTopX : RightSB + O include : dispiro diff --git a/packages/font-glyphs/src/letter/latin-ext/ezh.ptl b/packages/font-glyphs/src/letter/latin-ext/ezh.ptl index a6952795f..a1da56c0f 100644 --- a/packages/font-glyphs/src/letter/latin-ext/ezh.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/ezh.ptl @@ -60,8 +60,8 @@ glyph-block Letter-Latin-Ezh : begin spiro-outline corner (-df.width) bot corner (-df.width) (2 * top) - corner (ezhRight - xDiagWidth + 0.1) (2 * top) - corner (ezhRight - xDiagWidth + 0.1) (top - yFootHeight) + corner (ezhRight - xDiagWidth + TINY) (2 * top) + corner (ezhRight - xDiagWidth + TINY) (top - yFootHeight) corner (ezhLeft + xDiagWidth) yMidBar corner (ezhLeft + xDiagWidth) bot dispiro diff --git a/packages/font-glyphs/src/letter/latin-ext/long-s.ptl b/packages/font-glyphs/src/letter/latin-ext/long-s.ptl index 342c222fd..b439e20bd 100644 --- a/packages/font-glyphs/src/letter/latin-ext/long-s.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/long-s.ptl @@ -29,7 +29,7 @@ glyph-block Letter-Latin-Long-S : begin return : dispiro widths.center sw flat (x + sign * hookX) (top - sw / 2) - curl (x + sign * [Math.min (hd.x - [HSwToV : 0.25 * sw]) (hookX - 0.1)]) (top - sw / 2) + curl (x + sign * [Math.min (hd.x - [HSwToV : 0.25 * sw]) (hookX - TINY)]) (top - sw / 2) archv.superness DesignParameters.tightHookSuperness flat x (top - sw / 2 - [Math.min hd.y hookY]) curl x bottom [heading Downward] @@ -40,7 +40,7 @@ glyph-block Letter-Latin-Long-S : begin return : dispiro widths.center sw flat (x - sign * hookX) (bottom + sw / 2) - curl (x - sign * [Math.min (hd.x - [HSwToV : 0.25 * sw]) (hookX - 0.1)]) (bottom + sw / 2) + curl (x - sign * [Math.min (hd.x - [HSwToV : 0.25 * sw]) (hookX - TINY)]) (bottom + sw / 2) archv.superness DesignParameters.tightHookSuperness flat x (bottom + sw / 2 + [Math.min hd.y hookY]) curl x top [heading Upward] @@ -71,11 +71,11 @@ glyph-block Letter-Latin-Long-S : begin include : tagged "serifLB" : HSerif.mb xSerifPos 0 serifLength if [maskBits fSlab SLAB_MIDDLE] : begin include : tagged "serifLM" : intersection - MaskLeft (m + 0.1) + MaskLeft (m + TINY) HSerif.mt xSerifPos fbar serifLength if [maskBits fSlab SLAB_MIDDLE_XH] : begin include : tagged "serifLM" : intersection - MaskLeft (m + 0.1) + MaskLeft (m + TINY) HSerif.mt xSerifPos XH serifLength define [LongSBentHookBase y0 m fSlab] : glyph-proc @@ -107,7 +107,7 @@ glyph-block Letter-Latin-Long-S : begin include : dispiro widths.lhs flat RightSB Ascender - curl [Math.min (RightSB - 0.01) (m + hd.x)] Ascender + curl [Math.min (RightSB - TINY) (m + hd.x)] Ascender archv flat m (Ascender - hd.y) curl m yBot [heading Downward] diff --git a/packages/font-glyphs/src/letter/latin-ext/upper-aa-ao.ptl b/packages/font-glyphs/src/letter/latin-ext/upper-aa-ao.ptl index fcdb54b3b..e98fc77bc 100644 --- a/packages/font-glyphs/src/letter/latin-ext/upper-aa-ao.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/upper-aa-ao.ptl @@ -97,7 +97,7 @@ glyph-block Letter-Latin-Upper-AA-AO : begin intersection MaskAbove (height - Stroke) with-transform [ApparentTranslate topSerifGap 0] [refer-glyph leftMask] - with-transform [ApparentTranslate (OX - 0.1) 0] [refer-glyph rightMask] + with-transform [ApparentTranslate (OX - TINY) 0] [refer-glyph rightMask] do "AO" derive-multi-part-glyphs 'AO' 0xA734 {"AA/Left" "AA/LeftMask" "OO/right"} diff --git a/packages/font-glyphs/src/letter/latin/k.ptl b/packages/font-glyphs/src/letter/latin/k.ptl index 311053c27..d883d27b7 100644 --- a/packages/font-glyphs/src/letter/latin/k.ptl +++ b/packages/font-glyphs/src/letter/latin/k.ptl @@ -80,7 +80,7 @@ glyph-block Letter-Latin-K : begin spiro-outline corner (kshLeft + stroke) 0 corner (kshLeft + stroke) (attach + 1) - corner (kshRightTop - Ok - 0.1) top + corner (kshRightTop - Ok - TINY) top corner (kshRightBot - Ok) top corner (kshRightBot - Ok) 0 dispiro @@ -92,10 +92,10 @@ glyph-block Letter-Latin-K : begin KSlabs slabLegs top left right stroke true KAttachment attachment slabLegs top left right stroke true union - HalfRectTriangle (kshRightBot - Ok - 0.1) 0 (kshLeft + stroke - 0.1) attach2 + HalfRectTriangle (kshRightBot - Ok - TINY) 0 (kshLeft + stroke - TINY) attach2 intersection TopStrokeMask (-0.1) - HalfRectTriangle (kshRightTop - Ok - 0.1) top (kshLeft + stroke - 0.1) attach + HalfRectTriangle (kshRightTop - Ok - TINY) top (kshLeft + stroke - TINY) attach export : define [Symmetric leadGap hookDepth] : function [fHookTop left right stroke top slabLT slabLegs attachment] : glyph-proc local fine : AdviceStroke [if leadGap 3.5 3] @@ -173,10 +173,10 @@ glyph-block Letter-Latin-K : begin union intersection StrokeMask 1 top (0.5 * top) (-0.1) - HalfRectTriangle (kshRight - Ok - 0.1) top ([mix (kshRight - Ok) xAttach 2] - 0.1) [mix top yAttach 2] + HalfRectTriangle (kshRight - Ok - TINY) top ([mix (kshRight - Ok) xAttach 2] - TINY) [mix top yAttach 2] intersection StrokeMask 0 (0.5 * top) 0 (-0.1) - HalfRectTriangle (kshRight - Ok - 0.1) 0 ([mix (kshRight - Ok) xAttach 2] - 0.1) [mix 0 coYAttach 2] + HalfRectTriangle (kshRight - Ok - TINY) 0 ([mix (kshRight - Ok) xAttach 2] - TINY) [mix 0 coYAttach 2] export : define [Curly fHookTop left right stroke top slabLT slabLegs attachment] : glyph-proc local turn : top * 0.99 @@ -216,17 +216,17 @@ glyph-block Letter-Latin-K : begin g4 xAttach2 yAttach2 [widths.center fine] if fHookTop spiro-outline - straight.left.start (kshRight + [if [maskBit slabLegs 1] SideJut 0] - TanSlope * stroke) (top - stroke + 0.1) + straight.left.start (kshRight + [if [maskBit slabLegs 1] SideJut 0] - TanSlope * stroke) (top - stroke + TINY) upperCurvatureHT - corner (xAttach1 - 0.1) yAttach1 + corner (xAttach1 - TINY) yAttach1 corner (-Width) yAttach1 corner (-Width) (top * 2) corner (2 * Width) (top * 2) - corner (2 * Width) (top - stroke + 0.1) + corner (2 * Width) (top - stroke + TINY) spiro-outline - corner.down.start (kshRight - 0.1) top + corner.down.start (kshRight - TINY) top upperCurvature - corner (kshLeft + stroke) (yAttach1 + 0.1) + corner (kshLeft + stroke) (yAttach1 + TINY) corner kshLeft 0 corner kshLeft top include : difference @@ -301,7 +301,7 @@ glyph-block Letter-Latin-K : begin union KSlabs [if slabLegs 1 0] top left right stroke true KAttachment attachment slabLegs top left right stroke true - HalfRectTriangle (dim.kshRight - dim.Ok - 0.1) 0 (dim.arcTerminalX - 0.1) dim.arcTerminalY + HalfRectTriangle (dim.kshRight - dim.Ok - TINY) 0 (dim.arcTerminalX - TINY) dim.arcTerminalY export : define [CursiveTailed fHookTop left right stroke top slabLT slabLegs attachment] : glyph-proc define dim : CursiveDimen left right top stroke slabLT slabLegs diff --git a/packages/font-glyphs/src/letter/latin/lower-e.ptl b/packages/font-glyphs/src/letter/latin/lower-e.ptl index 996d9541d..2af6198a5 100644 --- a/packages/font-glyphs/src/letter/latin/lower-e.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-e.ptl @@ -172,7 +172,7 @@ glyph-block Letter-Latin-Lower-E : begin MaskBelow lastKnot.y dispiro g4 lastKnot.x lastKnot.y [widths.rhs fine] - g4 (lastKnot.x - beginCoSlope * 0.01) (lastKnot.y - 0.01) + g4 (lastKnot.x - beginCoSlope * TINY) (lastKnot.y - TINY) alsoThruThem.fromTWithOffset {(1/3) (2/3)} : object rx : function [rt] rt deltaX : function [rt] 0 diff --git a/packages/font-glyphs/src/letter/latin/lower-f.ptl b/packages/font-glyphs/src/letter/latin/lower-f.ptl index 14a4d1e82..b4fec0ef6 100644 --- a/packages/font-glyphs/src/letter/latin/lower-f.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-f.ptl @@ -42,7 +42,7 @@ glyph-block Letter-Latin-Lower-F : begin return : dispiro widths.lhs flat counterHookLeft Descender - curl [Math.max (barRight - hd.x) (counterHookLeft + 0.1)] Descender + curl [Math.max (barRight - hd.x) (counterHookLeft + TINY)] Descender archv.superness DesignParameters.tightHookSuperness flat barRight [Math.min 0 (Descender + hd.y)] curl barRight 0.1 [heading Upward] @@ -111,7 +111,7 @@ glyph-block Letter-Latin-Lower-F : begin include : dispiro widths.lhs flat (crossRight + topHookExt) Ascender - curl [Math.min (barLeft + hd.x * (1 + topHookHdExt)) (crossRight - 0.1)] Ascender + curl [Math.min (barLeft + hd.x * (1 + topHookHdExt)) (crossRight - TINY)] Ascender archv.superness DesignParameters.tightHookSuperness flat barLeft [Math.max XH (Ascender - hd.y)] curl barLeft 0 [heading Downward] diff --git a/packages/font-glyphs/src/letter/latin/lower-g.ptl b/packages/font-glyphs/src/letter/latin/lower-g.ptl index ec937da6e..f06fcd101 100644 --- a/packages/font-glyphs/src/letter/latin/lower-g.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-g.ptl @@ -95,7 +95,7 @@ glyph-block Letter-Latin-Lower-G : begin export : define [RoundHook df y0] : RoundHookT dispiro df y0 0 df.mvs export : define [FlatHook df y0] : begin local hd : FlatHookDepth df (9 / 8) - local xTerminal : Math.min (df.rightSB - hd.x - 0.1) : mix df.leftSB df.rightSB (1 / 5) + local xTerminal : Math.min (df.rightSB - hd.x - TINY) : mix df.leftSB df.rightSB (1 / 5) return : dispiro widths.rhs df.mvs flat df.rightSB y0 [heading Downward] diff --git a/packages/font-glyphs/src/letter/latin/lower-m.ptl b/packages/font-glyphs/src/letter/latin/lower-m.ptl index a3bf2922b..2f980ab30 100644 --- a/packages/font-glyphs/src/letter/latin/lower-m.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-m.ptl @@ -19,7 +19,7 @@ glyph-block Letter-Latin-Lower-M : begin local fix : TanSlope * [HSwToV Stroke] * width / Stroke local sm : [SmallMSmooth df] + fix / 2 include : spiro-outline - corner (right - [HSwToV width]) [Math.min (top - sm - 0.1) bottom] + corner (right - [HSwToV width]) [Math.min (top - sm - TINY) bottom] curl (right - [HSwToV width]) (top - sm + fix) arcvh 8 g2 [mix left (right - [HSwToV width]) 0.5] (top - O - width) @@ -35,14 +35,14 @@ glyph-block Letter-Latin-Lower-M : begin g2 [mix (left - [HSwToV fine]) right 0.5] (top - O) archv 8 flat right (top - sm) - corner right [Math.min (top - sm - 0.1) bottom] + corner right [Math.min (top - sm - TINY) bottom] close define [RevSmallMShoulderSpiro] : with-params [left right top bottom width fine df coBottom] : glyph-proc local fix : TanSlope * [HSwToV Stroke] * width / Stroke local sm : [SmallMSmooth df] - fix / 2 include : spiro-outline - corner (left + [HSwToV width]) [Math.min (top - sm - 0.1) bottom] + corner (left + [HSwToV width]) [Math.min (top - sm - TINY) bottom] curl (left + [HSwToV width]) (top - sm - fix) arcvh 8 g2 [mix right (left + [HSwToV width]) 0.5] (top - O - width) @@ -58,7 +58,7 @@ glyph-block Letter-Latin-Lower-M : begin g2 [mix (right + [HSwToV fine]) left 0.5] (top - O) archv 8 flat left (top - sm) - corner left [Math.min (top - sm - 0.1) bottom] + corner left [Math.min (top - sm - TINY) bottom] close define [SmallMTopLeftSerif df top lbot fFull] : begin @@ -212,7 +212,7 @@ glyph-block Letter-Latin-Lower-M : begin widths.rhs df.mvs g4 df.leftSB (top - DToothlessRise) arch.rhs top (sw -- df.mvs) (blendPre -- {}) - flat df.rightSB [Math.max (top - [SmallMSmooth df]) (rbot + 0.1)] + flat df.rightSB [Math.max (top - [SmallMSmooth df]) (rbot + TINY)] curl df.rightSB rbot [heading Downward] glyph-block-export mShapeBodyImpl diff --git a/packages/font-glyphs/src/letter/latin/lower-n.ptl b/packages/font-glyphs/src/letter/latin/lower-n.ptl index 5201ac705..4aa1a2500 100644 --- a/packages/font-glyphs/src/letter/latin/lower-n.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-n.ptl @@ -270,7 +270,7 @@ glyph-block Letter-Latin-Lower-N : begin include : df.markSet.e local dfSub : df.slice 3 2 - include : Body XH dfSub.leftSB dfSub.rightSB (XH - SmallArchDepthB - 0.1) dfSub.mvs + include : Body XH dfSub.leftSB dfSub.rightSB (XH - SmallArchDepthB - TINY) dfSub.mvs if sLT : include : sLT dfSub XH if sLB : include : sLB dfSub 0 diff --git a/packages/font-glyphs/src/letter/latin/lower-r.ptl b/packages/font-glyphs/src/letter/latin/lower-r.ptl index 2a641c01b..79ab29123 100644 --- a/packages/font-glyphs/src/letter/latin/lower-r.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-r.ptl @@ -58,7 +58,7 @@ glyph-block Letter-Latin-Lower-R : begin [Just rStraight] : mix (xBar - fine) rHookX (0.54 + 2 * TanSlope * strokeBar / Width) [Just rSerifed] : mix (xBar - fine) rHookX (0.59 + 2 * TanSlope * strokeBar / Width) [Just rNarrow] : mix df.width rHookX : Math.max 1.01 (5 / 4 * [mix 1 dfR.div 2]) - [Just rNarrowSerifed] : Math.min ([mix df.width rHookX df.div] - 0.1) : xBar + RHook * 1.25 * df.div + [Just rNarrowSerifed] : Math.min ([mix df.width rHookX df.div] - TINY) : xBar + RHook * 1.25 * df.div [Just rCornerHooked] : rHookX - [HSwToV : 0.5 * strokeBar] [Just rCornerHookedSerifed] : rHookX - [HSwToV : 0.5 * strokeBar] [Just rEarless] : mix (xBar - [HSwToV strokeBar]) rHookX 0.5 @@ -71,7 +71,7 @@ glyph-block Letter-Latin-Lower-R : begin export : local rHookY : RHook * rHookMultiplier + stroke * rHookSwMultiplier export : local rHookXN : match mode [Just rNarrowSerifed] : mix df.width rHookX df.div - [Just rNarrow] : xArchMiddle + 0.1 + [Just rNarrow] : xArchMiddle + TINY __ rHookX export : define [setMarks doTopSerif top bottom] : glyph-proc diff --git a/packages/font-glyphs/src/letter/latin/lower-t.ptl b/packages/font-glyphs/src/letter/latin/lower-t.ptl index 4affdaf12..568d81c81 100644 --- a/packages/font-glyphs/src/letter/latin/lower-t.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-t.ptl @@ -287,7 +287,7 @@ glyph-block Letter-Latin-Lower-T : begin include : difference Style.Body df sym top 0 - MaskBelow (yCrossBar - Stroke - 0.1) + MaskBelow (yCrossBar - Stroke - TINY) include : dispiro widths.lhs diff --git a/packages/font-glyphs/src/letter/latin/lower-y.ptl b/packages/font-glyphs/src/letter/latin/lower-y.ptl index fec0bed12..54ca3125c 100644 --- a/packages/font-glyphs/src/letter/latin/lower-y.ptl +++ b/packages/font-glyphs/src/letter/latin/lower-y.ptl @@ -148,7 +148,7 @@ glyph-block Letter-Latin-Lower-Y : begin (bottomShape == BS-TURN) : list ConnectZ me.yshrink flat (me.yrstrokel - slabysize) bottom [widths.rhs] - curl [Math.min (me.yrstrokel - slabysize - 0.1) (me.yrstrokel - Stroke - yBottomJut)] bottom + curl [Math.min (me.yrstrokel - slabysize - TINY) (me.yrstrokel - Stroke - yBottomJut)] bottom true : list ConnectZ 1 quadControls 1 (1 - me.dpy2) 16 @@ -360,7 +360,7 @@ glyph-block Letter-Latin-Lower-Y : begin export : define [FlatHook y0 bottom] : begin local hd : FlatHookDepth [DivFrame 1] (9 / 8) - local xTerminal : Math.min (RightSB - hd.x - 0.1) : mix SB RightSB (1 / 5) + local xTerminal : Math.min (RightSB - hd.x - TINY) : mix SB RightSB (1 / 5) return : dispiro widths.rhs flat RightSB y0 [heading Downward] diff --git a/packages/font-glyphs/src/letter/latin/o.ptl b/packages/font-glyphs/src/letter/latin/o.ptl index c14dd89df..d486f1a15 100644 --- a/packages/font-glyphs/src/letter/latin/o.ptl +++ b/packages/font-glyphs/src/letter/latin/o.ptl @@ -210,9 +210,9 @@ glyph-block Letter-Latin-O : begin include : dispiro widths.rhs flat (SB + OX) (XH / 2) [heading Upward] - curl (SB + OX) (XH - [Math.min (XH / 2 - 0.1) SmallArchDepthA]) + curl (SB + OX) (XH - [Math.min (XH / 2 - TINY) SmallArchDepthA]) arch.rhs XH - flat (RightSB - OX) (XH - [Math.min (XH / 2 - 0.1) SmallArchDepthB]) + flat (RightSB - OX) (XH - [Math.min (XH / 2 - TINY) SmallArchDepthB]) curl (RightSB - OX) (XH / 2) [heading Downward] create-glyph 'olowerhalf' 0x1D17 : glyph-proc @@ -220,9 +220,9 @@ glyph-block Letter-Latin-O : begin include : dispiro widths.lhs flat (SB + OX) (XH / 2) [heading Downward] - curl (SB + OX) [Math.min (XH / 2 - 0.1) SmallArchDepthB] + curl (SB + OX) [Math.min (XH / 2 - TINY) SmallArchDepthB] arch.lhs 0 - flat (RightSB - OX) [Math.min (XH / 2 - 0.1) SmallArchDepthA] + flat (RightSB - OX) [Math.min (XH / 2 - TINY) SmallArchDepthA] curl (RightSB - OX) (XH / 2) [heading Upward] create-glyph 'oWithLightCentralizationStroke' : glyph-proc diff --git a/packages/font-glyphs/src/letter/latin/upper-b.ptl b/packages/font-glyphs/src/letter/latin/upper-b.ptl index 60c165916..d77b87478 100644 --- a/packages/font-glyphs/src/letter/latin/upper-b.ptl +++ b/packages/font-glyphs/src/letter/latin/upper-b.ptl @@ -70,7 +70,7 @@ glyph-block Letter-Latin-Upper-B : begin define [BShapeMask] : with-params [top [stroke : AdviceStroke2 2 3 top] [barPos BBarPos] [topArcShift 0] [topArcInnerShift 0]] : glyph-proc include : BShapeArcsT spiro-outline top - offset -- 0.1 + offset -- 1 stroke -- stroke barPos -- barPos topArcShift -- topArcShift diff --git a/packages/font-glyphs/src/letter/latin/upper-p.ptl b/packages/font-glyphs/src/letter/latin/upper-p.ptl index 29920b4a5..f393294ee 100644 --- a/packages/font-glyphs/src/letter/latin/upper-p.ptl +++ b/packages/font-glyphs/src/letter/latin/upper-p.ptl @@ -31,7 +31,7 @@ glyph-block Letter-Latin-Upper-P : begin hookstart (bowlTop - O) g4 (right - overshoot) turn arcvh - flat [arch.adjust-x.bot [Math.max (endX + 0.01 + sw / 2 * TanSlope) df.middle] (sw -- sw * 0.5)] bowlBottom + flat [arch.adjust-x.bot [Math.max (endX + TINY + sw / 2 * TanSlope) df.middle] (sw -- sw * 0.5)] bowlBottom curl endX bowlBottom [heading Leftward] define [PShapeOutlineKnots top df mul bp overshoot sw offset] : begin @@ -128,8 +128,8 @@ glyph-block Letter-Latin-Upper-P : begin HSerif.rb (df.leftSB * mul + [HSwToV : 0.5 * sw]) 0 MidJutSide sw set PShape.OpenGap : function [] : with-params [top [df [DivFrame 1]] [bot 0] [mul PShape.defaultMul] [bp PShape.BarPos] [sw df.mvs]] : VBar.l df.leftSB * mul + [HSwToV sw] - Math.min ([PBarPosY top sw bp] - 0.5 * sw - 0.1) bot - Math.max ([PBarPosY top sw bp] + 0.5 * sw + 0.1) [mix top [PBarPosY top sw bp] 0.5] + Math.min ([PBarPosY top sw bp] - 0.5 * sw - TINY) bot + Math.max ([PBarPosY top sw bp] + 0.5 * sw + TINY) [mix top [PBarPosY top sw bp] 0.5] 0.2 * (df.rightSB - df.leftSB) * ([AdviceStroke 5] / Stroke) set RevPShape.SlabMotion : function [top df sw mul] : glyph-proc @@ -146,8 +146,8 @@ glyph-block Letter-Latin-Upper-P : begin HSerif.lb (df.width - df.leftSB * mul - [HSwToV : 0.5 * sw]) 0 MidJutSide sw set RevPShape.OpenGap : function [] : with-params [top [df [DivFrame 1]] [bot 0] [mul PShape.defaultMul] [bp PShape.BarPos] [sw df.mvs]] : VBar.r df.width - df.leftSB * mul - [HSwToV sw] - Math.min ([PBarPosY top sw bp] - 0.5 * sw - 0.1) bot - Math.max ([PBarPosY top sw bp] + 0.5 * sw + 0.1) [mix top [PBarPosY top sw bp] 0.5] + Math.min ([PBarPosY top sw bp] - 0.5 * sw - TINY) bot + Math.max ([PBarPosY top sw bp] + 0.5 * sw + TINY) [mix top [PBarPosY top sw bp] 0.5] 0.2 * (df.rightSB - df.leftSB) * ([AdviceStroke 5] / Stroke) define PConfig : object diff --git a/packages/font-glyphs/src/letter/latin/w.ptl b/packages/font-glyphs/src/letter/latin/w.ptl index 39ee17e78..e9fc35241 100644 --- a/packages/font-glyphs/src/letter/latin/w.ptl +++ b/packages/font-glyphs/src/letter/latin/w.ptl @@ -264,7 +264,7 @@ glyph-block Letter-Latin-W : begin include : dispiro widths.rhs flat df.rightSB (top - TailY - HalfStroke - O) [heading Downward] - curl df.rightSB [Math.min (0.8 * top) (top - TailY - HalfStroke - 0.1)] [heading Downward] + curl df.rightSB [Math.min (0.8 * top) (top - TailY - HalfStroke - TINY)] [heading Downward] straight.down.end df.rightSB 0 [widths.rhs.heading [AdviceStroke 4 df.div] Downward] include : VerticalHook.r df.rightSB (top - TailY - HalfStroke - O) TailX (-TailY) diff --git a/packages/font-glyphs/src/letter/latin/z.ptl b/packages/font-glyphs/src/letter/latin/z.ptl index 14865f2bb..1eab29a61 100644 --- a/packages/font-glyphs/src/letter/latin/z.ptl +++ b/packages/font-glyphs/src/letter/latin/z.ptl @@ -84,8 +84,8 @@ glyph-block Letter-Latin-Z : begin corner SB 0 corner (-Width) 0 corner (-Width) (2 * top) - corner (RightSB - xDiagWidth + 0.1) (2 * top) - corner (RightSB - xDiagWidth + 0.1) (top - yFootHeight) + corner (RightSB - xDiagWidth + TINY) (2 * top) + corner (RightSB - xDiagWidth + TINY) (top - yFootHeight) dispiro flat (SB + OX) (top - yHookDepth) [widths.rhs.heading hookTerminalWidth Upward] curl (SB + OX) (top - yHookDepth + yHookStraightDepth) [heading Upward] @@ -120,8 +120,8 @@ glyph-block Letter-Latin-Z : begin ([Just MODE-ZDESC] || [Just MODE-ZSWASH]) : no-shape __ : intersection spiro-outline - corner (SB + xDiagWidth - 0.1) yFootHeight - corner (SB + xDiagWidth - 0.1) (-top) + corner (SB + xDiagWidth - TINY) yFootHeight + corner (SB + xDiagWidth - TINY) (-top) corner (2 * Width) (-top) corner (2 * Width) (top) corner RightSB top diff --git a/packages/font-glyphs/src/letter/shared.ptl b/packages/font-glyphs/src/letter/shared.ptl index 3941dc80d..34822fa32 100644 --- a/packages/font-glyphs/src/letter/shared.ptl +++ b/packages/font-glyphs/src/letter/shared.ptl @@ -278,7 +278,7 @@ glyph-block Letter-Shared-Shapes : begin export : define [arcStart] : with-params [ [top XH] [left SB] [right RightSB] [sw Stroke] [fine ShoulderFine] [ada SmallArchDepthA] [adb SmallArchDepthB] - [ystart (top - ada - 0.01)] + [ystart (top - ada - TINY)] ] : begin local xstart : left + (sw - fine) * HVContrast return : list @@ -289,7 +289,7 @@ glyph-block Letter-Shared-Shapes : begin export : define [arcEnd] : with-params [ [bot 0] [left SB] [right RightSB] [sw Stroke] [fine ShoulderFine] [ada SmallArchDepthA] [adb SmallArchDepthB] - [yend (bot + ada + 0.01)] + [yend (bot + ada + TINY)] ] : begin local xend : left + (sw - fine) * HVContrast return : list @@ -303,14 +303,14 @@ glyph-block Letter-Shared-Shapes : begin ] : begin return : dispiro widths.lhs fine - flat (left + (sw - fine) * HVContrast) (top - ada - 0.01) + flat (left + (sw - fine) * HVContrast) (top - ada - TINY) curl (left + (sw - fine) * HVContrast) (0 + adb) arch.lhs 0 (sw -- sw) (swBefore -- fine) flat (right - OX) (0 + ada) curl (right - OX) (top - adb) arch.lhs top (sw -- sw) (swAfter -- fine) flat (left + (sw - fine) * HVContrast) (top - ada) [widths.lhs fine] - curl (left + (sw - fine) * HVContrast) (top - ada - 0.01) + curl (left + (sw - fine) * HVContrast) (top - ada - TINY) export : define [toothless] : with-params [ [top XH] [left SB] [right RightSB] [rise SHook] [sw Stroke] [fine ShoulderFine] @@ -325,7 +325,7 @@ glyph-block Letter-Shared-Shapes : begin curl (right - OX) (top - adb) arch.lhs top (sw -- sw) (swAfter -- fine) flat (left + (sw - fine) * HVContrast) (top - ada) [widths.lhs fine] - curl (left + (sw - fine) * HVContrast) (top - ada - 0.01) [widths.lhs fine] + curl (left + (sw - fine) * HVContrast) (top - ada - TINY) [widths.lhs fine] export : define [rounded] : with-params [ [top XH] [left SB] [right RightSB] [yTerminal CAP] [sw Stroke] [fine ShoulderFine] @@ -333,12 +333,12 @@ glyph-block Letter-Shared-Shapes : begin ] : begin return : dispiro flat left yTerminal [widths.lhs.heading sw Downward] - curl left [Math.min adb (yTerminal - 0.01)] + curl left [Math.min adb (yTerminal - TINY)] arch.lhs 0 (sw -- sw) flat (right - OX) (0 + ada) curl (right - OX) (top - adb) arch.lhs top (sw -- sw) (swAfter -- fine) - flat (left + (sw - fine) * HVContrast) (top - ada + 0.01) [widths.lhs fine] + flat (left + (sw - fine) * HVContrast) (top - ada + TINY) [widths.lhs fine] curl (left + (sw - fine) * HVContrast) (top - ada) [widths.lhs fine] export : define [toothlessTop] : with-params [ @@ -346,7 +346,7 @@ glyph-block Letter-Shared-Shapes : begin [mBlend : Math.sqrt (1 / 2)] [ada SmallArchDepthA] [adb SmallArchDepthB] ] : begin return : dispiro - flat (left + (sw - fine) * HVContrast) (top - ada - 0.01) [widths.lhs fine] + flat (left + (sw - fine) * HVContrast) (top - ada - TINY) [widths.lhs fine] curl (left + (sw - fine) * HVContrast) (0 + adb) [widths.lhs fine] arch.lhs 0 (sw -- sw) (swBefore -- fine) flat (right - OX) (0 + ada) @@ -361,13 +361,13 @@ glyph-block Letter-Shared-Shapes : begin [fine ShoulderFine] [ada SmallArchDepthA] [adb SmallArchDepthB] ] : begin return : dispiro - flat (left + (sw - fine) * HVContrast) (top - ada - 0.01) [widths.lhs fine] + flat (left + (sw - fine) * HVContrast) (top - ada - TINY) [widths.lhs fine] curl (left + (sw - fine) * HVContrast) (0 + adb) [widths.lhs fine] arch.lhs 0 (sw -- sw) (swBefore -- fine) flat (right - OX) (0 + ada) curl (right - OX) (top - adb) arch.lhs top (sw -- sw) - flat left [Math.max (yTerminal + 0.01 - TanSlope * Stroke) (top - ada)] + flat left [Math.max (yTerminal + TINY - TanSlope * Stroke) (top - ada)] curl left yTerminal [widths.lhs.heading sw Downward] glyph-block-export : OBarRight @@ -376,7 +376,7 @@ glyph-block Letter-Shared-Shapes : begin export : define [arcStart] : with-params [ [top XH] [left SB] [right RightSB] [sw Stroke] [fine ShoulderFine] [ada SmallArchDepthA] [adb SmallArchDepthB] - [ystart (top - ada - 0.01)] + [ystart (top - ada - TINY)] ] : begin local xstart : right - (sw - fine) * HVContrast return : list @@ -387,7 +387,7 @@ glyph-block Letter-Shared-Shapes : begin export : define [arcEnd] : with-params [ [bot 0] [left SB] [right RightSB] [sw Stroke] [fine ShoulderFine] [ada SmallArchDepthA] [adb SmallArchDepthB] - [yend (bot + ada + 0.01)] + [yend (bot + ada + TINY)] ] : begin local xend : right - (sw - fine) * HVContrast return : list @@ -775,7 +775,7 @@ glyph-block Letter-Shared-Shapes : begin include : dispiro widths.lhs sw flat left ybegin [heading Downward] - curl left [Math.min (ybegin - 0.01) adb] + curl left [Math.min (ybegin - TINY) adb] arcvh g4 [mix left right 0.5] bottom [heading Rightward] archv @@ -791,12 +791,12 @@ glyph-block Letter-Shared-Shapes : begin local hdY : if (yDepth < 0) (-hd.y) hd.y local y2 : if (yDepth > 0) - Math.min (y - yDepth + hd.y - 0.25 * sw) (y - 0.01) - Math.max (y - yDepth - hd.y + 0.25 * sw) (y + 0.01) + Math.min (y - yDepth + hd.y - 0.25 * sw) (y - TINY) + Math.max (y - yDepth - hd.y + 0.25 * sw) (y + TINY) local x3 : if (xDepth > 0) - Math.min (x + xDepth - 0.01) (x + hd.x - [HSwToV : 0.25 * sw]) - Math.max (x + xDepth + 0.01) (x - hd.x + [HSwToV : 0.25 * sw]) + Math.min (x + xDepth - TINY) (x + hd.x - [HSwToV : 0.25 * sw]) + Math.max (x + xDepth + TINY) (x - hd.x + [HSwToV : 0.25 * sw]) dispiro [widths.center sw] flat x (y + yExtension) [heading : if (yDepth > 0) Downward Upward] diff --git a/packages/font-glyphs/src/meta/aesthetics.ptl b/packages/font-glyphs/src/meta/aesthetics.ptl index 192770c6c..4b248af3f 100644 --- a/packages/font-glyphs/src/meta/aesthetics.ptl +++ b/packages/font-glyphs/src/meta/aesthetics.ptl @@ -184,6 +184,9 @@ export : define [calculateMetrics para] : begin define [AdviceGlottalStopArchDepth y sign] : begin return : ((y - Stroke) * 0.24 + Stroke * 0.625) + sign * TanSlope * SmoothAdjust + define VERY-FAR : UPM * 16 + define TINY : 1 / 128 + return [object DesignParameters UPM HalfUPM Width SB CAP XH Ascender Descender Contrast SymbolMid ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop @@ -199,7 +202,7 @@ export : define [calculateMetrics para] : begin AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke ShoulderFine _SuperXY AdviceGlottalStopArchDepth StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust MidJutSide MidJutCenter YSmoothMidR YSmoothMidL - HSwToV NarrowUnicodeT WideUnicodeT] + HSwToV NarrowUnicodeT WideUnicodeT VERY-FAR TINY] export : define [setFontMetrics para metrics fm] : begin define [object CAP Descender XH Width SymbolMid] metrics diff --git a/packages/font-glyphs/src/meta/macros.ptl b/packages/font-glyphs/src/meta/macros.ptl index fc5947ff9..23dab4d53 100644 --- a/packages/font-glyphs/src/meta/macros.ptl +++ b/packages/font-glyphs/src/meta/macros.ptl @@ -197,10 +197,10 @@ define-macro glyph-block-import : syntax-rules RingStrokeAt DotStrokeAt Circle Ellipse OShapeT OShape OShapeOutline OShapeFlatTB HSerif VSerif NeedSlab NeedNotItalic HBar HOverlayBar VBar FlatSlashShape hookstart hookend arch Ungizmo Regizmo FlipAround ScaleAround Realign ForceUpright DiagCor NameUni - PointingTo with-transform with-outlined remove-holes clear-geometry clear-anchors - AsRadical ExtLineCenter ExtLineLhs ExtLineRhs DiagCorDs HCrossBar VERY-FAR MaskAbove - MaskBelow MaskLeft MaskRight HalfRectTriangle MaskAboveLine MaskBelowLine MaskLeftLine - MaskRightLine DotVariants WithDotVariants] + PointingTo with-transform with-outlined remove-holes radicalize clear-geometry + clear-anchors ExtLineCenter ExtLineLhs ExtLineRhs DiagCorDs HCrossBar MaskAbove + MaskBelow MaskLeft MaskRight HalfRectTriangle MaskAboveLine MaskBelowLine + MaskLeftLine MaskRightLine DotVariants WithDotVariants] define vartiableFilter : if externEnv.$glyphBlockVariableUsage$ lambda [x] externEnv.$glyphBlockVariableUsage$.(x) @@ -266,18 +266,18 @@ define-macro glyph-block : syntax-rules define metricImports `[DesignParameters UPM HalfUPM Width SB CAP XH Ascender Descender Contrast SymbolMid ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop BgOpBot Italify Upright Scale Translate ApparentTranslate Rotate - GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward - O OX OXHook Hook AHook SHook RHook JHook HookX TailX TailY - ArchDepth SmallArchDepth Stroke DotSize PeriodSize HBarPos OverlayPos LongJut Jut VJut - VJutStroke AccentStackOffset AccentWidth AccentClearance AccentHeight CThin CThinB SLAB - IBalance IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance - RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 - EssUpper EssLower EssQuestion HalfStroke RightSB Middle DotRadius PeriodRadius SideJut - ArchDepthA ArchDepthB SmallArchDepthA SmallArchDepthB CorrectionOMidX CorrectionOMidS - AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke - ShoulderFine _SuperXY AdviceGlottalStopArchDepth - StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust MidJutSide MidJutCenter - compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV NarrowUnicodeT WideUnicodeT] + GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward O OX OXHook Hook + AHook SHook RHook JHook HookX TailX TailY ArchDepth SmallArchDepth Stroke DotSize + PeriodSize HBarPos OverlayPos LongJut Jut VJut VJutStroke AccentStackOffset AccentWidth + AccentClearance AccentHeight CThin CThinB SLAB IBalance IBalance2 JBalance JBalance2 + TBalance TBalance2 RBalance RBalance2 FBalance OneBalance WideWidth0 WideWidth1 + WideWidth2 WideWidth3 WideWidth4 EssUpper EssLower EssQuestion HalfStroke RightSB + Middle DotRadius PeriodRadius SideJut ArchDepthA ArchDepthB SmallArchDepthA + SmallArchDepthB CorrectionOMidX CorrectionOMidS AdviceStroke AdviceStroke2 + OverlayStroke OperatorStroke GeometryStroke ShoulderFine _SuperXY + AdviceGlottalStopArchDepth StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust + MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV + NarrowUnicodeT WideUnicodeT VERY-FAR TINY] define spiroFnImports `[g4 g2 corner flat curl close end straight widths disable-contrast heading unimportant important alsoThru alsoThruThem bezControls quadControls archv arcvh dispiro spiro-outline CursiveBuilder] diff --git a/packages/font-glyphs/src/number/3.ptl b/packages/font-glyphs/src/number/3.ptl index 116c36813..d0b9f6391 100644 --- a/packages/font-glyphs/src/number/3.ptl +++ b/packages/font-glyphs/src/number/3.ptl @@ -21,12 +21,12 @@ glyph-block Digits-Three : begin g4 (SB + offset - O) (top - Hook) hookstart (top - offset - O) (sw -- sw) g4 (RightSB - offset) [YSmoothMidR (top - offset - O) (barcenter - sw / 2) ArchDepthA ArchDepthB] - flat (xMid + 0.01) (barcenter - (fine - sw / 2)) [widths.rhs.heading fine Leftward] + flat (xMid + TINY) (barcenter - (fine - sw / 2)) [widths.rhs.heading fine Leftward] curl xMid (barcenter - (fine - sw / 2)) [heading Leftward] include : sink widths.rhs fine flat xMid (barcenter + (fine - sw / 2)) [heading Rightward] - curl (xMid + 0.01) (barcenter + (fine - sw / 2)) [heading Rightward] + curl (xMid + TINY) (barcenter + (fine - sw / 2)) [heading Rightward] g4 (RightSB - offset - O * 2) [YSmoothMidR (barcenter + sw / 2) (offset + O) ArchDepthA ArchDepthB] [widths.rhs sw] hookend (offset + O) (sw -- sw) g4 (SB + offset + O) Hook diff --git a/packages/font-glyphs/src/number/5.ptl b/packages/font-glyphs/src/number/5.ptl index 02b0757f1..a776efae9 100644 --- a/packages/font-glyphs/src/number/5.ptl +++ b/packages/font-glyphs/src/number/5.ptl @@ -13,7 +13,7 @@ glyph-block Digits-Five : begin define [FiveFlatStroke xLeft archTop pShapeHeight sw] : dispiro widths.rhs sw flat (xLeft + [HSwToV sw]) archTop - curl [Math.max (xLeft + 0.01) [arch.adjust-x.top Middle sw]] archTop + curl [Math.max (xLeft + TINY) [arch.adjust-x.top Middle sw]] archTop archv g4 (RightSB - OX) [YSmoothMidR archTop 0 ArchDepthA ArchDepthB] hookend O (sw -- sw) diff --git a/packages/font-glyphs/src/number/6.ptl b/packages/font-glyphs/src/number/6.ptl index 6af67da65..ed45bd67f 100644 --- a/packages/font-glyphs/src/number/6.ptl +++ b/packages/font-glyphs/src/number/6.ptl @@ -15,9 +15,9 @@ glyph-block Digits-Six : begin local ymiddlea : (oTop - SmallArchDepthA + SmallArchDepthB) / 2 local ymiddleb : (oTop - SmallArchDepthB + SmallArchDepthA) / 2 include : dispiro - widths.rhs ShoulderFine + widths.rhs (ShoulderFine - TINY) g4 (SB + OX + [HSwToV (Stroke - ShoulderFine)]) ymiddlea - arch.rhs oTop (swBefore -- ShoulderFine) + arch.rhs oTop (swBefore -- (ShoulderFine - TINY)) g4.down.mid (RightSB - OX) ymiddleb arch.rhs 0 g4.up.mid (SB + OX) ymiddlea @@ -26,7 +26,7 @@ glyph-block Digits-Six : begin glyph-block-export ClosedContourSixShape define [ClosedContourSixShape top] : glyph-proc - local oTop : Math.max (2 * SmallArchDepth + 0.1) (top * 0.55 + HalfStroke) + local oTop : Math.max (2 * SmallArchDepth + TINY) (top * 0.55 + HalfStroke) include : dispiro widths.rhs ShoulderFine straight.up.start (SB + OX + [HSwToV (Stroke - ShoulderFine)]) (oTop - SmallArchDepthA) @@ -54,9 +54,9 @@ glyph-block Digits-Six : begin include : intersection Rect charTop (-charTop) (-Width) (2 * Width) dispiro - widths.rhs ShoulderFine + widths.rhs (ShoulderFine - TINY) g4.up.mid (SB + bbd + OX + [HSwToV (sw - ShoulderFine)]) ymiddlea - arch.rhs oTop (sw -- sw) (swBefore -- ShoulderFine) + arch.rhs oTop (sw -- sw) (swBefore -- (ShoulderFine - TINY)) g4.down.mid (RightSB - OX) ymiddleb arch.rhs 0 (sw -- sw) g4.up.mid (SB + bbd + OX) ymiddlea diff --git a/packages/font-glyphs/src/symbol/arrow.ptl b/packages/font-glyphs/src/symbol/arrow.ptl index 2563ff5f7..a8d436d44 100644 --- a/packages/font-glyphs/src/symbol/arrow.ptl +++ b/packages/font-glyphs/src/symbol/arrow.ptl @@ -59,7 +59,7 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1 local p : (mag - o - halfSw * [fallback w 1.1]) / mag dispiro widths.center (halfSw * 2) - g4 (mag - [Math.abs s] / 2 - 0.1) s + g4 (mag - [Math.abs s] / 2 - TINY) s g4 (mag - [Math.abs s] / 2) s archv g4 (mag - O) (s / 2) diff --git a/packages/font-glyphs/src/symbol/letter.ptl b/packages/font-glyphs/src/symbol/letter.ptl index 556043a3f..9f3cf30f5 100644 --- a/packages/font-glyphs/src/symbol/letter.ptl +++ b/packages/font-glyphs/src/symbol/letter.ptl @@ -2,7 +2,6 @@ $$include '../meta/macros.ptl' -import [TransformedGeometry ContourSetGeometry] from "@iosevka/geometry" import [Point] from "@iosevka/geometry/point" import [Box] from "@iosevka/geometry/box" import [Transform] from "@iosevka/geometry/transform" @@ -271,7 +270,7 @@ glyph-block Symbol-Letter : begin include : intersection [MaskAbove 0] : dispiro [widths.rhs] flat xStart CAP - curl [Math.max (xStart + 0.01) (xVertBar - hd.x)] CAP + curl [Math.max (xStart + TINY) (xVertBar - hd.x)] CAP archv flat xVertBar (CAP - hd.y) curl xVertBar yBranch diff --git a/packages/font-glyphs/src/symbol/math/not-glyph-fn.ptl b/packages/font-glyphs/src/symbol/math/not-glyph-fn.ptl index 583a377ef..84005f963 100644 --- a/packages/font-glyphs/src/symbol/math/not-glyph-fn.ptl +++ b/packages/font-glyphs/src/symbol/math/not-glyph-fn.ptl @@ -28,7 +28,7 @@ glyph-block NotGlyphFn : begin lambda [t b l r sw sh] : begin local slashBarName ".NotGlyphSlash{\(l)}{\(r)}{\(t)}{\(b)}{\(sw)}" if [not : query-glyph slashBarName] : begin - create-glyph slashBarName : AsRadical : dispiro + create-glyph slashBarName : dispiro widths.center sw flat l b curl r t diff --git a/packages/font-glyphs/src/symbol/math/relation.ptl b/packages/font-glyphs/src/symbol/math/relation.ptl index c501dc379..2c7ef874a 100644 --- a/packages/font-glyphs/src/symbol/math/relation.ptl +++ b/packages/font-glyphs/src/symbol/math/relation.ptl @@ -485,10 +485,10 @@ glyph-block Symbol-Math-Relation-Inequality : begin create-glyph 'normalSupersetOf' 0x22B3 : glyph-proc include : NormalSupersetShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB - create-glyph 'lessEqUpper' : AsRadical : LessShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB - create-glyph 'greaterEqUpper' : AsRadical : GreaterShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB - create-glyph 'normalSubsetUpper' : AsRadical : NormalSubsetShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB - create-glyph 'normalSupersetUpper' : AsRadical : NormalSupersetShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB + create-glyph 'lessEqUpper' : LessShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB + create-glyph 'greaterEqUpper' : GreaterShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB + create-glyph 'normalSubsetUpper' : NormalSubsetShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB + create-glyph 'normalSupersetUpper' : NormalSupersetShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB derive-composites 'less.narrow' null 'lessEqUpper' [ApparentTranslate 0 (-lessEqDist)] derive-composites 'lessEq' 0x2264 'lessEqUpper' 'eqLower' @@ -547,8 +547,8 @@ glyph-block Symbol-Math-Relation-Inequality : begin select-variant 'eq.at-lteq.lig2' select-variant 'eq.at-gteq.lig2' - create-glyph 'lessEqEqUpper' : AsRadical : LessShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW - create-glyph 'greaterEqEqUpper' : AsRadical : GreaterShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW + create-glyph 'lessEqEqUpper' : LessShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW + create-glyph 'greaterEqEqUpper' : GreaterShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW derive-composites 'lessEqEq' 0x2266 'lessEqEqUpper' 'eqEqLower' derive-composites 'greaterEqEq' 0x2267 'greaterEqEqUpper' 'eqEqLower' @@ -642,12 +642,12 @@ glyph-block Symbol-Math-Relation-Precedes-Succeeds : begin include : SucceedsShapeA top bot l r [fallback s OperatorStroke] CThin include : SucceedsShapeB top bot l r [fallback s OperatorStroke] CThin - create-glyph 'precedes' 0x227a : AsRadical : PrecedesShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB - create-glyph 'succeeds' 0x227b : AsRadical : SucceedsShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB - create-glyph 'precedesEqUpper' : AsRadical : PrecedesShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB - create-glyph 'precedesEqEqUpper' : AsRadical : PrecedesShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW - create-glyph 'succeedsEqUpper' : AsRadical : SucceedsShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB - create-glyph 'succeedsEqEqUpper' : AsRadical : SucceedsShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW + create-glyph 'precedes' 0x227a : PrecedesShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB + create-glyph 'succeeds' 0x227b : SucceedsShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB + create-glyph 'precedesEqUpper' : PrecedesShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB + create-glyph 'precedesEqEqUpper' : PrecedesShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW + create-glyph 'succeedsEqUpper' : SucceedsShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) SB RightSB + create-glyph 'succeedsEqEqUpper' : SucceedsShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist * 1.75) SB RightSB lesslessSW derive-composites 'precedes.narrow' null 'precedesEqUpper' [ApparentTranslate 0 (-lessEqDist)] derive-composites 'precedesEq' 0x2AAF 'precedesEqUpper' 'eqLower' @@ -706,9 +706,9 @@ glyph-block Symbol-Math-Relation-Precedes-Succeeds-Under-Relation : begin include : PrecedesUnderRelationShape t b l r s include : FlipAround [mix l r 0.5] [mix t b 0.5] - create-glyph 'precedesUnderRelation' 0x22B0 : AsRadical + create-glyph 'precedesUnderRelation' 0x22B0 PrecedesUnderRelationShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB OperatorStroke - create-glyph 'succeedsUnderRelation' 0x22B1 : AsRadical + create-glyph 'succeedsUnderRelation' 0x22B1 SucceedsUnderRelationShape (SymbolMid + dH) (SymbolMid - dH) SB RightSB OperatorStroke glyph-block Symbol-Math-Relation-Subset : begin @@ -755,9 +755,9 @@ glyph-block Symbol-Math-Relation-Subset : begin turned 'supst' 0x2283 'subst' Middle SymbolMid turned 'doubleSupst' 0x22D1 'doubleSubst' Middle SymbolMid - create-glyph 'substBarUpper' : AsRadical + create-glyph 'substBarUpper' SubsetShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) - create-glyph 'supstBarUpper' : AsRadical + create-glyph 'supstBarUpper' SupsetShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) derive-composites 'substBar' 0x2286 'substBarUpper' 'eqLower' @@ -779,7 +779,7 @@ glyph-block Symbol-Math-Relation-Subset : begin define sw : Math.min OperatorStroke : AdviceStroke2 2 4 (2 * dHElem) include : SubsetShape (SymbolMid + dHElem) (SymbolMid - dHElem) (sw -- sw) include : intersection - SubsetMaskShape (SymbolMid + dHElem) (SymbolMid - dHElem) (sw -- sw) (offset -- 0.1) + SubsetMaskShape (SymbolMid + dHElem) (SymbolMid - dHElem) (sw -- sw) (offset -- 1) union HBar.m SB RightSB (SymbolMid - (dHElem / 3) + (sw / 6)) sw HBar.m SB RightSB (SymbolMid + (dHElem / 3) - (sw / 6)) sw @@ -873,9 +873,9 @@ glyph-block Symbol-Math-Relation-Precedes-Succeeds-Prefix-Suffix : begin create-glyph 'suffix' 0x2290 SuffixShape (SymbolMid + dHSubstSimple) (SymbolMid - dHSubstSimple) - create-glyph 'prefixBarUpper' : AsRadical + create-glyph 'prefixBarUpper' PrefixShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) - create-glyph 'suffixBarUpper' : AsRadical + create-glyph 'suffixBarUpper' SuffixShape (SymbolMid + dSH + lessEqDist) (SymbolMid - dSH + lessEqDist) derive-composites 'prefixBar' 0x2291 'prefixBarUpper' 'eqLower' @@ -930,20 +930,20 @@ glyph-block Symbol-Math-Relation-Addon-Glyphs : begin flat (Middle + dist) (symbolBottom - dist + swo) [heading Downward] flat (Middle - dist) (symbolBottom - dist - swo) [heading Downward] - create-glyph 'eqLower' : AsRadical : HBar.m SB RightSB (SymbolMid - dSH - lessEqDist) OperatorStroke - create-glyph 'eqLower2' : AsRadical : HBar.m SB RightSB (SymbolMid - dSH - 2 * lessEqDist) OperatorStroke - create-glyph 'eqBarNegatedLower' : AsRadical : union [refer-glyph 'eqLower'] [BarNegator (SymbolMid - dSH) lessEqDist] - create-glyph 'symLower' : AsRadical : symWave (SymbolMid - dSH - lessEqDist) 1 - create-glyph 'symBarNegatedLower' : AsRadical : union [refer-glyph 'symLower'] [BarNegator (SymbolMid - dSH) lessEqDist] + create-glyph 'eqLower' : HBar.m SB RightSB (SymbolMid - dSH - lessEqDist) OperatorStroke + create-glyph 'eqLower2' : HBar.m SB RightSB (SymbolMid - dSH - 2 * lessEqDist) OperatorStroke + create-glyph 'eqBarNegatedLower' : union [refer-glyph 'eqLower'] [BarNegator (SymbolMid - dSH) lessEqDist] + create-glyph 'symLower' : symWave (SymbolMid - dSH - lessEqDist) 1 + create-glyph 'symBarNegatedLower' : union [refer-glyph 'symLower'] [BarNegator (SymbolMid - dSH) lessEqDist] - create-glyph 'eqEqLower' : AsRadical : union + create-glyph 'eqEqLower' : union HBar.m SB RightSB (SymbolMid - dSH + lessEqDist * 2 / 3) lesslessSW HBar.m SB RightSB (SymbolMid - dSH - lessEqDist) lesslessSW - create-glyph 'symSymLower' : AsRadical : union + create-glyph 'symSymLower' : union symWave (SymbolMid - dSH + lessEqDist * 2 / 3) 1 lesslessSW symWave (SymbolMid - dSH - lessEqDist) 1 lesslessSW - create-glyph 'symEqLower' : AsRadical : union + create-glyph 'symEqLower' : union symWave (SymbolMid - dSH + lessEqDist * 2 / 3) 1 lesslessSW HBar.m SB RightSB (SymbolMid - dSH - lessEqDist * 7 / 6) lesslessSW - create-glyph 'eqEqBarNegatedLower' : AsRadical : union [refer-glyph 'eqEqLower'] [EqEqBarNegation] - create-glyph 'symSymBarNegatedLower' : AsRadical : union [refer-glyph 'symSymLower'] [EqEqBarNegation] + create-glyph 'eqEqBarNegatedLower' : union [refer-glyph 'eqEqLower'] [EqEqBarNegation] + create-glyph 'symSymBarNegatedLower' : union [refer-glyph 'symSymLower'] [EqEqBarNegation] diff --git a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl index f1834e437..2750c4e20 100644 --- a/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/game-sprite.ptl @@ -273,13 +273,13 @@ glyph-block Symbol-Pictograph-Game-Sprite : for-width-kinds WideWidth4 include : difference spiro-outline corner right top - corner (midX + 0.01) top + corner (midX + TINY) top flat midX top archv.superness 2 g4 left midY arcvh.superness 2 curl midX bottom - corner (midX + 0.01) bottom + corner (midX + TINY) bottom corner right bottom spiro-outline corner right [mix top bottom 0.1] diff --git a/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl b/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl index 77b904451..71a4d29e6 100644 --- a/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl @@ -62,9 +62,9 @@ glyph-block Symbol-Pictograph-Stick-Figure : begin disable-contrast widths.center sw flat z1.x z1.y - curl [mix z1.x zc.x 0.001] [mix z1.y zc.y 0.001] + curl [mix z1.x zc.x TINY] [mix z1.y zc.y TINY] * innerKnots - flat [mix z2.x zc.x 0.001] [mix z2.y zc.y 0.001] + flat [mix z2.x zc.x TINY] [mix z2.y zc.y TINY] curl z2.x z2.y if cl : include : Circle.Outline.DotAt z1.x z1.y (sw / 2) diff --git a/packages/font-glyphs/src/symbol/punctuation/brackets.ptl b/packages/font-glyphs/src/symbol/punctuation/brackets.ptl index 810949d03..028a20c37 100644 --- a/packages/font-glyphs/src/symbol/punctuation/brackets.ptl +++ b/packages/font-glyphs/src/symbol/punctuation/brackets.ptl @@ -235,7 +235,7 @@ glyph-block Symbol-Punctuation-Brackets : begin define xTip : mix SB RightSB DesignParameters.braceOutside include : dispiro flat (xIns + [fallback ext 0]) top [widths.center.heading sw Leftward] - curl (xIns - 0.1) top [heading Leftward] + curl (xIns - TINY) top [heading Leftward] archv flat parenCenter (top - radius) [heading Downward] curl parenCenter (bottom + radius) [heading Downward] @@ -248,7 +248,7 @@ glyph-block Symbol-Punctuation-Brackets : begin define xTip : mix SB RightSB DesignParameters.braceOutside include : dispiro flat (xIns + [fallback ext 0]) bottom [widths.center.heading sw Leftward] - curl (xIns - 0.1) bottom [heading Leftward] + curl (xIns - TINY) bottom [heading Leftward] archv flat parenCenter (bottom + radius) [heading Upward] curl parenCenter (top - radius) [heading Upward] diff --git a/packages/font-glyphs/src/symbol/punctuation/other-phonetic.ptl b/packages/font-glyphs/src/symbol/punctuation/other-phonetic.ptl index 9a3a911b6..78cf01508 100644 --- a/packages/font-glyphs/src/symbol/punctuation/other-phonetic.ptl +++ b/packages/font-glyphs/src/symbol/punctuation/other-phonetic.ptl @@ -40,10 +40,10 @@ glyph-block Symbol-Other-Phonetic : begin foreach tone [range 4 downtill 0] : begin create-glyph ('tone' + tone) (0x2E5 + 4 - tone) : glyph-proc include : VBar.r toneMarkRight 0 CAP OperatorStroke - include : HBar.m toneMarkLeft (toneMarkRight - 0.1) [yOfTone tone] OperatorStroke + include : HBar.m toneMarkLeft (toneMarkRight - TINY) [yOfTone tone] OperatorStroke create-glyph ('toneSandhi' + tone) (0xA712 + 4 - tone) : glyph-proc include : VBar.l toneMarkLeft 0 CAP OperatorStroke - include : HBar.m (toneMarkLeft + 0.1) toneMarkRight [yOfTone tone] OperatorStroke + include : HBar.m (toneMarkLeft + TINY) toneMarkRight [yOfTone tone] OperatorStroke create-glyph ('toneNeutral' + tone) (0xA708 + 4 - tone) : glyph-proc include : VBar.r toneMarkRight 0 CAP OperatorStroke include : DotAt (toneMarkLeft + DotRadius) [yOfToneNeutral tone] DotRadius @@ -126,7 +126,7 @@ glyph-block Symbol-Other-Phonetic : begin foreach { name code a b pos } [items-of DepartingToneConfig] : begin create-glyph name code : glyph-proc include : VBar.l toneMarkLeft (CAP * a) (CAP * b) OperatorStroke - include : HBar.m (toneMarkLeft + 0.1) toneMarkRight [yOfToneDepart a b pos] OperatorStroke + include : HBar.m (toneMarkLeft + TINY) toneMarkRight [yOfToneDepart a b pos] OperatorStroke local EnteringToneConfig : list list 'endHighTone' 0x2FA 0.6 1 1.0 @@ -134,4 +134,4 @@ glyph-block Symbol-Other-Phonetic : begin foreach { name code a b pos } [items-of EnteringToneConfig] : begin create-glyph name code : glyph-proc include : VBar.r toneMarkRight (CAP * a) (CAP * b) OperatorStroke - include : HBar.m toneMarkLeft (toneMarkRight - 0.1) [yOfToneDepart a b pos] OperatorStroke + include : HBar.m toneMarkLeft (toneMarkRight - TINY) [yOfToneDepart a b pos] OperatorStroke diff --git a/packages/font-glyphs/src/symbol/punctuation/pilcrow.ptl b/packages/font-glyphs/src/symbol/punctuation/pilcrow.ptl index 4891ef83f..18babaaa4 100644 --- a/packages/font-glyphs/src/symbol/punctuation/pilcrow.ptl +++ b/packages/font-glyphs/src/symbol/punctuation/pilcrow.ptl @@ -23,11 +23,11 @@ glyph-block Symbol-Punctuation-Pilcrow : begin arcvh straight.right.end (Middle - sw / 4) (CAP * 0.5) [heading Rightward] spiro-outline - straight.left.start (Middle - sw / 4) (CAP - sw / 2 - 0.1) + straight.left.start (Middle - sw / 4) (CAP - sw / 2 - TINY) archv g4.down.mid (SB + sw / 2 + 0.2) [mix (CAP * 0.5) (CAP - sw / 2) 0.5] arcvh - straight.right.end (Middle - sw / 4) (CAP * 0.5 + 0.1) + straight.right.end (Middle - sw / 4) (CAP * 0.5 + TINY) create-forked-glyph 'pilcrow.high' : glyph-proc include : VBar.m (Middle + sw / 4) 0 CAP sw @@ -63,11 +63,11 @@ glyph-block Symbol-Punctuation-Pilcrow : begin flat (Middle - sw / 4) (PlusBot + sw / 2) [heading Rightward] curl (RightSB - sw / 4) (PlusBot + sw / 2) [heading Rightward] spiro-outline - straight.left.start (Middle - sw / 4) (PlusTop - sw / 2 - 0.1) [heading Leftward] + straight.left.start (Middle - sw / 4) (PlusTop - sw / 2 - TINY) [heading Leftward] archv - g4.down.mid (SB + sw / 2 + 0.1) SymbolMid [heading Downward] + g4.down.mid (SB + sw / 2 + TINY) SymbolMid [heading Downward] arcvh - straight.right.end (Middle - sw / 4) (PlusBot + sw / 2 + 0.1) [heading Rightward] + straight.right.end (Middle - sw / 4) (PlusBot + sw / 2 + TINY) [heading Rightward] include : VBar.m (Middle + sw / 4) PlusBot PlusTop sw include : VBar.m (RightSB - sw / 2) PlusBot PlusTop sw diff --git a/packages/font-glyphs/src/symbol/punctuation/section.ptl b/packages/font-glyphs/src/symbol/punctuation/section.ptl index 0847dbaaa..79624e306 100644 --- a/packages/font-glyphs/src/symbol/punctuation/section.ptl +++ b/packages/font-glyphs/src/symbol/punctuation/section.ptl @@ -28,8 +28,8 @@ glyph-block Symbol-Punctuation-Section : begin if (sink === dispiro) [list] : list corner 0 [mix bot top 2] corner Width [mix bot top 2] - corner Width (top - Hook - 0.1) - corner RightSB (top - Hook - 0.1) + corner Width (top - Hook - TINY) + corner RightSB (top - Hook - TINY) define [halfShape] : intersection [s dispiro 0] : union MaskAbove SymbolMid with-transform [FlipAround Middle SymbolMid] : s spiro-outline 0.1 diff --git a/packages/font-kits/src/boole-kit.mjs b/packages/font-kits/src/boole-kit.mjs index 0c35c08a8..630f43d49 100644 --- a/packages/font-kits/src/boole-kit.mjs +++ b/packages/font-kits/src/boole-kit.mjs @@ -17,10 +17,10 @@ class BooleImpl { const g1 = new Glyph(); g1.gizmo = forwardGizmo; g1.include(operand); - operandGeometries.push(new TransformedGeometry(backwardGizmo, g1.geometry)); + operandGeometries.push(TransformedGeometry.create(backwardGizmo, g1.geometry)); } return glyph.includeGeometry( - new TransformedGeometry( + TransformedGeometry.create( forwardGizmo, new BooleanGeometry(this.operator, operandGeometries), ), diff --git a/packages/font-kits/src/spiro-kit.mjs b/packages/font-kits/src/spiro-kit.mjs index 89a4d656e..ad8c71357 100644 --- a/packages/font-kits/src/spiro-kit.mjs +++ b/packages/font-kits/src/spiro-kit.mjs @@ -74,7 +74,7 @@ class DiSpiroProxy { } export function SetupBuilders(bindings) { - const { Stroke, Superness, Contrast, CorrectionOMidX } = bindings; + const { Stroke, Superness, Contrast, CorrectionOMidX, TINY } = bindings; function KnotType(type) { return (x, y, f) => { if (!isFinite(x)) throw new TypeError("NaN detected for X"); @@ -98,9 +98,9 @@ export function SetupBuilders(bindings) { { name: "right", x: 1, y: 0 }, ]; let adhesions = [ - { name: "start", l: 0, r: 0.01 }, - { name: "mid", l: -0.005, r: 0.005 }, - { name: "end", l: -0.01, r: 0 }, + { name: "start", l: 0, r: TINY }, + { name: "mid", l: -0.5 * TINY, r: 0.5 * TINY }, + { name: "end", l: -TINY, r: 0 }, ]; let knotTypes = [ [g4, g4, g4], diff --git a/packages/font/src/cleanup/gc.mjs b/packages/font/src/cleanup/gc.mjs index 091c2af0e..b39599d38 100644 --- a/packages/font/src/cleanup/gc.mjs +++ b/packages/font/src/cleanup/gc.mjs @@ -1,6 +1,6 @@ import * as Geometry from "@iosevka/geometry"; import { Transform } from "@iosevka/geometry/transform"; -import { Radical, VS01 } from "@iosevka/glyph/relation"; +import { VS01 } from "@iosevka/glyph/relation"; export function gcFont(glyphStore, excludedChars, otl) { const daGsub = markSweepOtlLookups(otl.GSUB); @@ -104,7 +104,7 @@ function markGlyphsInitial(glyphStore, excludedChars) { for (const [gName, g] of glyphStore.namedEntries()) { if (!g) continue; if (g.glyphRank > 0) markSingleGlyph(markedGlyphs, gName, 1); - if (Radical.get(g)) markSingleGlyph(markedGlyphs, gName, 1); + const unicodeSet = glyphStore.queryUnicodeOf(g); if (unicodeSet) { for (const u of unicodeSet) { @@ -317,7 +317,7 @@ function alterGeometryAndOptimize(collection) { throw new Error("Unreachable: each cluster should have at least one representative"); } - cluster.representative.glyph.geometry = new Geometry.TransformedGeometry( + cluster.representative.glyph.geometry = Geometry.TransformedGeometry.create( Transform.Translate(cluster.representative.x, cluster.representative.y), gT.geometry, ); @@ -406,5 +406,5 @@ function rectifyGlyphAndMarkComponents(glyphStore, aliasMap, markedGlyphs, memo, } // Make the glyph radical if it has no marked references. - g.geometry = g.geometry.unlinkReferences(); + g.geometry = new Geometry.RadicalGeometry(g.geometry); } diff --git a/packages/font/src/cleanup/glyphs.mjs b/packages/font/src/cleanup/glyphs.mjs index 610129fed..ea2f6d8b8 100644 --- a/packages/font/src/cleanup/glyphs.mjs +++ b/packages/font/src/cleanup/glyphs.mjs @@ -25,9 +25,9 @@ function flattenSimpleGlyph(cache, skew, g) { if (needsTransform) { const tfBack = g.gizmo ? g.gizmo.inverse() : new Transform(1, -skew, 0, 1, 0, 0); const tfForward = g.gizmo ? g.gizmo : new Transform(1, +skew, 0, 1, 0, 0); - gSimplified = new Geom.TransformedGeometry( + gSimplified = Geom.TransformedGeometry.create( tfForward, - new Geom.SimplifyGeometry(new Geom.TransformedGeometry(tfBack, g.geometry)), + new Geom.SimplifyGeometry(Geom.TransformedGeometry.create(tfBack, g.geometry)), ); } else { gSimplified = new Geom.SimplifyGeometry(g.geometry); diff --git a/packages/geometry-cache/src/index.mjs b/packages/geometry-cache/src/index.mjs index 981054a40..29e88562d 100644 --- a/packages/geometry-cache/src/index.mjs +++ b/packages/geometry-cache/src/index.mjs @@ -5,7 +5,7 @@ import zlib from "zlib"; import * as CurveUtil from "@iosevka/geometry/curve-util"; import { encode, decode } from "@msgpack/msgpack"; -const Edition = 41; +const Edition = 42; const MAX_AGE = 16; class GfEntry { constructor(age, value) { diff --git a/packages/geometry/src/index.mjs b/packages/geometry/src/index.mjs index 6b0b98b33..837223a89 100644 --- a/packages/geometry/src/index.mjs +++ b/packages/geometry/src/index.mjs @@ -24,9 +24,6 @@ export class GeometryBase { getDependencies() { throw new Error("Unimplemented"); } - unlinkReferences() { - return this; - } filterTag(fn) { return this; } @@ -224,7 +221,7 @@ export class ReferenceGeometry extends GeometryBase { this.m_y = y || 0; } unwrap() { - return new TransformedGeometry( + return TransformedGeometry.create( Transform.Translate(this.m_x, this.m_y), this.m_glyph.geometry, ); @@ -249,16 +246,8 @@ export class ReferenceGeometry extends GeometryBase { measureComplexity() { return this.m_glyph.geometry.measureComplexity(); } - unlinkReferences() { - return this.unwrap().unlinkReferences(); - } - hash(h) { - h.beginStruct("ReferenceGeometry"); - h.embed(this.m_glyph.geometry); - h.f64(this.m_x); - h.f64(this.m_y); - h.endStruct(); + this.unwrap().hash(h); } } @@ -284,24 +273,30 @@ export class TaggedGeometry extends GeometryBase { measureComplexity() { return this.m_geom.measureComplexity(); } - unlinkReferences() { - return this.m_geom.unlinkReferences(); - } - hash(h) { this.m_geom.hash(h); } } export class TransformedGeometry extends GeometryBase { + // PRIVATE constructor(tfm, g) { super(); this.m_transform = tfm; this.m_geom = g; } - withTransform(tfm) { - return new TransformedGeometry(Transform.Combine(this.m_transform, tfm), this.m_geom); + static create(tfm, g) { + if (Transform.isIdentity(tfm)) { + return g; + } else if (g instanceof TransformedGeometry) { + const tCombined = Transform.Combine(g.m_transform, tfm); + return TransformedGeometry.create(tCombined, g.m_geom); + } else if (g instanceof CombineGeometry || g instanceof BooleanGeometry) { + return g.map(x => TransformedGeometry.create(tfm, x)); + } else { + return new TransformedGeometry(tfm, g); + } } toContours(ctx) { @@ -328,7 +323,7 @@ export class TransformedGeometry extends GeometryBase { filterTag(fn) { const e = this.m_geom.filterTag(fn); if (!e) return null; - return new TransformedGeometry(this.m_transform, e); + return TransformedGeometry.create(this.m_transform, e); } measureComplexity() { return ( @@ -336,17 +331,6 @@ export class TransformedGeometry extends GeometryBase { this.m_geom.measureComplexity() ); } - unlinkReferences() { - const unwrapped = this.m_geom.unlinkReferences(); - if (Transform.isIdentity(this.m_transform)) { - return unwrapped; - } else if (unwrapped instanceof TransformedGeometry) { - return unwrapped.withTransform(this.m_transform); - } else { - return new TransformedGeometry(this.m_transform, unwrapped); - } - } - hash(h) { h.beginStruct("TransformedGeometry"); h.gizmo(this.m_transform); @@ -378,10 +362,6 @@ export class RadicalGeometry extends GeometryBase { measureComplexity() { return this.m_geom.measureComplexity(); } - unlinkReferences() { - return this.m_geom.unlinkReferences(); - } - hash(h) { this.m_geom.hash(h); } @@ -399,6 +379,9 @@ export class CombineGeometry extends GeometryBase { return new CombineGeometry([...this.m_parts, g]); } } + map(f) { + return new CombineGeometry(this.m_parts.map(f)); + } toContours(ctx) { let results = []; for (const part of this.m_parts) { @@ -441,19 +424,6 @@ export class CombineGeometry extends GeometryBase { for (const part of this.m_parts) s |= part.measureComplexity(); return s; } - unlinkReferences() { - let parts = []; - for (const part of this.m_parts) { - const unwrapped = part.unlinkReferences(); - if (unwrapped instanceof CombineGeometry) { - for (const p of unwrapped.m_parts) parts.push(p); - } else { - parts.push(unwrapped); - } - } - return new CombineGeometry(parts); - } - hash(h) { h.beginStruct("CombineGeometry"); h.beginArray(this.m_parts.length); @@ -470,6 +440,10 @@ export class BooleanGeometry extends CachedGeometry { this.m_operands = operands; } + map(f) { + return new BooleanGeometry(this.m_operator, this.m_operands.map(f)); + } + toContoursImpl() { if (this.m_operands.length === 0) return []; @@ -530,16 +504,6 @@ export class BooleanGeometry extends CachedGeometry { for (const operand of this.m_operands) s |= operand.measureComplexity(); return s; } - unlinkReferences() { - if (this.m_operands.length === 0) return new CombineGeometry([]); - if (this.m_operands.length === 1) return this.m_operands[0].unlinkReferences(); - let operands = []; - for (const operand of this.m_operands) { - operands.push(operand.unlinkReferences()); - } - return new BooleanGeometry(this.m_operator, operands); - } - hash(h) { h.beginStruct("BooleanGeometry"); h.u32(this.m_operator); @@ -562,7 +526,10 @@ export class StrokeGeometry extends CachedGeometry { toContoursImpl(ctx) { // Produce simplified arcs - const nonTransformedGeometry = new TransformedGeometry(this.m_gizmo.inverse(), this.m_geom); + const nonTransformedGeometry = TransformedGeometry.create( + this.m_gizmo.inverse(), + this.m_geom, + ); let arcs = TypoGeom.Boolean.removeOverlap( CurveUtil.convertShapeToArcs(nonTransformedGeometry.toContours(ctx)), TypoGeom.Boolean.PolyFillType.pftNonZero, @@ -592,15 +559,6 @@ export class StrokeGeometry extends CachedGeometry { getDependencies() { return this.m_geom.getDependencies(); } - unlinkReferences() { - return new StrokeGeometry( - this.m_geom.unlinkReferences(), - this.m_gizmo, - this.m_radius, - this.m_contrast, - this.m_fInside, - ); - } filterTag(fn) { return new StrokeGeometry( this.m_geom.filterTag(fn), @@ -634,7 +592,10 @@ export class RemoveHolesGeometry extends CachedGeometry { toContoursImpl(ctx) { // Produce simplified arcs - const nonTransformedGeometry = new TransformedGeometry(this.m_gizmo.inverse(), this.m_geom); + const nonTransformedGeometry = TransformedGeometry.create( + this.m_gizmo.inverse(), + this.m_geom, + ); let arcs = TypoGeom.Boolean.removeOverlap( CurveUtil.convertShapeToArcs(nonTransformedGeometry.toContours(ctx)), TypoGeom.Boolean.PolyFillType.pftNonZero, @@ -673,9 +634,6 @@ export class RemoveHolesGeometry extends CachedGeometry { getDependencies() { return this.m_geom.getDependencies(); } - unlinkReferences() { - return new RemoveHolesGeometry(this.m_geom.unlinkReferences(), this.m_gizmo); - } filterTag(fn) { return new RemoveHolesGeometry(this.m_geom.filterTag(fn), this.m_gizmo); } @@ -723,9 +681,6 @@ export class SimplifyGeometry extends CachedGeometry { getDependencies() { return this.m_geom.getDependencies(); } - unlinkReferences() { - return new SimplifyGeometry(this.m_geom.unlinkReferences()); - } filterTag(fn) { return new SimplifyGeometry(this.m_geom.filterTag(fn)); } diff --git a/packages/glyph/src/glyph.mjs b/packages/glyph/src/glyph.mjs index d2d5ed9a4..24677f2e6 100644 --- a/packages/glyph/src/glyph.mjs +++ b/packages/glyph/src/glyph.mjs @@ -125,7 +125,7 @@ export class Glyph { this.includeGeometry(new Geom.ReferenceGeometry(g, shiftX, shiftY)); } else { this.includeGeometry( - new Geom.TransformedGeometry(Transform.Translate(shiftX, shiftY), g.geometry), + Geom.TransformedGeometry.create(Transform.Translate(shiftX, shiftY), g.geometry), ); } } @@ -139,7 +139,7 @@ export class Glyph { this.includeGeometry(new Geom.ContourSetGeometry(cs)); } applyTransform(tfm, alsoAnchors) { - this.geometry = new Geom.TransformedGeometry(tfm, this.geometry); + this.geometry = Geom.TransformedGeometry.create(tfm, this.geometry); if (alsoAnchors) { for (const k in this.baseAnchors) this.baseAnchors[k] = Anchor.transform(tfm, this.baseAnchors[k]); @@ -150,8 +150,8 @@ export class Glyph { tryBecomeMirrorOf(dst, rankSet) { if (rankSet.has(this) || rankSet.has(dst)) return; if (dst.hasDependency(this)) return; - const csThis = Geom.hashGeometry(this.geometry.unlinkReferences()); - const csDst = Geom.hashGeometry(dst.geometry.unlinkReferences()); + const csThis = Geom.hashGeometry(this.geometry); + const csDst = Geom.hashGeometry(dst.geometry); if (csThis && csDst && csThis === csDst) { this.geometry = new Geom.CombineGeometry([new Geom.ReferenceGeometry(dst, 0, 0)]); rankSet.add(this); diff --git a/packages/glyph/src/relation.mjs b/packages/glyph/src/relation.mjs index 3187e31b7..41118a992 100644 --- a/packages/glyph/src/relation.mjs +++ b/packages/glyph/src/relation.mjs @@ -118,7 +118,7 @@ function BoolProp(id) { }, }; } -export const Radical = BoolProp("Radical"); + export const NeqLigationSlashDotted = BoolProp("NeqLigationSlashDotted"); export const OgonekTrY = BoolProp("OgonekTrY"); export const IsSuperscript = BoolProp("IsSuperscript");