Add five mathematic/logical characters. (#2551)

* Add five mathematic/logical characters.

* cleanup.
This commit is contained in:
John McWilliams 2024-10-15 23:09:28 -04:00 committed by GitHub
parent 55a57a2258
commit 2386643d1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 93 additions and 33 deletions

6
changes/31.9.2.md Normal file
View file

@ -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`).

View file

@ -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: - `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. - Completely remove wide glyphs. All non-combining glyphs will be exactly the same width.
- As a consequence, the following characters will be **removed**: - 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+27F5` LONG LEFTWARDS ARROW
- `U+27F6` LONG RIGHTWARDS ARROW - `U+27F6` LONG RIGHTWARDS ARROW
- `U+27F7` LONG LEFT RIGHT ARROW - `U+27F7` LONG LEFT RIGHT ARROW

View file

@ -32,6 +32,8 @@ export : define [calculateMetrics para] : begin
define PictBot : SymbolMid - para.pictSize * (Width - SB * 2) define PictBot : SymbolMid - para.pictSize * (Width - SB * 2)
define BgOpTop : SymbolMid + para.bgopSize * (Width - SB * 2) define BgOpTop : SymbolMid + para.bgopSize * (Width - SB * 2)
define BgOpBot : 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 define Contrast : fallback para.contrast 1
@ -75,8 +77,8 @@ export : define [calculateMetrics para] : begin
# Weight Control # Weight Control
# We will estimate blackness using lower-case 'e' # We will estimate blackness using lower-case 'e'
define DarknessMockWidth : if (Width < HalfUPM) (HalfUPM * [Math.pow (Width / HalfUPM) 0.5]) Width define DarknessMockWidth : if (Width < HalfUPM) (HalfUPM * [Math.sqrt : Width / HalfUPM]) Width
define DarknessMockWidth2 : HalfUPM * [Math.pow (Width / HalfUPM) 0.5] define DarknessMockWidth2 : HalfUPM * [Math.sqrt : Width / HalfUPM]
define [BaseFillRate con] : 1 / 2 + para.stroke / ([Math.max HalfUPM DarknessMockWidth2] - SB * 2) 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 [InverseCrowdedness con cow] : [Math.tanh (cow * [Math.sqrt con])] / (cow * [Math.sqrt con])
define [advicestrokeImpl con cow div mul] : begin define [advicestrokeImpl con cow div mul] : begin
@ -188,12 +190,12 @@ export : define [calculateMetrics para] : begin
return [object return [object
DesignParameters UPM HalfUPM Width SB CAP XH Ascender Descender Contrast SymbolMid DesignParameters UPM HalfUPM Width SB CAP XH Ascender Descender Contrast SymbolMid
ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot PictTop PictBot BgOpTop
BgOpBot Italify Upright Scale Translate ApparentTranslate Rotate GlobalTransform TanSlope BgOpBot BgTkTop BgTkBot Italify Upright Scale Translate ApparentTranslate Rotate
HVContrast Upward Downward Rightward Leftward O OX OXHook Hook AHook SHook RHook JHook GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward O OX OXHook Hook
HookX TailX TailY ArchDepth SmallArchDepth Stroke DotSize PeriodSize HBarPos OverlayPos AHook SHook RHook JHook HookX TailX TailY ArchDepth SmallArchDepth Stroke DotSize PeriodSize
LongJut Jut VJut VJutStroke AccentStackOffset AccentWidth AccentClearance AccentHeight HBarPos OverlayPos LongJut Jut VJut VJutStroke AccentStackOffset AccentWidth AccentClearance
CThin CThinB SLAB IBalance IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance AccentHeight CThin CThinB SLAB IBalance IBalance2 JBalance JBalance2 TBalance TBalance2
RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 RBalance RBalance2 FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4
EssUpper EssLower EssQuestion HalfStroke RightSB Middle DotRadius PeriodRadius SideJut EssUpper EssLower EssQuestion HalfStroke RightSB Middle DotRadius PeriodRadius SideJut
ArchDepthA ArchDepthB SmallArchDepthA SmallArchDepthB CorrectionOMidX CorrectionOMidS ArchDepthA ArchDepthB SmallArchDepthA SmallArchDepthB CorrectionOMidX CorrectionOMidS
compositeBaseAnchors AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke compositeBaseAnchors AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke

View file

@ -270,19 +270,19 @@ define-macro glyph-block : syntax-rules
define metricImports `[DesignParameters UPM HalfUPM Width SB CAP XH Ascender Descender define metricImports `[DesignParameters UPM HalfUPM Width SB CAP XH Ascender Descender
Contrast SymbolMid ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot Contrast SymbolMid ParenTop ParenBot OperTop OperBot TackTop TackBot PlusTop PlusBot
PictTop PictBot BgOpTop BgOpBot Italify Upright Scale Translate ApparentTranslate Rotate PictTop PictBot BgOpTop BgOpBot BgTkTop BgTkBot Italify Upright Scale Translate
GlobalTransform TanSlope HVContrast Upward Downward Rightward Leftward O OX OXHook Hook ApparentTranslate Rotate GlobalTransform TanSlope HVContrast Upward Downward Rightward
AHook SHook RHook JHook HookX TailX TailY ArchDepth SmallArchDepth Stroke DotSize Leftward O OX OXHook Hook AHook SHook RHook JHook HookX TailX TailY ArchDepth
PeriodSize HBarPos OverlayPos LongJut Jut VJut VJutStroke AccentStackOffset AccentWidth SmallArchDepth Stroke DotSize PeriodSize HBarPos OverlayPos LongJut Jut VJut
AccentClearance AccentHeight CThin CThinB SLAB IBalance IBalance2 JBalance JBalance2 VJutStroke AccentStackOffset AccentWidth AccentClearance AccentHeight CThin CThinB
TBalance TBalance2 RBalance RBalance2 FBalance OneBalance WideWidth0 WideWidth1 SLAB IBalance IBalance2 JBalance JBalance2 TBalance TBalance2 RBalance RBalance2
WideWidth2 WideWidth3 WideWidth4 EssUpper EssLower EssQuestion HalfStroke RightSB FBalance OneBalance WideWidth0 WideWidth1 WideWidth2 WideWidth3 WideWidth4 EssUpper
Middle DotRadius PeriodRadius SideJut ArchDepthA ArchDepthB SmallArchDepthA EssLower EssQuestion HalfStroke RightSB Middle DotRadius PeriodRadius SideJut
SmallArchDepthB CorrectionOMidX CorrectionOMidS AdviceStroke AdviceStroke2 ArchDepthA ArchDepthB SmallArchDepthA SmallArchDepthB CorrectionOMidX CorrectionOMidS
OverlayStroke OperatorStroke GeometryStroke ShoulderFine AdviceGlottalStopArchDepth AdviceStroke AdviceStroke2 OverlayStroke OperatorStroke GeometryStroke ShoulderFine
StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust MidJutSide MidJutCenter AdviceGlottalStopArchDepth StrokeWidthBlend ArchDepthAOf ArchDepthBOf SmoothAdjust
compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV NarrowUnicodeT WideUnicodeT MidJutSide MidJutCenter compositeBaseAnchors YSmoothMidR YSmoothMidL HSwToV
VERY-FAR TINY] NarrowUnicodeT WideUnicodeT VERY-FAR TINY]
define spiroFnImports `[g4 g2 corner flat curl virt close end straight g2c cg2 flatc ccurl define spiroFnImports `[g4 g2 corner flat curl virt close end straight g2c cg2 flatc ccurl
widths disable-contrast heading unimportant important alsoThru alsoThruThem bezControls widths disable-contrast heading unimportant important alsoThru alsoThruThem bezControls
quadControls archv arcvh dispiro spiro-outline spiro-collect] quadControls archv arcvh dispiro spiro-outline spiro-collect]

View file

@ -9,7 +9,7 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1
glyph-block-import Common-Derivatives glyph-block-import Common-Derivatives
glyph-block-import Symbol-Geometric-Shared : GeometricDim UnicodeWeightGrade GeometricSizes 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 arrowWidth : Math.min (MosaicWidth - SB / 2) arrowHeight
define arrowTop : SymbolMid + arrowHeight / 2 define arrowTop : SymbolMid + arrowHeight / 2
define arrowBot : 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 arrowRSB : MosaicWidth - arrowSB
define o : O * 2 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 arrowSw OperatorStroke
define halfArrowSw : arrowSw / 2 define halfArrowSw : arrowSw / 2
define bendArrowHeadSize : mix arrowSw arrowHeadSize 0.75 define bendArrowHeadSize : mix arrowSw arrowHeadSize 0.75
@ -1492,4 +1492,4 @@ glyph-block Symbol-Arrow : for-width-kinds WideWidth1
include : FlipAround arrowMidX SymbolMid include : FlipAround arrowMidX SymbolMid
if (MosaicWidthScalar == 1) : begin if (MosaicWidthScalar == 1) : begin
glyph-block-export ArrowShape glyph-block-export ArrowShape ArrowHead ArrowBar

View file

@ -70,9 +70,9 @@ glyph-block Symbol-Math-APL : begin
create-glyph 'apl/iBar' 0x2336 : glyph-proc create-glyph 'apl/iBar' 0x2336 : glyph-proc
local l [mix 0 SB (1 / 3)] local l [mix 0 SB (1 / 3)]
local r [mix Width RightSB (1 / 3)] local r [mix Width RightSB (1 / 3)]
include : HBar.t l r OperTop OperatorStroke include : HBar.t l r TackTop OperatorStroke
include : HBar.b l r OperBot OperatorStroke include : HBar.b l r TackBot OperatorStroke
include : VBar.m Middle OperTop OperBot OperatorStroke include : VBar.m Middle TackTop TackBot OperatorStroke
create-glyph 'apl/squish' 0x2337 : glyph-proc create-glyph 'apl/squish' 0x2337 : glyph-proc
local l : mix SB RightSB (1 / 8) local l : mix SB RightSB (1 / 8)
@ -110,8 +110,8 @@ glyph-block Symbol-Math-APL : begin
create-glyph 'apl/minus' : glyph-proc create-glyph 'apl/minus' : glyph-proc
include : dispiro include : dispiro
widths.center aplBoxSW widths.center aplBoxSW
flat RightSB [mix OperTop OperBot 0.5] flat RightSB SymbolMid
curl SB [mix OperTop OperBot 0.5] curl SB SymbolMid
create-glyph 'apl/backSlash' : glyph-proc create-glyph 'apl/backSlash' : glyph-proc
include : dispiro include : dispiro

View file

@ -8,6 +8,7 @@ glyph-block Symbol-Math-Circled : begin
glyph-block-import CommonShapes glyph-block-import CommonShapes
glyph-block-import Common-Derivatives glyph-block-import Common-Derivatives
glyph-block-import Symbol-Math-Frame : MathEnclosureSw glyph-block-import Symbol-Math-Frame : MathEnclosureSw
glyph-block-import Symbol-Arrow : ArrowHead ArrowBar
define [MakeMathCircled u inner] : begin define [MakeMathCircled u inner] : begin
derive-glyphs "mathCircled{\(inner)}" u inner : function [src gr] derive-glyphs "mathCircled{\(inner)}" u inner : function [src gr]
@ -93,3 +94,9 @@ glyph-block Symbol-Math-Circled : begin
union union
VBar.m Middle PlusTop (SymbolMid - eqD) eqS VBar.m Middle PlusTop (SymbolMid - eqD) eqS
HBar.m (SB + eqS) (RightSB - eqS) (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)

View file

@ -72,11 +72,25 @@ glyph-block Symbol-Math-Large-Operators : for-width-kinds WideWidth1
create-glyph [MangleName 'Top'] [MangleUnicode 0x27D9] : glyph-proc create-glyph [MangleName 'Top'] [MangleUnicode 0x27D9] : glyph-proc
set-width df.width set-width df.width
include : HBar.t df.leftSB df.rightSB BgOpTop OperatorStroke include : HBar.t df.leftSB df.rightSB BgTkTop OperatorStroke
include : VBar.m df.middle BgOpTop BgOpBot OperatorStroke include : VBar.m df.middle BgTkTop BgTkBot OperatorStroke
turned [MangleName 'Bot'] [MangleUnicode 0x27D8] [MangleName 'Top'] df.middle SymbolMid 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 create-glyph [MangleName 'SquareCap'] [MangleUnicode 0x2A05] : glyph-proc
set-width df.width set-width df.width
include : PiShape df BgOpTop BgOpBot (shrinkRate -- 0) (fine -- OperatorStroke) (doSerif -- false) include : PiShape df BgOpTop BgOpBot (shrinkRate -- 0) (fine -- OperatorStroke) (doSerif -- false)

View file

@ -115,6 +115,32 @@ glyph-block Symbol-Math-Logicals : begin
include : HBar.b SB RightSB 0 OperatorStroke include : HBar.b SB RightSB 0 OperatorStroke
include : VBar.m Middle (SymbolMid * 2) 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 create-glyph 'gleichStark' 0x29E6 : glyph-proc
local l : mix Middle SB 1 local l : mix Middle SB 1
local r : mix Middle RightSB 1 local r : mix Middle RightSB 1
@ -195,7 +221,7 @@ glyph-block Symbol-Math-Logicals : begin
create-glyph 'barRingAbove' 0x2AEF : glyph-proc create-glyph 'barRingAbove' 0x2AEF : glyph-proc
local sw : AdviceStroke 4 local sw : AdviceStroke 4
local radius : (RightSB - SB) / 6 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 include : difference
DotAt Middle top (radius + sw) DotAt Middle top (radius + sw)
DotAt Middle top radius 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 '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

View file

@ -73,6 +73,8 @@ async function deriveTerm(font) {
// Drop the following "long" characters. // Drop the following "long" characters.
async function deriveFixed_DropWideChars(font) { async function deriveFixed_DropWideChars(font) {
const longCharCodes = [ const longCharCodes = [
0x27dd, // LONG RIGHT TACK
0x27de, // LONG LEFT TACK
0x27f5, // LONG LEFTWARDS ARROW 0x27f5, // LONG LEFTWARDS ARROW
0x27f6, // LONG RIGHTWARDS ARROW 0x27f6, // LONG RIGHTWARDS ARROW
0x27f7, // LONG LEFT RIGHT ARROW 0x27f7, // LONG LEFT RIGHT ARROW

View file

@ -24,6 +24,7 @@ parenSize = 966 # Size of parens, brackets, braces, slashes, etc.
operSize = 0.80 # Size of mathematical operators (cups, etc.) operSize = 0.80 # Size of mathematical operators (cups, etc.)
tackSize = 0.80 # Size of logical operators (tacks, etc.) tackSize = 0.80 # Size of logical operators (tacks, etc.)
bgopSize = 1.10 # Size of "taller" mathematical operators 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 plusSize = 0.52 # Size of plus and arith symbols
pictSize = 1.10 # Size of pictograms pictSize = 1.10 # Size of pictograms
arrowHeight = 1.50 # Height of arrows arrowHeight = 1.50 # Height of arrows