From 9c9f22968420691910c941b9505ca763a5c90a72 Mon Sep 17 00:00:00 2001 From: jmcwilliams403 Date: Tue, 15 Oct 2024 12:50:13 -0400 Subject: [PATCH 1/2] Add five mathematic/logical characters. --- changes/31.9.2.md | 6 ++++ doc/custom-build.md | 2 ++ packages/font-glyphs/src/meta/aesthetics.ptl | 18 ++++++----- packages/font-glyphs/src/meta/macros.ptl | 26 ++++++++-------- packages/font-glyphs/src/symbol/arrow.ptl | 6 ++-- packages/font-glyphs/src/symbol/math/apl.ptl | 10 +++---- .../font-glyphs/src/symbol/math/circled.ptl | 7 +++++ .../src/symbol/math/large-operators.ptl | 18 +++++++++-- .../font-glyphs/src/symbol/math/logicals.ptl | 30 +++++++++++++++++-- packages/font/src/derive-spacing.mjs | 2 ++ params/parameters.toml | 1 + 11 files changed, 93 insertions(+), 33 deletions(-) create mode 100644 changes/31.9.2.md diff --git a/changes/31.9.2.md b/changes/31.9.2.md new file mode 100644 index 0000000000..a064051462 --- /dev/null +++ b/changes/31.9.2.md @@ -0,0 +1,6 @@ +* Add characters: + - LEFT AND RIGHT DOUBLE TURNSTILE (`U+27DA`). + - LEFT AND RIGHT TACK (`U+27DB`). + - LONG RIGHT TACK (`U+27DD`). + - LONG LEFT TACK (`U+27DE`). + - UP ARROW THROUGH CIRCLE (`U+29BD`). diff --git a/doc/custom-build.md b/doc/custom-build.md index 68e0264762..43e3df2136 100644 --- a/doc/custom-build.md +++ b/doc/custom-build.md @@ -58,6 +58,8 @@ Inside the plan, top-level properties include: - `fontconfig-mono`: Apply `term` spacing changes and further apply changes to be compatible with FontConfig's Mono spacing, which recognizes a font as monospace if and only if its every non-combining characters having the same width. The changes include: - Completely remove wide glyphs. All non-combining glyphs will be exactly the same width. - As a consequence, the following characters will be **removed**: + - `U+27DD` LONG RIGHT TACK + - `U+27DE` LONG LEFT TACK - `U+27F5` LONG LEFTWARDS ARROW - `U+27F6` LONG RIGHTWARDS ARROW - `U+27F7` LONG LEFT RIGHT ARROW diff --git a/packages/font-glyphs/src/meta/aesthetics.ptl b/packages/font-glyphs/src/meta/aesthetics.ptl index 1328545aa8..71e2e40ab7 100644 --- a/packages/font-glyphs/src/meta/aesthetics.ptl +++ b/packages/font-glyphs/src/meta/aesthetics.ptl @@ -32,6 +32,8 @@ export : define [calculateMetrics para] : begin define PictBot : SymbolMid - para.pictSize * (Width - SB * 2) define BgOpTop : SymbolMid + para.bgopSize * (Width - SB * 2) define BgOpBot : SymbolMid - para.bgopSize * (Width - SB * 2) + define BgTkTop : SymbolMid + para.bgtkSize * (Width - SB * 2) + define BgTkBot : SymbolMid - para.bgtkSize * (Width - SB * 2) define Contrast : fallback para.contrast 1 @@ -75,8 +77,8 @@ export : define [calculateMetrics para] : begin # Weight Control # We will estimate blackness using lower-case 'e' - define DarknessMockWidth : if (Width < HalfUPM) (HalfUPM * [Math.pow (Width / HalfUPM) 0.5]) Width - define DarknessMockWidth2 : HalfUPM * [Math.pow (Width / HalfUPM) 0.5] + define DarknessMockWidth : if (Width < HalfUPM) (HalfUPM * [Math.sqrt : Width / HalfUPM]) Width + define DarknessMockWidth2 : HalfUPM * [Math.sqrt : Width / HalfUPM] define [BaseFillRate con] : 1 / 2 + para.stroke / ([Math.max HalfUPM DarknessMockWidth2] - SB * 2) define [InverseCrowdedness con cow] : [Math.tanh (cow * [Math.sqrt con])] / (cow * [Math.sqrt con]) define [advicestrokeImpl con cow div mul] : begin @@ -188,12 +190,12 @@ export : define [calculateMetrics para] : begin return [object 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 + BgOpBot BgTkTop BgTkBot 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 compositeBaseAnchors AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke diff --git a/packages/font-glyphs/src/meta/macros.ptl b/packages/font-glyphs/src/meta/macros.ptl index 7a6dbca013..fb21c142b4 100644 --- a/packages/font-glyphs/src/meta/macros.ptl +++ b/packages/font-glyphs/src/meta/macros.ptl @@ -270,19 +270,19 @@ 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 AdviceGlottalStopArchDepth - StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust MidJutSide MidJutCenter - compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV NarrowUnicodeT WideUnicodeT - VERY-FAR TINY] + PictTop PictBot BgOpTop BgOpBot BgTkTop BgTkBot 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 + AdviceGlottalStopArchDepth StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust + MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV + NarrowUnicodeT WideUnicodeT VERY-FAR TINY] define spiroFnImports `[g4 g2 corner flat curl virt close end straight g2c cg2 flatc ccurl widths disable-contrast heading unimportant important alsoThru alsoThruThem bezControls quadControls archv arcvh dispiro spiro-outline spiro-collect] diff --git a/packages/font-glyphs/src/symbol/arrow.ptl b/packages/font-glyphs/src/symbol/arrow.ptl index fe9f088842..de66db8620 100644 --- a/packages/font-glyphs/src/symbol/arrow.ptl +++ b/packages/font-glyphs/src/symbol/arrow.ptl @@ -9,7 +9,7 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1 glyph-block-import Common-Derivatives glyph-block-import Symbol-Geometric-Shared : GeometricDim UnicodeWeightGrade GeometricSizes - define arrowHeight : para.arrowHeight * (Width - SB / 2) * [Math.pow MosaicWidthScalar (1 / 3)] + define arrowHeight : para.arrowHeight * (Width - SB / 2) * [Math.cbrt MosaicWidthScalar] define arrowWidth : Math.min (MosaicWidth - SB / 2) arrowHeight define arrowTop : SymbolMid + arrowHeight / 2 define arrowBot : SymbolMid - arrowHeight / 2 @@ -18,7 +18,7 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1 define arrowRSB : MosaicWidth - arrowSB define o : O * 2 - define arrowHeadSize : (Width - SB) * DesignParameters.arrow_size * [Math.pow (arrowWidth / Width) 0.5] - [AdviceStroke 5] / 4 + define arrowHeadSize : (Width - SB) * DesignParameters.arrow_size * [Math.sqrt : arrowWidth / Width] - [AdviceStroke 5] / 4 define arrowSw OperatorStroke define halfArrowSw : arrowSw / 2 define bendArrowHeadSize : mix arrowSw arrowHeadSize 0.75 @@ -1492,4 +1492,4 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1 include : FlipAround arrowMidX SymbolMid if (MosaicWidthScalar == 1) : begin - glyph-block-export ArrowShape + glyph-block-export ArrowShape ArrowHead ArrowBar diff --git a/packages/font-glyphs/src/symbol/math/apl.ptl b/packages/font-glyphs/src/symbol/math/apl.ptl index 02b1156075..ef82200c5f 100644 --- a/packages/font-glyphs/src/symbol/math/apl.ptl +++ b/packages/font-glyphs/src/symbol/math/apl.ptl @@ -70,9 +70,9 @@ glyph-block Symbol-Math-APL : begin create-glyph 'apl/iBar' 0x2336 : glyph-proc local l [mix 0 SB (1 / 3)] local r [mix Width RightSB (1 / 3)] - include : HBar.t l r OperTop OperatorStroke - include : HBar.b l r OperBot OperatorStroke - include : VBar.m Middle OperTop OperBot OperatorStroke + include : HBar.t l r TackTop OperatorStroke + include : HBar.b l r TackBot OperatorStroke + include : VBar.m Middle TackTop TackBot OperatorStroke create-glyph 'apl/squish' 0x2337 : glyph-proc local l : mix SB RightSB (1 / 8) @@ -110,8 +110,8 @@ glyph-block Symbol-Math-APL : begin create-glyph 'apl/minus' : glyph-proc include : dispiro widths.center aplBoxSW - flat RightSB [mix OperTop OperBot 0.5] - curl SB [mix OperTop OperBot 0.5] + flat RightSB SymbolMid + curl SB SymbolMid create-glyph 'apl/backSlash' : glyph-proc include : dispiro diff --git a/packages/font-glyphs/src/symbol/math/circled.ptl b/packages/font-glyphs/src/symbol/math/circled.ptl index d87c5a6f84..04bf323491 100644 --- a/packages/font-glyphs/src/symbol/math/circled.ptl +++ b/packages/font-glyphs/src/symbol/math/circled.ptl @@ -8,6 +8,7 @@ glyph-block Symbol-Math-Circled : begin glyph-block-import CommonShapes glyph-block-import Common-Derivatives glyph-block-import Symbol-Math-Frame : MathEnclosureSw + glyph-block-import Symbol-Arrow : ArrowHead ArrowBar define [MakeMathCircled u inner] : begin derive-glyphs "mathCircled{\(inner)}" u inner : function [src gr] @@ -93,3 +94,9 @@ glyph-block Symbol-Math-Circled : begin union VBar.m Middle PlusTop (SymbolMid - eqD) eqS HBar.m (SB + eqS) (RightSB - eqS) (SymbolMid - eqD) eqS + + local arrowTop : mix SymbolMid BgOpTop 1.1 + local arrowBot : mix SymbolMid BgOpBot 1.1 + create-glyph 0x29BD : composite-proc [refer-glyph 'mathO'] : union + ArrowHead Middle arrowBot Middle arrowTop ((RightSB - SB) / 2) + ArrowBar Middle arrowBot Middle arrowTop (MathEnclosureSw / 2) diff --git a/packages/font-glyphs/src/symbol/math/large-operators.ptl b/packages/font-glyphs/src/symbol/math/large-operators.ptl index dc7a417765..d816c89666 100644 --- a/packages/font-glyphs/src/symbol/math/large-operators.ptl +++ b/packages/font-glyphs/src/symbol/math/large-operators.ptl @@ -72,11 +72,25 @@ glyph-block Symbol-Math-Large-Operators : for-width-kinds WideWidth1 create-glyph [MangleName 'Top'] [MangleUnicode 0x27D9] : glyph-proc set-width df.width - include : HBar.t df.leftSB df.rightSB BgOpTop OperatorStroke - include : VBar.m df.middle BgOpTop BgOpBot OperatorStroke + include : HBar.t df.leftSB df.rightSB BgTkTop OperatorStroke + include : VBar.m df.middle BgOpTop BgTkBot OperatorStroke turned [MangleName 'Bot'] [MangleUnicode 0x27D8] [MangleName 'Top'] df.middle SymbolMid + # These operators are always wide. In force-monospace variants they will be deleted + if (MosaicWidthScalar > 1 && !para.forceMonospace) : do + define kLongTackSB : [DivFrame MosaicWidthScalar 4].leftSB / [DivFrame MosaicWidthScalar 2].leftSB + + define l : mix 0 SB kLongTackSB + define r : MosaicWidth - l + + create-glyph 'longVDash' 0x27DD : glyph-proc + set-width MosaicWidth + include : HBar.m l r SymbolMid OperatorStroke + include : VBar.l l TackTop TackBot OperatorStroke + + turned 'longDashV' 0x27DE 'longVDash' (MosaicWidth / 2) SymbolMid + create-glyph [MangleName 'SquareCap'] [MangleUnicode 0x2A05] : glyph-proc set-width df.width include : PiShape df BgOpTop BgOpBot (shrinkRate -- 0) (fine -- OperatorStroke) (doSerif -- false) diff --git a/packages/font-glyphs/src/symbol/math/logicals.ptl b/packages/font-glyphs/src/symbol/math/logicals.ptl index 3bbd9abdb8..be1a240262 100644 --- a/packages/font-glyphs/src/symbol/math/logicals.ptl +++ b/packages/font-glyphs/src/symbol/math/logicals.ptl @@ -115,6 +115,32 @@ glyph-block Symbol-Math-Logicals : begin include : HBar.b SB RightSB 0 OperatorStroke include : VBar.m Middle (SymbolMid * 2) 0 OperatorStroke + create-glyph 'turnedTautologyTautology' 0x27DA : glyph-proc + local df : include : DivFrame para.diversityM 4 + local vs : df.mvs * OperatorStroke / Stroke + local innerSB : Math.min (SB * [Math.min (df.div / 1.5) 1]) df.leftSB + local l : Math.max (df.middle - innerSB - vs / 2) : mix df.middle df.leftSB (1 / 3) + local r : Math.min (df.middle + innerSB + vs / 2) : mix df.middle df.rightSB (1 / 3) + local t : mix SymbolMid top (1 / 3) + local b : mix SymbolMid bot (1 / 3) + include : VBar.m l top bot vs + include : VBar.m r top bot vs + include : HBar.m df.leftSB l t OperatorStroke + include : HBar.m df.leftSB l b OperatorStroke + include : HBar.m r df.rightSB t OperatorStroke + include : HBar.m r df.rightSB b OperatorStroke + + create-glyph 'dashvvdash' 0x27DB : glyph-proc + local df : include : DivFrame para.diversityM 4 + local vs : df.mvs * OperatorStroke / Stroke + local innerSB : Math.min (SB * [Math.min (df.div / 1.5) 1]) df.leftSB + local l : Math.max (df.middle - innerSB - vs / 2) : mix df.middle df.leftSB (1 / 3) + local r : Math.min (df.middle + innerSB + vs / 2) : mix df.middle df.rightSB (1 / 3) + include : VBar.m l top bot vs + include : VBar.m r top bot vs + include : HBar.m df.leftSB l SymbolMid OperatorStroke + include : HBar.m r df.rightSB SymbolMid OperatorStroke + create-glyph 'gleichStark' 0x29E6 : glyph-proc local l : mix Middle SB 1 local r : mix Middle RightSB 1 @@ -195,7 +221,7 @@ glyph-block Symbol-Math-Logicals : begin create-glyph 'barRingAbove' 0x2AEF : glyph-proc local sw : AdviceStroke 4 local radius : (RightSB - SB) / 6 - include : VBar.m Middle (top - radius - sw / 2 ) bot OperatorStroke + include : VBar.m Middle (top - radius - sw / 2) bot OperatorStroke include : difference DotAt Middle top (radius + sw) DotAt Middle top radius @@ -209,4 +235,4 @@ glyph-block Symbol-Math-Logicals : begin create-glyph 'interleave' 0x2AF4 : TripleBarShape Middle top bot OperatorStroke - create-glyph 'bigInterleave' 0x2AFC : TripleBarShape Middle ParenTop ParenBot OperatorStroke + create-glyph 'bigInterleave' 0x2AFC : TripleBarShape Middle BgTkTop BgTkBot OperatorStroke diff --git a/packages/font/src/derive-spacing.mjs b/packages/font/src/derive-spacing.mjs index ff8f033a71..f55178668a 100644 --- a/packages/font/src/derive-spacing.mjs +++ b/packages/font/src/derive-spacing.mjs @@ -73,6 +73,8 @@ async function deriveTerm(font) { // Drop the following "long" characters. async function deriveFixed_DropWideChars(font) { const longCharCodes = [ + 0x27dd, // LONG RIGHT TACK + 0x27de, // LONG LEFT TACK 0x27f5, // LONG LEFTWARDS ARROW 0x27f6, // LONG RIGHTWARDS ARROW 0x27f7, // LONG LEFT RIGHT ARROW diff --git a/params/parameters.toml b/params/parameters.toml index 46de1f28e4..cc02f1bc2d 100644 --- a/params/parameters.toml +++ b/params/parameters.toml @@ -24,6 +24,7 @@ parenSize = 966 # Size of parens, brackets, braces, slashes, etc. operSize = 0.80 # Size of mathematical operators (cups, etc.) tackSize = 0.80 # Size of logical operators (tacks, etc.) bgopSize = 1.10 # Size of "taller" mathematical operators +bgtkSize = 1.10 # Size of "taller" logical operators plusSize = 0.52 # Size of plus and arith symbols pictSize = 1.10 # Size of pictograms arrowHeight = 1.50 # Height of arrows From 0b228775543ace87fd22ca4033491dd5df8f8d89 Mon Sep 17 00:00:00 2001 From: jmcwilliams403 Date: Tue, 15 Oct 2024 16:01:20 -0400 Subject: [PATCH 2/2] cleanup. --- packages/font-glyphs/src/symbol/math/large-operators.ptl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/font-glyphs/src/symbol/math/large-operators.ptl b/packages/font-glyphs/src/symbol/math/large-operators.ptl index d816c89666..3acdfa43f7 100644 --- a/packages/font-glyphs/src/symbol/math/large-operators.ptl +++ b/packages/font-glyphs/src/symbol/math/large-operators.ptl @@ -73,7 +73,7 @@ glyph-block Symbol-Math-Large-Operators : for-width-kinds WideWidth1 create-glyph [MangleName 'Top'] [MangleUnicode 0x27D9] : glyph-proc set-width df.width include : HBar.t df.leftSB df.rightSB BgTkTop OperatorStroke - include : VBar.m df.middle BgOpTop BgTkBot OperatorStroke + include : VBar.m df.middle BgTkTop BgTkBot OperatorStroke turned [MangleName 'Bot'] [MangleUnicode 0x27D8] [MangleName 'Top'] df.middle SymbolMid