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
}
},
name: {
fontFamily: "node-sfnt",
fontSubFamily: "regular",
fullName: "node-sfnt",
postScriptName: "node-sfnt",
uniqueSubFamily: "node-sfnt blank font",
version: "Version 1.0"
},
post: {
version: 2,
isFixedPitch: false,
italicAngle: 0,
maxMemType1: 1,
underlinePosition: -50,
underlineThickness: 50,
minMemType42: 0,
maxMemType42: 0,
minMemType1: 0,
minMemType42: 0,
postoints: 65411,
underlinePosition: -50,
underlineThickness: 50
maxMemType1: 0
},
maxp: {
version: 1.0,

View file

@ -24,6 +24,8 @@ glyph-block CommonShapes : begin
local {.x mx1 .y my1} : globalTransform.apply {.x mx .y 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
local my ((u + d) / 2)
local mx ((l + r) / 2)
@ -654,4 +656,4 @@ glyph-block CommonShapes : begin
set currentGlyph.markAnchors {.}
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-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
widths.lhs stroke
flat df.leftSB top [heading Downward]
curl df.leftSB (bottom + SmoothB * [Math.sqrt df.div])
flat (df.leftSB + offset) top [heading Downward]
curl (df.leftSB + offset) (bottom + smb + offset)
arcvh
g4 (df.middle + CorrectionOMidS) (bottom + O)
g4 (df.middle + CorrectionOMidX * stroke) (bottom + O + offset)
archv
flat df.rightSB (bottom + SmoothA * [Math.sqrt df.div])
curl df.rightSB top [heading Upward]
flat (df.rightSB - offset) (bottom + sma + offset)
curl (df.rightSB - offset) top [heading Upward]
if [not oper] : include : AIVSerifs top
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]
VBar (Middle + [fallback s 0]) plusTop plusBot [fallback sw OperatorStroke]
create-glyph 'plus' '+' : glyph-proc # plus
include : PlusShape SB RightSB
create-glyph 'plus' '+' : PlusShape SB RightSB
create-glyph 'minus' 0x2212 : HBar SB RightSB symbolMid OperatorStroke
create-glyph 'innerPlus' : glyph-proc # plus
include : PlusShape SB RightSB 0 GeometryStroke
create-glyph 'innerPlus' : PlusShape SB RightSB 0 GeometryStroke
create-glyph 'innerMinus' : HBar SB RightSB symbolMid GeometryStroke
create-glyph 'minus' 0x2212 : glyph-proc # minus
include : HBar SB RightSB symbolMid OperatorStroke
create-derived 'minusDot' 0x2238 : DotAt Middle plusTop DotRadius
create-glyph 'minusDot' 0x2238 : composite-proc [refer-glyph 'minus']
DotAt Middle plusTop DotRadius
create-glyph 'hermetianConjugateMatrixPlus' 0x22B9 : difference
PlusShape SB RightSB
SquareAt Middle symbolMid DotRadius
create-glyph 'minusColon' 0x2239 : glyph-proc # colon-equal
include : refer-glyph "baselineDot"
@ -263,8 +266,6 @@ glyph-block Symbol-Math-Arith : begin
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
include : HBarBottom SB RightSB 0 OperatorStroke
@ -579,12 +580,16 @@ glyph-block Symbol-Math-VAndCup : begin
turned 'doubleWedge' 0x2A53 'doubleVee' Middle symbolMid
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 [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
include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
local mockUpscale : OperatorStroke / [adviceBlackness 6]
local arrowLength : mockUpscale * [Math.min (RightSB - SB - OperatorStroke * HVContrast * 2) (Width * 0.6)]
include : new-glyph : glyph-proc
@ -600,7 +605,8 @@ glyph-block Symbol-Math-VAndCup : begin
include : Translate Middle (operBot + Smooth)
include : Italify
create-derived 'cupPlus' 0x228E : glyph-proc
create-glyph 'cupPlus' 0x228E : glyph-proc
include [refer-glyph 'cup'] AS_BASE ALSO_METRICS
local sw : adviceBlackness 6
local size : Math.min (RightSB - SB - OperatorStroke * HVContrast * (2 + 0.5 * sw / OperatorStroke)) ((RightSB - SB) * 0.8)
include : dispiro
@ -612,8 +618,22 @@ glyph-block Symbol-Math-VAndCup : begin
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 'capDot' 0x2A40 'cupDot' Middle symbolMid
turned 'doubleCap' 0x22D2 'doubleCup' Middle symbolMid
create-glyph 'squareCap' 0x2293 : glyph-proc # squareCap
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
include : EqualShape SB RightSB
create-glyph 'equalParallel' 0x22D5 : composite-proc
refer-glyph 'equal'
refer-glyph 'parallel.naturalSlope'
create-glyph 'oneDotApproxEq' 0x2250 : glyph-proc
include : refer-glyph 'equal'
include : DotAt Middle (symbolMid + EqualHalfSpace * 2.5) DotRadius
@ -941,12 +965,20 @@ glyph-block Symbol-Math-Relation : begin
create-glyph 'less' '<' : glyph-proc
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
include : NormalSubsetShape (symbolMid + dH) (symbolMid - dH) SB RightSB
create-glyph 'greater' '>' : glyph-proc
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
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) OperatorStroke
define [SubsetShape top bot sw] : dispiro
widths.lhs [fallback sw OperatorStroke]
flat RightSB top [heading Leftward]
curl (SB + (top - bot) / 2) top
define [SubsetShape] : params [top bot [sw OperatorStroke] [offset 0]] : dispiro
widths.lhs sw
flat RightSB (top - offset) [heading Leftward]
curl (SB + offset + (top - bot) / 2 - offset) (top - offset)
archv
g4 SB [mix top bot 0.5]
g4 (SB + offset) [mix top bot 0.5]
arcvh
flat (SB + (top - bot) / 2) bot
curl RightSB bot [heading Rightward]
flat (SB + offset + (top - bot) / 2 - offset) (bot + offset)
curl RightSB (bot + offset) [heading Rightward]
define [PrefixShape top bot sw] : union
VBarLeft SB bot top [fallback sw OperatorStroke]
@ -1187,10 +1219,16 @@ glyph-block Symbol-Math-Relation : begin
include : PrefixShape top bot sw
include : FlipAround Middle [mix top bot 0.5]
create-glyph 'subst' 0x2282 : glyph-proc # subst
include : SubsetShape (symbolMid + dH) (symbolMid - dH)
create-glyph 'supst' 0x2283 : glyph-proc # supst
include : SupsetShape (symbolMid + dH) (symbolMid - dH)
create-glyph 'subst' 0x2282 : SubsetShape (symbolMid + dH) (symbolMid - dH)
create-glyph 'doubleSubst' 0x22D0 : glyph-proc
local sw : adviceBlackness 6.5
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
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
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
@ -1501,7 +1543,9 @@ glyph-block Symbol-Math-APL : begin
refer-glyph 'smallwhitecircle.NWID'
ScaleAround Middle symbolMid 0.75
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
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']

View file

@ -1093,6 +1093,7 @@ glyph-block Symbol-Punctuation-Interpuncts : begin
alias 'greekbullet' 0x387 'period.mid'
alias 'bullet' 0x2022 'period.mid'
alias 'hyphenpoint' 0x2027 'period.mid'
alias 'mathCDot' 0x22C5 'period.mid'
create-glyph 'triangularBullet' 0x2023 : glyph-proc
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
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
CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif
UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs HBar