diff --git a/changes/28.0.2.md b/changes/28.0.2.md index 017bbefb4..4380ce21a 100644 --- a/changes/28.0.2.md +++ b/changes/28.0.2.md @@ -1,3 +1,6 @@ +* Add characters: + - LATIN CAPITAL LETTER AU (`U+A736`) (#1689). + - LATIN SMALL LETTER AU (`U+A737`) (#1689). * Refine shape of Tshe and Cyrillic Capital Letter Te with Middle Hook (`U+A68A`) (#2123). * Remove bottom serif of Cyrillic Small Letter Ghe with Middle Hook (`U+0495`) under italics. * Make serif variants of Cyrillic Small Letter Tall Te (`U+1C84`) respond to italics. diff --git a/packages/font-glyphs/src/auto-build/mark-doppelganger.ptl b/packages/font-glyphs/src/auto-build/mark-doppelganger.ptl index 888d9af29..c17dd8440 100644 --- a/packages/font-glyphs/src/auto-build/mark-doppelganger.ptl +++ b/packages/font-glyphs/src/auto-build/mark-doppelganger.ptl @@ -2,7 +2,6 @@ $$include '../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" import [mix linreg clamp fallback] from "@iosevka/util" -import [Box] from "@iosevka/geometry/box" import [TieMark AnyDerivingCv ScheduleLeaningMark LeaningMark LeaningMarkSpacer] from "@iosevka/glyph/relation" import [DesignParameters] from "../meta/aesthetics.mjs" diff --git a/packages/font-glyphs/src/letter/latin-ext/lower-ae-oe.ptl b/packages/font-glyphs/src/letter/latin-ext/lower-ae-oe.ptl index 6ac67c776..46a6fb20d 100644 --- a/packages/font-glyphs/src/letter/latin-ext/lower-ae-oe.ptl +++ b/packages/font-glyphs/src/letter/latin-ext/lower-ae-oe.ptl @@ -133,31 +133,35 @@ glyph-block Letter-Latin-Lower-AE-OE : begin include : InvEShape 1 df revbody do "u subglyphs" - define [ueUPart df fSlab] : new-glyph : glyph-proc - local { subDf } : SubDfAndShift 0 df 0 - local ada : subDf.archDepthA SmallArchDepth df.mvs - local adb : subDf.archDepthB SmallArchDepth df.mvs + glyph-block-import Letter-Latin-U : UShapeGroup SmallUConfigT - local abarRight : df.middle + [HSwToV : 0.5 * df.mvs] - include : nShoulder - left -- abarRight - right -- (df.rightSB - OX) - stroke -- df.mvs - ada -- adb - adb -- adb - include : FlipAround df.middle (XH / 2) - if fSlab : include : HSerif.lt df.leftSB XH SideJut + define df : DivFrame para.diversityM 3 + define { subDf shift } : SubDfAndShift 1 df 0 + local ada : subDf.archDepthA SmallArchDepth df.mvs + local adb : subDf.archDepthB SmallArchDepth df.mvs + define sg : UShapeGroup ada adb - define Config : object - "serifed" { true } - "serifless" { false } - - foreach { suffix { fSlab } } [Object.entries Config] : do + foreach { suffix { Base Slabs } } [Object.entries : SmallUConfigT sg] : do create-glyph "ue/u.\(suffix)" : glyph-proc - local df : include : DivFrame para.diversityM 3 + include df include : df.markSet.e set-base-anchor 'cvDecompose' 0 0 - include : ueUPart df fSlab + include : Base subDf XH df.mvs + include : Slabs subDf XH + + eject-contour 'strokeR' + eject-contour 'serifRT' + eject-contour 'serifRB' + + create-glyph "au/u.\(suffix)" : glyph-proc + set-width 0 + set-mark-anchor 'cvDecompose' 0 0 + include : difference + Base subDf XH df.mvs + intersection [MaskLeft subDf.middle] [MaskAbove (XH - adb)] + include : Slabs subDf XH + include : ApparentTranslate shift 0 + eject-contour 'serifLT' do "c subglyphs" glyph-block-import Letter-Latin-C : CLetterForm CConfig @@ -378,6 +382,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin select-variant "ae/e" (follow -- 'e') select-variant "aeInvE/right" (follow -- 'e') select-variant "ue/u" + select-variant "au/u" select-variant "oeOpenO/left" (follow -- 'c') select-variant "cyrl/yae/left" select-variant "cyrl/rha/left" (follow -- 'cyrl/er') @@ -389,6 +394,7 @@ glyph-block Letter-Latin-Lower-AE-OE : begin derive-composites 'oe' 0x153 'oe/o' 'ae/e' derive-composites 'ue' 0x1D6B 'ue/u' 'ae/e' derive-composites 'ao' 0xA735 'ae/a' 'ao/o' + derive-composites 'au' 0xA737 'ae/a' 'au/u' derive-composites 'oo' 0xA74F 'oe/o' 'ao/o' derive-composites 'uo' 0xAB63 'ue/u' 'ao/o' derive-composites 'oeOpenO' 0xAB62 'oeOpenO/left' 'ae/e' 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 db54b1faa..30d6e811d 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 @@ -12,6 +12,7 @@ glyph-block Letter-Latin-Upper-AA-AO : begin do "A glyphs" glyph-block-import Letter-Latin-Upper-A : AConfig AMaskShape ALetterShape + glyph-block-import Letter-Latin-Upper-A : ABottomRightRemoved ABarPosition define [AHalfShape pShift df top fStraightBar slabKind] : begin local { subDf shift } : SubDfAndShift pShift df @@ -63,6 +64,18 @@ glyph-block Letter-Latin-Upper-AA-AO : begin set-mark-anchor 'cvDecompose' 0 0 0 0 include : AHalfShapeMask 1 df height fStraightBar skRight + create-glyph "\(prefix)/AU/Left.\(suffix)" : glyph-proc + define df : include : DivFrame para.diversityM 3.5 + local { subDf shift } : SubDfAndShift 1 df + include : ABottomRightRemoved subDf fStraightBar slabKind CAP df.mvs + create-glyph "\(prefix)/AU/LeftMask.\(suffix)" : glyph-proc + define df : include : DivFrame para.diversityM 3.5 + local { subDf shift } : SubDfAndShift 1 df + include : union + MaskAbove : [ABarPosition slabKind CAP] - df.mvs + MaskLeft : subDf.width / 2 + include : ABottomRightRemoved subDf fStraightBar slabKind CAP df.mvs + select-variant "\(prefix)/Left" (follow -- 'A') select-variant "\(prefix)/LeftMask" (follow -- 'A') select-variant "\(prefix)/Right" (follow -- 'A') @@ -94,6 +107,30 @@ glyph-block Letter-Latin-Upper-AA-AO : begin include [refer-glyph left] AS_BASE ALSO_METRICS include : difference [refer-glyph right] [refer-glyph leftMask] + do "U subglyphs" + glyph-block-import Letter-Latin-U : CapitalUConfig + foreach { suffix { Base {Slabs fLTSlab} } } [Object.entries CapitalUConfig] : do + create-glyph "AU/Right.\(suffix)" : glyph-proc + define df : DivFrame para.diversityM 3.5 + local { subDf shift } : SubDfAndShift 1 df + include : with-transform [ApparentTranslate shift 0] + union [Base subDf CAP df.mvs] [Slabs subDf CAP] + + select-variant "AU/Right" (follow -- 'U/noTopLeftSerif') + + do "AU" + select-variant 'AA/AU/Left' (follow -- 'A') + select-variant 'AA/AU/LeftMask' (follow -- 'A') + derive-multi-part-glyphs 'AU' 0xA736 {'AA/AU/Left' 'AA/AU/LeftMask' 'AU/Right'} + function [srcs gr] : glyph-proc + define df : include : DivFrame para.diversityM 3.5 + local { subDf shift } : SubDfAndShift 1 df + include : df.markSet.capital + define { left mask right } srcs + include [refer-glyph left] + include : difference [refer-glyph right] + intersection [refer-glyph mask] [MaskLeft (subDf.width / 2 + shift)] + do "RHA" glyph-block-import Letter-Shared-Shapes : SerifFrame WithSerifOverflowMask glyph-block-import Letter-Latin-Upper-P : PShape PConfig diff --git a/packages/font-glyphs/src/letter/latin/u.ptl b/packages/font-glyphs/src/letter/latin/u.ptl index ce18c5a58..86421f975 100644 --- a/packages/font-glyphs/src/letter/latin/u.ptl +++ b/packages/font-glyphs/src/letter/latin/u.ptl @@ -36,70 +36,67 @@ glyph-block Letter-Latin-U : begin adb -- adb offset -- offset - define [UToothed df top fHookLeft] : glyph-proc - set-base-anchor 'trailing' df.rightSB 0 - include : nShoulder - top -- top - bottom -- [if fHookLeft (TailY + HalfStroke) 0] - left -- (df.leftSB + [HSwToV Stroke]) - right -- df.rightSB - fine -- ShoulderFine - if fHookLeft : include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) - include : FlipAround df.middle (top / 2) - include : VBar.r df.rightSB 0 top + glyph-block-export UShapeGroup + define [UShapeGroup ada adb] : namespace + export : define [Toothed df top sw fHookLeft] : glyph-proc + set-base-anchor 'trailing' df.rightSB 0 + include : nShoulder + top -- top + bottom -- [if fHookLeft (TailY + HalfStroke) 0] + left -- (df.leftSB + [HSwToV sw]) + right -- df.rightSB + stroke -- sw + fine -- ShoulderFine + ada -- ada + adb -- adb + if fHookLeft : include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) (sw -- sw) + include : FlipAround df.middle (top / 2) + include : tagged 'strokeR' : VBar.r df.rightSB 0 top sw - define [UTailed df top fHookLeft] : glyph-proc - set-base-anchor 'trailing' (df.rightSB + SideJut) 0 - include : nShoulder - top -- top - bottom -- [if fHookLeft (TailY + HalfStroke) 0] - left -- (df.leftSB + [HSwToV Stroke]) - right -- df.rightSB - fine -- ShoulderFine - if fHookLeft : include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) - include : FlipAround df.middle (top / 2) - include : RightwardTailedBar df.rightSB 0 top + export : define [Tailed df top sw fHookLeft] : glyph-proc + set-base-anchor 'trailing' (df.rightSB + SideJut) 0 + include : nShoulder + top -- top + bottom -- [if fHookLeft (TailY + HalfStroke) 0] + left -- (df.leftSB + [HSwToV sw]) + right -- df.rightSB + stroke -- sw + fine -- ShoulderFine + ada -- ada + adb -- adb + if fHookLeft : include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) (sw -- sw) + include : FlipAround df.middle (top / 2) + include : tagged 'strokeR' : RightwardTailedBar df.rightSB 0 top (sw -- sw) - define [UToothlessRounded df top] : glyph-proc - include : UShape df top 0 + export : define [ToothlessRounded df top sw fHookLeft] : glyph-proc + if fHookLeft : begin + include : dispiro + widths.rhs sw + flat df.leftSB 0 [heading Upward] + curl df.leftSB (top - ada) + arcvh + g4 (df.middle - CorrectionOMidS) (top - O) + archv + flat df.rightSB (top - adb) + curl df.rightSB (TailY + HalfStroke) [heading Downward] + include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) (sw -- sw) + include : FlipAround df.middle (top / 2) + : else : include : UShape df top 0 (stroke -- sw) (ada -- ada) (adb -- adb) - define [UToothlessRoundedSmall df top fHookLeft] : glyph-proc - if fHookLeft : begin + export : define [ToothlessCorner df top sw fHookLeft] : glyph-proc + include : VBar.l df.leftSB 0 (top - DToothlessRise) sw include : dispiro - widths.rhs - flat df.leftSB 0 [heading Upward] - curl df.leftSB (top - SmallArchDepthA) - arcvh + widths.rhs sw + g4 df.leftSB (top - DToothlessRise) g4 (df.middle - CorrectionOMidS) (top - O) archv - flat df.rightSB (top - SmallArchDepthB) - curl df.rightSB (TailY + HalfStroke) [heading Downward] - include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) + flat df.rightSB (top - adb) + curl df.rightSB [if fHookLeft (TailY + HalfStroke) 0] [heading Downward] + if fHookLeft : include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) (sw -- sw) include : FlipAround df.middle (top / 2) - : else : include : UShape df top 0 (ada -- SmallArchDepthA) (adb -- SmallArchDepthB) - define [UToothlessCorner df top] : glyph-proc - include : VBar.l df.leftSB 0 (top - DToothlessRise) - include : dispiro - widths.rhs - g4 df.leftSB (top - DToothlessRise) - g4 (df.middle - CorrectionOMidS) (top - O) - archv - flat df.rightSB (top - ArchDepthB) - curl df.rightSB 0 [heading Downward] - include : FlipAround df.middle (top / 2) - - define [UToothlessCornerSmall df top fHookLeft] : glyph-proc - include : VBar.l df.leftSB 0 (top - DToothlessRise) - include : dispiro - widths.rhs - g4 df.leftSB (top - DToothlessRise) - g4 (df.middle - CorrectionOMidS) (top - O) - archv - flat df.rightSB (top - SmallArchDepthB) - curl df.rightSB [if fHookLeft (TailY + HalfStroke) 0] [heading Downward] - if fHookLeft : include : RetroflexHook.rExt df.rightSB (TailY + HalfStroke) - include : FlipAround df.middle (top / 2) + define UUpper : UShapeGroup ArchDepthA ArchDepthB + define ULower : UShapeGroup SmallArchDepthA SmallArchDepthB define [UTopLeftSerif df yTop _sw] : tagged 'serifLT' HSerif.lt df.leftSB yTop SideJut _sw @@ -149,12 +146,13 @@ glyph-block Letter-Latin-U : begin local sf : SerifFrame.fromDf df top 0 (swSerif -- _sw) return : composite-proc sf.lt.full sf.rt.full + glyph-block-export CapitalUConfig define CapitalUConfig : SuffixCfg.weave object # body - toothed UToothed - tailed UTailed - toothlessCorner UToothlessCorner - toothlessRounded UToothlessRounded + toothed UUpper.Toothed + tailed UUpper.Tailed + toothlessCorner UUpper.ToothlessCorner + toothlessRounded UUpper.ToothlessRounded function [body] : object # serifs serifless { no-shape false } bottomRightSerifed { USerifs.BottomRight false } @@ -171,7 +169,7 @@ glyph-block Letter-Latin-U : begin create-glyph "U.\(suffix)" : glyph-proc local df : DivFrame 1 include : MarkSet.capital - include : Base df CAP + include : Base df CAP Stroke include : Slabs df CAP create-glyph "U/withTonos.\(suffix)" : glyph-proc @@ -181,16 +179,17 @@ glyph-block Letter-Latin-U : begin create-glyph "smcpU.\(suffix)" : glyph-proc local df : DivFrame 1 include : MarkSet.e - include : Base df XH + include : Base df XH Stroke include : Slabs df XH - define SmallUConfig : SuffixCfg.weave + glyph-block-export SmallUConfigT + define [SmallUConfigT shapeGroup] : SuffixCfg.weave object # body - toothed UToothed - tailed UTailed - toothlessCorner UToothlessCornerSmall - toothlessRounded UToothlessRoundedSmall - urtBase UToothed + toothed shapeGroup.Toothed + tailed shapeGroup.Tailed + toothlessCorner shapeGroup.ToothlessCorner + toothlessRounded shapeGroup.ToothlessRounded + urtBase shapeGroup.Toothed function [body] : object # serifs serifless no-shape bottomRightSerifed USerifs.BottomRight @@ -203,17 +202,17 @@ glyph-block Letter-Latin-U : begin [Just 'urtBase'] USerifs.RTBase __ USerifs.SmallToothless - foreach { suffix { Base Slabs } } [Object.entries SmallUConfig] : do + foreach { suffix { Base Slabs } } [Object.entries : SmallUConfigT ULower] : do create-glyph "u.\(suffix)" : glyph-proc local df : DivFrame 1 include : MarkSet.e - include : Base df XH + include : Base df XH Stroke include : Slabs df XH create-glyph "grek/mu.\(suffix)" : glyph-proc local df : DivFrame 1 include : MarkSet.p - include : Base df XH + include : Base df XH Stroke include : dispiro widths.rhs flat SB Descender [heading Upward] @@ -224,7 +223,7 @@ glyph-block Letter-Latin-U : begin create-glyph "uHookLeft.\(suffix)" : glyph-proc local df : DivFrame 1 include : MarkSet.e - include : Base df XH true + include : Base df XH Stroke true include : Slabs df XH eject-contour 'serifLT' @@ -232,7 +231,7 @@ glyph-block Letter-Latin-U : begin local df : DivFrame (XH / Width) 2 (XH * 0.1 / SB) include : df.markSet.e include : PointingTo Width XH Width 0 : function [] : glyph-proc - include : Base df (Width - SB) + include : Base df (Width - SB) Stroke include : Slabs df (Width - SB) include : Translate 0 (SB / 2) @@ -242,7 +241,7 @@ glyph-block Letter-Latin-U : begin local ww : Width * para.diversityM set-width ww include : PointingTo ww XH ww 0 : function [] : glyph-proc - include : Base df (ww - SB - 0.75 * para.diversityM * AccentHeight) + include : Base df (ww - SB - 0.75 * para.diversityM * AccentHeight) Stroke include : Slabs df (ww - SB - 0.75 * para.diversityM * AccentHeight) include : Translate 0 (SB / 2) diff --git a/packages/font-glyphs/src/letter/latin/upper-a.ptl b/packages/font-glyphs/src/letter/latin/upper-a.ptl index c2c0b6c13..60769998a 100644 --- a/packages/font-glyphs/src/letter/latin/upper-a.ptl +++ b/packages/font-glyphs/src/letter/latin/upper-a.ptl @@ -3,6 +3,7 @@ $$include '../../meta/macros.ptl' import [mix fallback SuffixCfg] from "@iosevka/util" import [MathSansSerif] from "@iosevka/glyph/relation" import [maskBits bitOr] from "@iosevka/util/mask-bit" +import [Seg] from "@iosevka/geometry/segment" glyph-module @@ -12,7 +13,7 @@ glyph-block Letter-Latin-Upper-A : begin glyph-block-import Mark-Shared-Metrics : markHalfStroke glyph-block-import Letter-Shared : SetGrekUpperTonos CreateOgonekComposition glyph-block-import Letter-Shared-Shapes : SerifFrame - glyph-block-import Letter-Latin-V : VShapeOutline VShape + glyph-block-import Letter-Latin-V : VShapeOutline VShape VCornerHalfWidth define SLAB-NONE 0 define SLAB-TOP 1 @@ -24,7 +25,10 @@ glyph-block Letter-Latin-Upper-A : begin include : VShapeOutline df fBarStraight top sw include : FlipAround (df.width / 2) (top / 2) - define [ABarPosition fBaseSlabs top] : mix [if fBaseSlabs Stroke 0] top (XH / 2 / CAP) + glyph-block-export ABarPosition + define [ABarPosition slabKind top] : begin + local fBaseSlabs : maskBits slabKind : bitOr SLAB-LEFT SLAB-RIGHT + return : mix [if fBaseSlabs Stroke 0] top (XH / 2 / CAP) glyph-block-export AConfig define AConfig : SuffixCfg.weave @@ -45,15 +49,51 @@ glyph-block Letter-Latin-Upper-A : begin if [maskBits slabKind SLAB-TOP] : include : intersection [MaskLeft df.middle] if [maskBits slabKind : bitOr SLAB-LEFT SLAB-RIGHT] : then : HSerif.lt df.middle top (MidJutSide + [HSwToV : 0.25 * sw]) sf.swSerif - : else : HSerif.lt df.middle top [mix MidJutSide LongJut 0.5] sf.swSerif + : else : HSerif.lt df.middle top [mix MidJutSide LongJut 0.5] sf.swSerif + + glyph-block-export ABottomRightRemoved + define [ABottomRightRemoved] : with-params [df fStraightBar slabKind top sw] : new-glyph : glyph-proc + define yBar : ABarPosition slabKind top + include : VShape df fStraightBar top sw + include : FlipAround df.middle (top / 2) + eject-contour 'strokeDown' + + local rightStrokeKnots : begin + local s : Seg (df.middle + VCornerHalfWidth * sw / Stroke) top df.rightSB (yBar - sw) + list + s.z 0 flat + s.zz 0.55 [StrokeWidthBlend 0.48 0.45] [if fStraightBar curl g4] + s.z 1 straight.down.end + + include : intersection + MaskAbove (yBar - sw) + dispiro [widths.rhs sw] rightStrokeKnots + + include : tagged 'crossBar' + intersection + HBar.t 0 df.width yBar sw + union + AMaskShape df fStraightBar top sw + intersection + MaskRight df.middle + MaskAbove (yBar - sw) + spiro-outline rightStrokeKnots + corner df.rightSB 0 + corner 0 0 + corner 0 top + + include : ASerifs df top sw slabKind + eject-contour 'serifRB' + + return : yBar - sw glyph-block-export ALetterShape define [ALetterShape] : with-params [df fStraightBar slabKind top sw] : new-glyph : glyph-proc include : VShape df fStraightBar top sw include : FlipAround df.middle (top / 2) - define yBar : ABarPosition [maskBits slabKind : bitOr SLAB-LEFT SLAB-RIGHT] top + define yBar : ABarPosition slabKind top include : tagged 'crossBar' - intersection [HBar.t 0 df.width yBar] [AMaskShape df fStraightBar top sw] + intersection [HBar.t 0 df.width yBar sw] [AMaskShape df fStraightBar top sw] include : ASerifs df top sw slabKind glyph-block-export LambdaShape @@ -78,7 +118,7 @@ glyph-block Letter-Latin-Upper-A : begin slabKind -- slabKind if fOverlays : begin - define yBar : ABarPosition [maskBits slabKind : bitOr SLAB-LEFT SLAB-RIGHT] top + define yBar : ABarPosition slabKind top eject-contour 'crossBar' include : HOverlayBar [mix 0 SB 0.5] [mix Width RightSB 0.5] (yBar - HalfStroke + 0.5 * OverlayStroke) include : HOverlayBar [mix 0 SB 0.5] [mix Width RightSB 0.5] [mix yBar top 0.25] diff --git a/packages/font-glyphs/src/letter/latin/v.ptl b/packages/font-glyphs/src/letter/latin/v.ptl index 64716d846..153950094 100644 --- a/packages/font-glyphs/src/letter/latin/v.ptl +++ b/packages/font-glyphs/src/letter/latin/v.ptl @@ -12,6 +12,7 @@ glyph-block Letter-Latin-V : begin glyph-block-import Letter-Shared-Shapes : DiagTail SerifFrame PalatalHook glyph-block-import Letter-Blackboard : BBS BBD + glyph-block-export VCornerHalfWidth define VCornerHalfWidth : HSwToV : 1.15 * HalfStroke define VCurviness 0.3 define VShapeFine : Math.max diff --git a/packages/font-glyphs/src/marks/below.ptl b/packages/font-glyphs/src/marks/below.ptl index 8e8cc66dd..2f7985264 100644 --- a/packages/font-glyphs/src/marks/below.ptl +++ b/packages/font-glyphs/src/marks/below.ptl @@ -3,7 +3,6 @@ $$include '../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" import [mix linreg clamp fallback] from "@iosevka/util" import [ScheduleLeaningMark] from "@iosevka/glyph/relation" -import [Box] from "@iosevka/geometry/box" glyph-module diff --git a/packages/font-glyphs/src/marks/shared-metrics.ptl b/packages/font-glyphs/src/marks/shared-metrics.ptl index 5eda903a5..22b0b7b24 100644 --- a/packages/font-glyphs/src/marks/shared-metrics.ptl +++ b/packages/font-glyphs/src/marks/shared-metrics.ptl @@ -3,7 +3,6 @@ $$include '../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" import [mix linreg clamp fallback] from "@iosevka/util" import [DesignParameters] from "../meta/aesthetics.mjs" -import [Box] from "@iosevka/geometry/box" glyph-module diff --git a/packages/geometry/package.json b/packages/geometry/package.json index 7076a8d03..4b62a7635 100644 --- a/packages/geometry/package.json +++ b/packages/geometry/package.json @@ -1,19 +1,20 @@ { - "name": "@iosevka/geometry", - "version": "28.0.2", - "private": true, - "exports": { - ".": "./src/index.mjs", - "./anchor": "./src/anchor.mjs", - "./box": "./src/box.mjs", - "./curve-util": "./src/curve-util.mjs", - "./point": "./src/point.mjs", - "./transform": "./src/transform.mjs", - "./spiro-control": "./src/spiro-control.mjs" - }, - "dependencies": { - "@iosevka/util": "28.0.2", - "spiro": "^3.0.0", - "typo-geom": "^0.13.1" - } + "name": "@iosevka/geometry", + "version": "28.0.2", + "private": true, + "exports": { + ".": "./src/index.mjs", + "./anchor": "./src/anchor.mjs", + "./box": "./src/box.mjs", + "./segment": "./src/segment.mjs", + "./curve-util": "./src/curve-util.mjs", + "./point": "./src/point.mjs", + "./transform": "./src/transform.mjs", + "./spiro-control": "./src/spiro-control.mjs" + }, + "dependencies": { + "@iosevka/util": "28.0.2", + "spiro": "^3.0.0", + "typo-geom": "^0.13.1" + } } diff --git a/packages/geometry/src/segment.mjs b/packages/geometry/src/segment.mjs new file mode 100644 index 000000000..f889817e2 --- /dev/null +++ b/packages/geometry/src/segment.mjs @@ -0,0 +1,28 @@ +import { mix } from "@iosevka/util"; + +export class CSegment { + constructor(x1, y1, x2, y2) { + this.x0 = x1; + this.y0 = y1; + this.x1 = x2; + this.y1 = y2; + } + + x(t) { + return mix(this.x0, this.x1, t); + } + y(t) { + return mix(this.y0, this.y1, t); + } + + z(t, fn, ...additionalArgs) { + return fn(this.x(t), this.y(t), ...additionalArgs); + } + zz(tx, ty, fn, ...additionalArgs) { + return fn(this.x(tx), this.y(ty), ...additionalArgs); + } +} + +export function Seg(x0, y0, x1, y1) { + return new CSegment(x0, y0, x1, y1); +} diff --git a/params/variants.toml b/params/variants.toml index 0029daa97..a2e1726ee 100644 --- a/params/variants.toml +++ b/params/variants.toml @@ -1076,24 +1076,28 @@ next = "serifs" rank = 1 descriptionAffix = "toothed shape" selectorAffix.U = "toothed" +selectorAffix."U/noTopLeftSerif" = "toothed" selectorAffix."U/sansSerif" = "toothed" [prime.capital-u.variants-buildup.stages.body.tailed] rank = 2 descriptionAffix = "tailed shape" selectorAffix.U = "tailed" +selectorAffix."U/noTopLeftSerif" = "tailed" selectorAffix."U/sansSerif" = "tailed" [prime.capital-u.variants-buildup.stages.body.toothless-corner] rank = 3 descriptionAffix = "toothless (corner bottom-right) shape" selectorAffix.U = "toothlessCorner" +selectorAffix."U/noTopLeftSerif" = "toothlessCorner" selectorAffix."U/sansSerif" = "toothlessCorner" [prime.capital-u.variants-buildup.stages.body.toothless-rounded] rank = 4 descriptionAffix = "toothless (rounded) shape" selectorAffix.U = "toothlessRounded" +selectorAffix."U/noTopLeftSerif" = "toothlessRounded" selectorAffix."U/sansSerif" = "toothlessRounded" [prime.capital-u.variants-buildup.stages.serifs.serifless] @@ -1101,6 +1105,7 @@ rank = 1 descriptionAffix = "serifs" descriptionJoiner = "without" selectorAffix.U = "serifless" +selectorAffix."U/noTopLeftSerif" = "serifless" selectorAffix."U/sansSerif" = "serifless" [prime.capital-u.variants-buildup.stages.serifs.motion-serifed] @@ -1108,6 +1113,7 @@ rank = 2 disableIf = [{ body = "toothless-corner" }, { body = "toothless-rounded" }] descriptionAffix = "motion serifs at top-left and bottom-right" selectorAffix.U = "unilateralMotionSerifed" +selectorAffix."U/noTopLeftSerif" = "serifless" selectorAffix."U/sansSerif" = "serifless" [prime.capital-u.variants-buildup.stages.serifs.bottom-right-serifed] @@ -1115,6 +1121,7 @@ rank = 3 disableIf = [{ body = "NOT toothed" }] descriptionAffix = "serif at bottom-right" selectorAffix.U = "bottomRightSerifed" +selectorAffix."U/noTopLeftSerif" = "bottomRightSerifed" selectorAffix."U/sansSerif" = "serifless" [prime.capital-u.variants-buildup.stages.serifs.unilateral-motion-serifed] @@ -1122,6 +1129,7 @@ rank = 4 disableIf = [{ body = "toothed" }, { body = "tailed" }] descriptionAffix = "motion serifs at left side" selectorAffix.U = "unilateralMotionSerifed" +selectorAffix."U/noTopLeftSerif" = "serifless" selectorAffix."U/sansSerif" = "serifless" [prime.capital-u.variants-buildup.stages.serifs.bilateral-motion-serifed] @@ -1129,12 +1137,14 @@ rank = 5 disableIf = [{ body = "toothed" }, { body = "tailed" }] descriptionAffix = "motion serifs at both sides" selectorAffix.U = "bilateralMotionSerifed" +selectorAffix."U/noTopLeftSerif" = "bilateralMotionSerifed" selectorAffix."U/sansSerif" = "serifless" [prime.capital-u.variants-buildup.stages.serifs.serifed] rank = 6 descriptionAffix = "serifs" selectorAffix.U = "serifed" +selectorAffix."U/noTopLeftSerif" = "serifed" selectorAffix."U/sansSerif" = "serifless" @@ -3722,7 +3732,8 @@ selectorAffix."cyrl/shcha.italic" = "toothed" selectorAffix."cyrl/shcha/reduced.italic" = "toothed" selectorAffix."cyrl/dzhe.italic" = "toothed" selectorAffix."cyrl/tse.italic" = "toothed" -selectorAffix."ue/u" = "" +selectorAffix."ue/u" = "toothed" +selectorAffix."au/u" = "toothed" [prime.u.variants-buildup.stages.body.tailed] rank = 2 @@ -3746,7 +3757,8 @@ selectorAffix."cyrl/shcha.italic" = "toothed" selectorAffix."cyrl/shcha/reduced.italic" = "toothed" selectorAffix."cyrl/dzhe.italic" = "tailed" selectorAffix."cyrl/tse.italic" = "toothed" -selectorAffix."ue/u" = "" +selectorAffix."ue/u" = "toothed" +selectorAffix."au/u" = "tailed" [prime.u.variants-buildup.stages.body.toothless-corner] rank = 3 @@ -3770,7 +3782,8 @@ selectorAffix."cyrl/shcha.italic" = "toothed" selectorAffix."cyrl/shcha/reduced.italic" = "toothed" selectorAffix."cyrl/dzhe.italic" = "toothed" selectorAffix."cyrl/tse.italic" = "toothed" -selectorAffix."ue/u" = "" +selectorAffix."ue/u" = "toothed" +selectorAffix."au/u" = "toothlessCorner" [prime.u.variants-buildup.stages.body.toothless-rounded] rank = 4 @@ -3794,7 +3807,8 @@ selectorAffix."cyrl/shcha.italic" = "toothed" selectorAffix."cyrl/shcha/reduced.italic" = "toothed" selectorAffix."cyrl/dzhe.italic" = "toothed" selectorAffix."cyrl/tse.italic" = "toothed" -selectorAffix."ue/u" = "" +selectorAffix."ue/u" = "toothed" +selectorAffix."au/u" = "toothlessRounded" [prime.u.variants-buildup.stages.serifs.serifless] rank = 1 @@ -3820,6 +3834,7 @@ selectorAffix."cyrl/shcha/reduced.italic" = "serifless" selectorAffix."cyrl/dzhe.italic" = "serifless" selectorAffix."cyrl/tse.italic" = "serifless" selectorAffix."ue/u" = "serifless" +selectorAffix."au/u" = "serifless" [prime.u.variants-buildup.stages.serifs.motion-serifed] rank = 2 @@ -3844,6 +3859,7 @@ selectorAffix."cyrl/shcha/reduced.italic" = "motionSerifed" selectorAffix."cyrl/dzhe.italic" = "motionSerifed" selectorAffix."cyrl/tse.italic" = "motionSerifed" selectorAffix."ue/u" = "serifed" +selectorAffix."au/u" = {if = [{body = "toothed"}], then = "bottomRightSerifed", else = "serifless"} [prime.u.variants-buildup.stages.serifs.bottom-right-serifed] rank = 3 @@ -3869,6 +3885,7 @@ selectorAffix."cyrl/shcha/reduced.italic" = "serifless" selectorAffix."cyrl/dzhe.italic" = "bottomRightSerifed" selectorAffix."cyrl/tse.italic" = "serifless" selectorAffix."ue/u" = "serifless" +selectorAffix."au/u" = {if = [{body = "toothed"}], then = "bottomRightSerifed", else = "serifless"} [prime.u.variants-buildup.stages.serifs.serifed] rank = 4 @@ -3893,6 +3910,7 @@ selectorAffix."cyrl/shcha/reduced.italic" = "motionSerifed" selectorAffix."cyrl/dzhe.italic" = "serifed" selectorAffix."cyrl/tse.italic" = "serifed" selectorAffix."ue/u" = "serifed" +selectorAffix."au/u" = "serifed"