Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add five mathematic/logical characters. #2551

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changes/31.9.2.md
Original file line number Diff line number Diff line change
@@ -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`).
2 changes: 2 additions & 0 deletions doc/custom-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions packages/font-glyphs/src/meta/aesthetics.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions packages/font-glyphs/src/meta/macros.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions packages/font-glyphs/src/symbol/arrow.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
10 changes: 5 additions & 5 deletions packages/font-glyphs/src/symbol/math/apl.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions packages/font-glyphs/src/symbol/math/circled.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
18 changes: 16 additions & 2 deletions packages/font-glyphs/src/symbol/math/large-operators.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
jmcwilliams403 marked this conversation as resolved.
Show resolved Hide resolved

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)
Expand Down
30 changes: 28 additions & 2 deletions packages/font-glyphs/src/symbol/math/logicals.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions packages/font/src/derive-spacing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions params/parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading