More math symbols including double cup/cap/subst/supst

This commit is contained in:
be5invis 2020-08-03 22:00:08 -07:00
parent 0491902851
commit b4c770f37f
6 changed files with 111 additions and 72 deletions

View file

@ -91,25 +91,16 @@ module.exports = function () {
ascii: true ascii: true
} }
}, },
name: {
fontFamily: "node-sfnt",
fontSubFamily: "regular",
fullName: "node-sfnt",
postScriptName: "node-sfnt",
uniqueSubFamily: "node-sfnt blank font",
version: "Version 1.0"
},
post: { post: {
version: 2, version: 2,
isFixedPitch: false, isFixedPitch: false,
italicAngle: 0, italicAngle: 0,
maxMemType1: 1, underlinePosition: -50,
underlineThickness: 50,
minMemType42: 0,
maxMemType42: 0, maxMemType42: 0,
minMemType1: 0, minMemType1: 0,
minMemType42: 0, maxMemType1: 0
postoints: 65411,
underlinePosition: -50,
underlineThickness: 50
}, },
maxp: { maxp: {
version: 1.0, version: 1.0,

View file

@ -24,6 +24,8 @@ glyph-block CommonShapes : begin
local {.x mx1 .y my1} : globalTransform.apply {.x mx .y my} local {.x mx1 .y my1} : globalTransform.apply {.x mx .y my}
include : Translate (mx1 - mx) (my1 - my) include : Translate (mx1 - mx) (my1 - my)
define [SquareAt x y r] : Rect (y + r) (y - r) (x - r) (x + r)
define [Ring u d l r transformShiftOnly] : new-glyph : glyph-proc define [Ring u d l r transformShiftOnly] : new-glyph : glyph-proc
local my ((u + d) / 2) local my ((u + d) / 2)
local mx ((l + r) / 2) local mx ((l + r) / 2)
@ -654,4 +656,4 @@ glyph-block CommonShapes : begin
set currentGlyph.markAnchors {.} set currentGlyph.markAnchors {.}
set currentGlyph.markBnchors {.} set currentGlyph.markBnchors {.}
glyph-block-export Rect Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar FlatSlashShape hookstart hookend CyrDescender FlipAround ScaleAround Realign ForceUpright diagCor CreateWaveShape NameUni PointingTo WithAIHSerifsMask WithTransform ReverseContours clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape glyph-block-export Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar FlatSlashShape hookstart hookend CyrDescender FlipAround ScaleAround Realign ForceUpright diagCor CreateWaveShape NameUni PointingTo WithAIHSerifsMask WithTransform ReverseContours clear-anchors OBarLeftToothlessShape OBarLeftRoundedShape OBarRightToothlessShape OBarRightRoundedShape

View file

@ -3829,16 +3829,16 @@ glyph-block Letter-Latin-Upper-U : begin
glyph-block-import Overmarks glyph-block-import Overmarks
glyph-block-export UShape glyph-block-export UShape
define [UShape df top bottom stroke oper] : glyph-proc define [UShape] : params [df top bottom [stroke Stroke] [sma SmoothA] [smb SmoothB] [offset 0] oper] : glyph-proc
include : dispiro include : dispiro
widths.lhs stroke widths.lhs stroke
flat df.leftSB top [heading Downward] flat (df.leftSB + offset) top [heading Downward]
curl df.leftSB (bottom + SmoothB * [Math.sqrt df.div]) curl (df.leftSB + offset) (bottom + smb + offset)
arcvh arcvh
g4 (df.middle + CorrectionOMidS) (bottom + O) g4 (df.middle + CorrectionOMidX * stroke) (bottom + O + offset)
archv archv
flat df.rightSB (bottom + SmoothA * [Math.sqrt df.div]) flat (df.rightSB - offset) (bottom + sma + offset)
curl df.rightSB top [heading Upward] curl (df.rightSB - offset) top [heading Upward]
if [not oper] : include : AIVSerifs top if [not oper] : include : AIVSerifs top
create-glyph 'U' 'U' : glyph-proc create-glyph 'U' 'U' : glyph-proc

View file

@ -240,15 +240,18 @@ glyph-block Symbol-Math-Arith : begin
HBar left right symbolMid [fallback sw OperatorStroke] HBar left right symbolMid [fallback sw OperatorStroke]
VBar (Middle + [fallback s 0]) plusTop plusBot [fallback sw OperatorStroke] VBar (Middle + [fallback s 0]) plusTop plusBot [fallback sw OperatorStroke]
create-glyph 'plus' '+' : glyph-proc # plus create-glyph 'plus' '+' : PlusShape SB RightSB
include : PlusShape SB RightSB create-glyph 'minus' 0x2212 : HBar SB RightSB symbolMid OperatorStroke
create-glyph 'innerPlus' : glyph-proc # plus create-glyph 'innerPlus' : PlusShape SB RightSB 0 GeometryStroke
include : PlusShape SB RightSB 0 GeometryStroke create-glyph 'innerMinus' : HBar SB RightSB symbolMid GeometryStroke
create-glyph 'minus' 0x2212 : glyph-proc # minus create-glyph 'minusDot' 0x2238 : composite-proc [refer-glyph 'minus']
include : HBar SB RightSB symbolMid OperatorStroke DotAt Middle plusTop DotRadius
create-derived 'minusDot' 0x2238 : DotAt Middle plusTop DotRadius
create-glyph 'hermetianConjugateMatrixPlus' 0x22B9 : difference
PlusShape SB RightSB
SquareAt Middle symbolMid DotRadius
create-glyph 'minusColon' 0x2239 : glyph-proc # colon-equal create-glyph 'minusColon' 0x2239 : glyph-proc # colon-equal
include : refer-glyph "baselineDot" include : refer-glyph "baselineDot"
@ -263,8 +266,6 @@ glyph-block Symbol-Math-Arith : begin
include : HBar (SB * sbSquash) (RightSB - DotSize) symbolMid OperatorStroke include : HBar (SB * sbSquash) (RightSB - DotSize) symbolMid OperatorStroke
create-glyph 'innerMinus' : glyph-proc # innerMinus
include : HBar SB RightSB symbolMid GeometryStroke
create-glyph 'plusminus' 0xB1 : glyph-proc # plusminus create-glyph 'plusminus' 0xB1 : glyph-proc # plusminus
include : HBarBottom SB RightSB 0 OperatorStroke include : HBarBottom SB RightSB 0 OperatorStroke
@ -579,41 +580,60 @@ glyph-block Symbol-Math-VAndCup : begin
turned 'doubleWedge' 0x2A53 'doubleVee' Middle symbolMid turned 'doubleWedge' 0x2A53 'doubleVee' Middle symbolMid
create-glyph 'cup' 0x222A : glyph-proc # cup create-glyph 'cup' 0x222A : glyph-proc # cup
include : UShape [DivFrame 1] operTop operBot OperatorStroke true include : UShape [DivFrame 1] operTop operBot
oper -- true
stroke -- OperatorStroke
create-derived 'cupDot' 0x228D : glyph-proc create-glyph 'cupDot' 0x228D : glyph-proc
include : DotAt Middle (operBot + Smooth) [Math.min DotRadius ((RightSB - SB - OperatorStroke * HVContrast * 2) * (1 / 3))] include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
include : DotAt Middle (operBot + Smooth) [Math.min DotRadius ((RightSB - SB - OperatorStroke * HVContrast * 2) * (1 / 3))]
create-derived 'cupArrowLeft' 0x228C : glyph-proc create-glyph 'cupArrowLeft' 0x228C : glyph-proc
local mockUpscale : OperatorStroke / [adviceBlackness 6] include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
local arrowLength : mockUpscale * [Math.min (RightSB - SB - OperatorStroke * HVContrast * 2) (Width * 0.6)] local mockUpscale : OperatorStroke / [adviceBlackness 6]
include : new-glyph : glyph-proc local arrowLength : mockUpscale * [Math.min (RightSB - SB - OperatorStroke * HVContrast * 2) (Width * 0.6)]
include : ArrowShape include : new-glyph : glyph-proc
Middle + arrowLength / 2 include : ArrowShape
operBot + Smooth Middle + arrowLength / 2
Middle - arrowLength / 2 operBot + Smooth
operBot + Smooth Middle - arrowLength / 2
arrowLength * 0.5 operBot + Smooth
include : Upright arrowLength * 0.5
include : Translate (-Middle) (-operBot - Smooth) include : Upright
include : Scale (1 / mockUpscale) (1 / mockUpscale) include : Translate (-Middle) (-operBot - Smooth)
include : Translate Middle (operBot + Smooth) include : Scale (1 / mockUpscale) (1 / mockUpscale)
include : Italify include : Translate Middle (operBot + Smooth)
include : Italify
create-derived 'cupPlus' 0x228E : glyph-proc create-glyph 'cupPlus' 0x228E : glyph-proc
local sw : adviceBlackness 6 include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
local size : Math.min (RightSB - SB - OperatorStroke * HVContrast * (2 + 0.5 * sw / OperatorStroke)) ((RightSB - SB) * 0.8) local sw : adviceBlackness 6
include : dispiro local size : Math.min (RightSB - SB - OperatorStroke * HVContrast * (2 + 0.5 * sw / OperatorStroke)) ((RightSB - SB) * 0.8)
widths.center sw include : dispiro
corner (Middle - size / 2) (operBot + Smooth) widths.center sw
corner (Middle + size / 2) (operBot + Smooth) corner (Middle - size / 2) (operBot + Smooth)
include : dispiro corner (Middle + size / 2) (operBot + Smooth)
widths.center sw include : dispiro
corner Middle (operBot + Smooth - size / 2) widths.center sw
corner Middle (operBot + Smooth + size / 2) corner Middle (operBot + Smooth - size / 2)
corner Middle (operBot + Smooth + size / 2)
create-glyph 'doubleCup' 0x22D3 : glyph-proc
local sw : adviceBlackness 6.5
local gap : Math.max (Width / 8) (sw / 2)
include : UShape [DivFrame 1] operTop operBot
oper -- true
stroke -- sw
include : UShape [DivFrame 1] operTop operBot
oper -- true
stroke -- sw
offset -- (sw + gap)
sma -- [SmoothAOf (Smooth - sw - gap) Width]
smb -- [SmoothBOf (Smooth - sw - gap) Width]
turned 'cap' 0x2229 'cup' Middle symbolMid turned 'cap' 0x2229 'cup' Middle symbolMid
turned 'capDot' 0x2A40 'cupDot' Middle symbolMid turned 'capDot' 0x2A40 'cupDot' Middle symbolMid
turned 'doubleCap' 0x22D2 'doubleCup' Middle symbolMid
create-glyph 'squareCap' 0x2293 : glyph-proc # squareCap create-glyph 'squareCap' 0x2293 : glyph-proc # squareCap
include : PiShape operTop operBot (shrinkrate -- 0) (_fine -- OperatorStroke) (div -- 1) (noSerif -- true) include : PiShape operTop operBot (shrinkrate -- 0) (_fine -- OperatorStroke) (div -- 1) (noSerif -- true)
@ -745,6 +765,10 @@ glyph-block Symbol-Math-Relation : begin
create-glyph 'equal' '=' : glyph-proc create-glyph 'equal' '=' : glyph-proc
include : EqualShape SB RightSB include : EqualShape SB RightSB
create-glyph 'equalParallel' 0x22D5 : composite-proc
refer-glyph 'equal'
refer-glyph 'parallel.naturalSlope'
create-glyph 'oneDotApproxEq' 0x2250 : glyph-proc create-glyph 'oneDotApproxEq' 0x2250 : glyph-proc
include : refer-glyph 'equal' include : refer-glyph 'equal'
include : DotAt Middle (symbolMid + EqualHalfSpace * 2.5) DotRadius include : DotAt Middle (symbolMid + EqualHalfSpace * 2.5) DotRadius
@ -941,12 +965,20 @@ glyph-block Symbol-Math-Relation : begin
create-glyph 'less' '<' : glyph-proc create-glyph 'less' '<' : glyph-proc
include : LessShape (symbolMid + dH) (symbolMid - dH) SB RightSB include : LessShape (symbolMid + dH) (symbolMid - dH) SB RightSB
create-glyph 'lessDot' 0x22D6 : composite-proc
LessShape (symbolMid + dH) (symbolMid - dH) SB RightSB [adviceBlackness 4]
DotAt (RightSB - DotRadius) symbolMid (DotRadius * [adviceBlackness 4] / Stroke)
create-glyph 'normalSubsetOf' 0x22B2 : glyph-proc create-glyph 'normalSubsetOf' 0x22B2 : glyph-proc
include : NormalSubsetShape (symbolMid + dH) (symbolMid - dH) SB RightSB include : NormalSubsetShape (symbolMid + dH) (symbolMid - dH) SB RightSB
create-glyph 'greater' '>' : glyph-proc create-glyph 'greater' '>' : glyph-proc
include : GreaterShape (symbolMid + dH) (symbolMid - dH) SB RightSB include : GreaterShape (symbolMid + dH) (symbolMid - dH) SB RightSB
create-glyph 'greaterDot' 0x22D7 : composite-proc
GreaterShape (symbolMid + dH) (symbolMid - dH) SB RightSB [adviceBlackness 4]
DotAt (SB + DotRadius) symbolMid (DotRadius * [adviceBlackness 4] / Stroke)
create-glyph 'normalSupersetOf' 0x22B3 : glyph-proc create-glyph 'normalSupersetOf' 0x22B3 : glyph-proc
include : NormalSupersetShape (symbolMid + dH) (symbolMid - dH) SB RightSB include : NormalSupersetShape (symbolMid + dH) (symbolMid - dH) SB RightSB
@ -1164,15 +1196,15 @@ glyph-block Symbol-Math-Relation : begin
include : HBar SB RightSB (symbolMid - sympShift / 2 + EqualHalfSpace * 1.5) OperatorStroke include : HBar SB RightSB (symbolMid - sympShift / 2 + EqualHalfSpace * 1.5) OperatorStroke
include : HBar SB RightSB (symbolMid - sympShift / 2) OperatorStroke include : HBar SB RightSB (symbolMid - sympShift / 2) OperatorStroke
define [SubsetShape top bot sw] : dispiro define [SubsetShape] : params [top bot [sw OperatorStroke] [offset 0]] : dispiro
widths.lhs [fallback sw OperatorStroke] widths.lhs sw
flat RightSB top [heading Leftward] flat RightSB (top - offset) [heading Leftward]
curl (SB + (top - bot) / 2) top curl (SB + offset + (top - bot) / 2 - offset) (top - offset)
archv archv
g4 SB [mix top bot 0.5] g4 (SB + offset) [mix top bot 0.5]
arcvh arcvh
flat (SB + (top - bot) / 2) bot flat (SB + offset + (top - bot) / 2 - offset) (bot + offset)
curl RightSB bot [heading Rightward] curl RightSB (bot + offset) [heading Rightward]
define [PrefixShape top bot sw] : union define [PrefixShape top bot sw] : union
VBarLeft SB bot top [fallback sw OperatorStroke] VBarLeft SB bot top [fallback sw OperatorStroke]
@ -1187,10 +1219,16 @@ glyph-block Symbol-Math-Relation : begin
include : PrefixShape top bot sw include : PrefixShape top bot sw
include : FlipAround Middle [mix top bot 0.5] include : FlipAround Middle [mix top bot 0.5]
create-glyph 'subst' 0x2282 : glyph-proc # subst create-glyph 'subst' 0x2282 : SubsetShape (symbolMid + dH) (symbolMid - dH)
include : SubsetShape (symbolMid + dH) (symbolMid - dH) create-glyph 'doubleSubst' 0x22D0 : glyph-proc
create-glyph 'supst' 0x2283 : glyph-proc # supst local sw : adviceBlackness 6.5
include : SupsetShape (symbolMid + dH) (symbolMid - dH) local gap : Math.max (Width / 8) (sw / 2)
include : SubsetShape (symbolMid + dH) (symbolMid - dH) (sw -- sw)
include : SubsetShape (symbolMid + dH) (symbolMid - dH) (sw -- sw) (offset -- gap + sw)
turned 'supst' 0x2283 'subst' Middle symbolMid
turned 'doubleSupst' 0x22D1 'doubleSubst' Middle symbolMid
create-glyph : glyph-proc # substBar create-glyph : glyph-proc # substBar
include : SubsetShape (symbolMid + dH + lessEqDist) (symbolMid - dH + lessEqDist) include : SubsetShape (symbolMid + dH + lessEqDist) (symbolMid - dH + lessEqDist)
@ -1314,7 +1352,11 @@ glyph-block Symbol-Math-Large-Operators : for-width-kinds WideWidth1
create-glyph [MangleName 'Cup'] [MangleUnicode 0x22C3] : glyph-proc # Cup create-glyph [MangleName 'Cup'] [MangleUnicode 0x22C3] : glyph-proc # Cup
set-width df.width set-width df.width
include : UShape df bgopTop bgopBot OperatorStroke true include : UShape df bgopTop bgopBot
oper -- true
stroke -- OperatorStroke
sma -- [SmoothAOf (Smooth * [Math.sqrt df.div]) (df.width)]
smb -- [SmoothBOf (Smooth * [Math.sqrt df.div]) (df.width)]
turned [MangleName 'Cap'] [MangleUnicode 0x22C2] [MangleName 'Cup'] df.middle symbolMid turned [MangleName 'Cap'] [MangleUnicode 0x22C2] [MangleName 'Cup'] df.middle symbolMid
@ -1501,7 +1543,9 @@ glyph-block Symbol-Math-APL : begin
refer-glyph 'smallwhitecircle.NWID' refer-glyph 'smallwhitecircle.NWID'
ScaleAround Middle symbolMid 0.75 ScaleAround Middle symbolMid 0.75
Realign Middle symbolMid Middle (operBot + Smooth) Realign Middle symbolMid Middle (operBot + Smooth)
UShape [DivFrame 1] operTop operBot [adviceBlackness 5] true UShape [DivFrame 1] operTop operBot
oper -- true
stroke -- [adviceBlackness 5]
FlipAround Middle symbolMid FlipAround Middle symbolMid
create-glyph 0x235E : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'singleQuote'] create-glyph 0x235E : composite-proc [refer-glyph 'enquad'] [aplBoxed : refer-glyph 'singleQuote']
create-glyph 0x235F : composite-proc [refer-glyph 'enquad'] [intersection [refer-glyph 'mathOOutline'] [refer-glyph 'opAsterisk.low']] [refer-glyph 'mathO'] create-glyph 0x235F : composite-proc [refer-glyph 'enquad'] [intersection [refer-glyph 'mathOOutline'] [refer-glyph 'opAsterisk.low']] [refer-glyph 'mathO']

View file

@ -1093,6 +1093,7 @@ glyph-block Symbol-Punctuation-Interpuncts : begin
alias 'greekbullet' 0x387 'period.mid' alias 'greekbullet' 0x387 'period.mid'
alias 'bullet' 0x2022 'period.mid' alias 'bullet' 0x2022 'period.mid'
alias 'hyphenpoint' 0x2027 'period.mid' alias 'hyphenpoint' 0x2027 'period.mid'
alias 'mathCDot' 0x22C5 'period.mid'
create-glyph 'triangularBullet' 0x2023 : glyph-proc create-glyph 'triangularBullet' 0x2023 : glyph-proc
local radius : PeriodRadius * 1.5 local radius : PeriodRadius * 1.5

View file

@ -134,7 +134,8 @@ define-macro glyph-block-import : syntax-rules
Common-Derivatives `[select-variant italic-variant refer-glyph query-glyph alias turned Common-Derivatives `[select-variant italic-variant refer-glyph query-glyph alias turned
HDual hcombine VDual vcombine with-related-glyphs] HDual hcombine VDual vcombine with-related-glyphs]
CommonShapes `[Rect Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape CommonShapes `[Rect SquareAt Ring RingAt DotAt RingStroke RingStrokeAt DotStrokeAt
CircleRing CircleRingAt CircleDotAt OShape OShapeOutline OBarLeftShape OBarRightShape
LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif
CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif
UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs HBar UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs HBar