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 the remaining Frakturs #2454

Merged
merged 3 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 2 additions & 13 deletions changes/31.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,8 @@
- MOON LANDER (`U+1CDF5`) (Proposed for Unicode 16; L2/21-235).
- UP-POINTING FROG (`U+1CDFB`) (Proposed for Unicode 16; L2/21-235).
- DOWN-POINTING FROG (`U+1CDFC`) (Proposed for Unicode 16; L2/21-235).
- MATHEMATICAL FRAKTUR CAPITAL A (`U+1D504`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL B (`U+1D505`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL E (`U+1D508`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL G (`U+1D50A`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL J (`U+1D50D`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL K (`U+1D50E`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL M (`U+1D510`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL N (`U+1D511`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL P (`U+1D513`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL V (`U+1D519`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL W (`U+1D51A`) (#444).
- MATHEMATICAL FRAKTUR SMALL E (`U+1D522`) (#444).
- MATHEMATICAL FRAKTUR SMALL O (`U+1D52C`) (#444).
- MATHEMATICAL FRAKTUR CAPITAL A (`U+1D504`) .. MATHEMATICAL FRAKTUR SMALL Z (`U+1D537`) (#444).
- MATHEMATICAL BOLD FRAKTUR CAPITAL A (`U+1D56C`) .. MATHEMATICAL BOLD FRAKTUR SMALL Z (`U+1D59F`) (#444).
* Add separate variant selectors for Cyrillic Capital En/Er (`VXAA`, `VXAB`).
* Add variant selectors for Greek lower Beta/Gamma/Nu/Upsilon (`VXAC`, `VXAD`, `VXAE`, `VXAF`).
* Optimize glyph for VERTICAL LINE WITH MIDDLE DOT (`U+2327`).
Expand Down
9 changes: 9 additions & 0 deletions packages/font-glyphs/src/auto-build/transformed.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,11 @@ glyph-block Autobuild-Transformed-Mathematical : begin
CreateMathDerivatives groupName tfm gr base letters overrides
CreateMathAliasableImpl groupName altGroupName tfm gr base letters overrides

define [CreateMathBoldFraktur base letters] : begin
local jobs {}
foreach j [range 0 letters.length] : jobs.push { (base + j) ("frak/" + letters.(j)) }
createMathDerivedSeriesImpl 'frakbf' tfBold jobs

# Math bold
CreateMathDerivatives 'mathbf' tfBold null 0x1D400 UpperLatin
CreateMathDerivatives 'mathbf' tfBold null 0x1D41A LowerLatin
Expand Down Expand Up @@ -897,6 +902,10 @@ glyph-block Autobuild-Transformed-Mathematical : begin
CreateMathDerivatives 'legacyComputingOutlined' tfBold null 0x1CCD6 UpperLatin null TfOutline
CreateMathDerivatives 'legacyComputingOutlined' tfBold null 0x1CCF0 Digits null TfOutline

# Math fraktur
CreateMathBoldFraktur 0x1D56C UpperLatin
CreateMathBoldFraktur 0x1D586 LowerLatin

glyph-block Autobuild-Rhotic : begin
glyph-block-import Mark-Shared-Metrics : markFine markstroke
glyph-block-import CommonShapes
Expand Down
16 changes: 10 additions & 6 deletions packages/font-glyphs/src/common/shapes.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,16 @@ glyph-block CommonShapes : begin

define nHookSegments 12
define [HookShape toStraight toFinish isStart args] : begin
local [object y sw swTerminal isTail noSwash] args
local [object yRef sw swTerminal isTail noSwash overshoot] args

local atBottom : toStraight.y > y
local atBottom : toStraight.y > yRef
local ltr : if isStart (toFinish.x < toStraight.x) (toFinish.x > toStraight.x)
local dtu : if isStart (y > toFinish.y) (y < toFinish.y)
local dtu : if isStart (yRef > toFinish.y) (yRef < toFinish.y)
local doSwash : !noSwash && !isStart && atBottom && (para.isItalic || isTail) && [if (para.slopeAngle >= 0) ltr [not ltr]]
local superness DesignParameters.superness

local y : yRef + [if dtu (-1) 1] * overshoot

# Adjust terminal's position if necessary
toFinish.x = toFinish.x + OXHook * [if ltr (-1) 1] * [if isStart (-1) 1]
if (doSwash) : begin
Expand Down Expand Up @@ -512,7 +514,7 @@ glyph-block CommonShapes : begin
return : HookShape before after false args

define [hookProxy args] : begin
return : new CopyBackKnotProxy [g4 [new CMixCoord 0.5] args.y] args 2
return : new CopyBackKnotProxy [g4 [new CMixCoord 0.5] args.yRef] args 2

glyph-block-export hookstart
define flex-params [hookstart] : begin
Expand All @@ -521,7 +523,8 @@ glyph-block CommonShapes : begin
local-parameter : swTerminal -- sw
local-parameter : isTail -- false
local-parameter : noSwash -- false
local args : object y sw swTerminal isTail noSwash
local-parameter : o -- O
local args : object [yRef y] sw swTerminal isTail noSwash [overshoot o]
return : WithKnotProxy [hookProxy args] : Interpolator hookStartBlender args

glyph-block-export hookend
Expand All @@ -531,7 +534,8 @@ glyph-block CommonShapes : begin
local-parameter : swTerminal -- sw
local-parameter : isTail -- false
local-parameter : noSwash -- false
local args : object y sw swTerminal isTail noSwash
local-parameter : o -- O
local args : object [yRef y] sw swTerminal isTail noSwash [overshoot o]
return : WithKnotProxy [hookProxy args] : Interpolator hookEndBlender args

glyph-block-export arch
Expand Down
2 changes: 1 addition & 1 deletion packages/font-glyphs/src/letter-like/cursive.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ glyph-block LetterLike-Cursive : begin
~~~ [arch.lhs [loop.y 1 0 O] (sw -- loop.sw) (swAfter -- dr.sw)]
flat [dr.x 0.5 (-0.75)] [dr.y 1 0 (-ada)] [dr.lhs]
curl [dr.x 0.5 (-0.75)] [dr.y 0 0 (+adb)] [dr.lhs]
~~~ [hookend O (sw -- dr.sw) (swTerminal -- tip.sw) (isTail -- true)]
~~~ [hookend 0 (sw -- dr.sw) (swTerminal -- tip.sw) (isTail -- true)]
g2 [tip.x 1] (SHook + dr.sw * 0.5) [tip.lhs]

create-glyph 'weierstrassP' 0x2118 : glyph-proc
Expand Down
22 changes: 18 additions & 4 deletions packages/font-glyphs/src/letter-like/fraktur.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@ export : define [apply] : begin
define $$Capture$$ this
run-glyph-module "./fraktur/common.mjs"

run-glyph-module "./fraktur/upper-a.mjs"
run-glyph-module "./fraktur/upper-au.mjs"
run-glyph-module "./fraktur/upper-bvw.mjs"
run-glyph-module "./fraktur/upper-ceg.mjs"
run-glyph-module "./fraktur/upper-hkr.mjs"
run-glyph-module "./fraktur/upper-doq.mjs"
run-glyph-module "./fraktur/upper-ft.mjs"
run-glyph-module "./fraktur/upper-hkry.mjs"
run-glyph-module "./fraktur/upper-ij.mjs"
run-glyph-module "./fraktur/upper-l.mjs"
run-glyph-module "./fraktur/upper-mnp.mjs"
run-glyph-module "./fraktur/upper-s.mjs"
run-glyph-module "./fraktur/upper-z.mjs"

run-glyph-module "./fraktur/lower-e.mjs"
run-glyph-module "./fraktur/lower-o.mjs"
run-glyph-module "./fraktur/lower-agq.mjs"
run-glyph-module "./fraktur/lower-bopvw.mjs"
run-glyph-module "./fraktur/lower-ce.mjs"
run-glyph-module "./fraktur/lower-d.mjs"
run-glyph-module "./fraktur/lower-fkrt.mjs"
run-glyph-module "./fraktur/lower-hy.mjs"
run-glyph-module "./fraktur/lower-ijl.mjs"
run-glyph-module "./fraktur/lower-mnu.mjs"
run-glyph-module "./fraktur/lower-s.mjs"
run-glyph-module "./fraktur/lower-z.mjs"

run-glyph-module "./fraktur/x.mjs"
126 changes: 82 additions & 44 deletions packages/font-glyphs/src/letter-like/fraktur/common.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,56 @@ glyph-block LetterLike-Fraktur-Common : begin
glyph-block-export fraktur-stroke
define [fraktur-stroke profile __knots] : begin
local knots : {}.slice.call arguments 1
return : new FrakturImpl profile knots
return : new FrakturShape profile knots

class FrakturShapeImpl
public [new proxy] : begin
this.proxy = proxy
public [applyToGlyph glyph] : begin
glyph.includeGeometry this.proxy.geometry
return this.proxy

class FrakturShape
public [new pen knots] : begin
this.pen = pen
this.knots = knots
public [applyToGlyph glyph] : begin
local profile : this.pen.getPenShape glyph.gizmo
local collector : new PenKnotCollector glyph.gizmo profile this.pen.fixed
local c : spiro-collect collector this.knots

local proxy : new FrakturProxy glyph.gizmo profile collector.closed collector.knots
return : [new FrakturShapeImpl proxy].applyToGlyph glyph

class FrakturProxy
public [new gizmo profile collector] : begin
public [new gizmo profile closed knots] : begin
set this.gizmo gizmo
set this.knots collector.knots
set this.closed closed
set this.knots knots

set this.geometry : new SpiroPenGeometry
begin gizmo
begin profile
begin collector.closed
begin collector.knots
set this.geometry : new SpiroPenGeometry gizmo profile closed knots

public [first i] this.knots.[fallback i 0]
public [last i] this.knots.(this.knots.length - [fallback i 1])

class FrakturImpl
public [new profile knots] : begin
this.profile = profile
this.knots = knots
public [applyToGlyph glyph] : begin
local defaultProfile : this.profile.getPenShape glyph.gizmo
local collector : new PenKnotCollector glyph.gizmo defaultProfile this.profile.fixed
local c : spiro-collect collector this.knots

local proxy : new FrakturProxy glyph.gizmo defaultProfile collector
glyph.includeGeometry proxy.geometry
return proxy
public [withPen newPen] : begin
local newProfile : newPen.getPenShape this.gizmo
local newKnots {}
foreach k [items-of this.knots] : begin
local k1 : k.clone
if k1.profile : set k1.profile newProfile
newKnots.push k1
local newProxy : new FrakturProxy this.gizmo newProfile this.closed newKnots
return : new FrakturShapeImpl newProxy

# Directive to change the profile
glyph-block-export change-profile
define [change-profile newProfile] : function : begin
this.setProfile : newProfile.getPenShape this.gizmo
glyph-block-export change-pen
define [change-pen newPen] : function : begin
this.setProfile : newPen.getPenShape this.gizmo

# A pen profile describes a virtual flat-tip pen. We use a 45-degree arrangement to
# simplify the math.
class FrakturProfile
class FrakturPen
public [new thick thin] : begin
this.fixed = false
# .thick is the half length of the flat tip, projected to the X/Y axis
Expand Down Expand Up @@ -92,6 +105,18 @@ glyph-block LetterLike-Fraktur-Common : begin
define frakThick : 1.0 * Stroke
define frakFine : 1.0 * [AdviceStroke 4] # For decoration

glyph-block-export S
define S : new FrakturPen frakThick (0.875 * frakThin)

glyph-block-export M
define M : new FrakturPen [AdviceStroke 3 para.diversityM] (0.875 * frakThin)

glyph-block-export F
define F : new FrakturPen frakFine (0.875 * frakThin)

glyph-block-export T
define T : new FrakturPen frakThin (0.875 * frakThin)

class MaskingProfile
public [new dx dy] : begin
this.fixed = true
Expand All @@ -101,27 +126,20 @@ glyph-block LetterLike-Fraktur-Common : begin
local tf : gizmo.applyOffsetXY this.dx this.dy
list [new Vec2 0 0] [new Vec2 tf.x tf.y]

glyph-block-export S
define S : new FrakturProfile frakThick (0.875 * frakThin)

glyph-block-export M
define M : new FrakturProfile [AdviceStroke 3 para.diversityM] (0.875 * frakThin)

glyph-block-export F
define F : new FrakturProfile frakFine (0.875 * frakThin)

glyph-block-export T
define T : new FrakturProfile frakThin (0.875 * frakThin)

glyph-block-export CutMaskLeft
define CutMaskLeft : new MaskingProfile (-VERY-FAR) 0

glyph-block-export CutMaskUp
define CutMaskUp : new MaskingProfile 0 VERY-FAR

glyph-block-export CutMaskDown
define CutMaskDown : new MaskingProfile 0 (-VERY-FAR)

# Key metrics
glyph-block-export DecoSizeX DecoSizeY FHook Wave.DepthY Wave.DepthX LbFootRise
glyph-block-export DecoSizeX DecoSizeY FHook Wave.DepthY Wave.DepthX
define DecoSizeX : 0.15 * (RightSB - SB)
define DecoSizeY : 0.08 * (RightSB - SB)
define FHook : 0.4 * SHook - 0.25 * S.thick
define LbFootRise : 0.375 * SHook + 0.375 * S.thick

glyph-block-export SlopeA SlopeB
define SlopeA : 0.875 * DecoSizeY / DecoSizeX
Expand All @@ -134,11 +152,11 @@ glyph-block LetterLike-Fraktur-Common : begin
export : define DepthX : 1 * DecoSizeX
export : define LTDecoSize : 0.75 * DecoSizeX

export : define [h] : Interpolator hBlender
define [hBlender before after] : begin
export : define [h o] : Interpolator hBlender [object o]
define [hBlender before after args] : begin
return : list
g2 [mix before.x after.x 0.375] after.y
g2 [mix before.x after.x 0.625] before.y
g2 [mix before.x after.x 0.375] (after.y + [fallback args.o 0])
g2 [mix before.x after.x 0.625] (before.y - [fallback args.o 0])

export : define [vc waveDepth] : Interpolator vcBlender [object waveDepth]
define [vcBlender before after args] : begin
Expand All @@ -164,5 +182,25 @@ glyph-block LetterLike-Fraktur-Common : begin
glyph-block-export PHexBot
define PHexBot : 1 - PHexTop

glyph-block-export FrakDf
define [FrakDf div m] : DivFrame [fallback div 1] [fallback m 2] [Math.max 1 : DecoSizeX / SB]
glyph-block-export UpperDf
define [UpperDf div m] : DivFrame [fallback div 1] [fallback m 2] [Math.max 1 : DecoSizeX / SB]

glyph-block-export LowerDf
define [LowerDf div m] : DivFrame [fallback div 1] [fallback m 2] [Math.max 1 : (1.75 * DecoSizeX - 0.5 * S.thick) / SB]

glyph-block-export RBDecoration
define [RBDecoration cx cy limy] : list
curl cx [min@ [fallback limy VERY-FAR] [post@slope : 2 * SlopeB]]
[flatc.sr SlopeB].end (pre@ <+> 0.5 * DecoSizeX) cy
corner (pre@ <+> DecoSizeX) (pre@ <+> DecoSizeY)

glyph-block-export LTDecoration
define [LTDecoration cx cy limy] : list
corner (post@ <-> DecoSizeX) (post@ <-> DecoSizeY)
[ccurl.sr SlopeB].start (post@ <-> 0.5 * DecoSizeX) cy
flat cx [max@ [fallback limy (-VERY-FAR)] [pre@slope : 2 * SlopeB]]

set [LTDecoration.g2 cx cy limy] : list
corner (post@ <-> DecoSizeX) (post@ <-> DecoSizeY)
[ccurl.sr SlopeB].start (post@ <-> 0.5 * DecoSizeX) cy
g2 cx [max@ [fallback limy (-VERY-FAR)] [pre@slope : 2 * SlopeB]]
56 changes: 56 additions & 0 deletions packages/font-glyphs/src/letter-like/fraktur/lower-agq.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
$$include '../../meta/macros.ptl'

glyph-module

glyph-block LetterLike-Fraktur-Lower-AQ : begin
glyph-block-import Common-Derivatives
glyph-block-import CommonShapes
glyph-block-import LetterLike-Fraktur-Common : LowerDf S F T fraktur-stroke change-pen
glyph-block-import LetterLike-Fraktur-Common : DecoSizeX DecoSizeY SlopeA SlopeB
glyph-block-import LetterLike-Fraktur-Common : Wave PHexTop PHexBot RBDecoration

define [LeftHalfShape mode box] : fraktur-stroke S
corner box.right [post@slope SlopeB]
corner [box.xp PHexTop] box.top
g2.down.mid (box.left - OX) [mix@ 0.5]
corner [box.xp PHexBot] box.bot
corner box.right [pre@slope SlopeA]

create-glyph "frak/a" 0x1D51E : glyph-proc
local df : include : LowerDf 1
include : df.markSet.e

local aBox : S.box XH 0 df.leftSB df.rightSB

local leftStroke : include : LeftHalfShape 'a' aBox
local rightStroke : include : fraktur-stroke S
flat [leftStroke.first].x [leftStroke.first].y
RBDecoration [leftStroke.last].x aBox.bot [leftStroke.last].y

create-glyph "frak/g" 0x1D524 : glyph-proc
local df : include : LowerDf 1
include : df.markSet.p

local aBox : S.box XH 0 df.leftSB df.rightSB
local gBox : S.box XH Descender df.leftSB df.rightSB

local leftStroke : include : LeftHalfShape 'p' aBox
local rightStroke : include : fraktur-stroke S
corner [leftStroke.first].x [leftStroke.first].y
corner pre@ [leftStroke.last].y
g2 (pre@ <+> 0.5 * DecoSizeX) (post@ <+> SmallArchDepthA)
hookend (sw -- S.thick) gBox.bot
g4 gBox.left (pre@ <+> SHook)


create-glyph "frak/q" 0x1D52E : glyph-proc
local df : include : LowerDf 1
include : df.markSet.p

local aBox : S.box XH 0 df.leftSB df.rightSB
local qBox : S.box XH Descender df.leftSB df.rightSB

local leftStroke : include : LeftHalfShape 'p' aBox
local rightStroke : include : fraktur-stroke S
flat [leftStroke.first].x [leftStroke.first].y
RBDecoration [leftStroke.last].x qBox.bot [leftStroke.last].y
Loading