Skip to content

Commit

Permalink
Release 9.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Aug 1, 2021
2 parents 90c1f66 + ab37d9a commit 6354b52
Show file tree
Hide file tree
Showing 127 changed files with 258 additions and 211 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Modifications since version 2.x

### 9.0.1

* Fix serifs in dingbat circled numbers (#1182).
* Fix broken shape of Latin Letter Tone Five (Regression, #1074).
* Fix broken serif of iotified capital Cyrillic letters (#1184).


### 9.0.0

* \[**Breaking**\]: Add support for expression-style metric override. The old `[metric-override.multiplies]` and `[metric-override.adds]` are no longer supported (#1181).
Expand Down
282 changes: 141 additions & 141 deletions PACKAGE-LIST.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions changes/9.0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Fix serifs in dingbat circled numbers (#1182).
* Fix broken shape of Latin Letter Tone Five (Regression, #1074).
* Fix broken serif of iotified capital Cyrillic letters (#1184).
104 changes: 57 additions & 47 deletions font-src/glyphs/auto-build/composite.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $$include '../../meta/macros.ptl'
import [mix linreg clamp fallback] from '../../support/utils'
import [getGrMesh AnyCv CvDecompose Joining] from "../../support/gr"
import [hashGeometry] from "../../support/geometry/index"
import [Transform] from "../../support/geometry/transform"
extern Map
extern Set

Expand Down Expand Up @@ -120,29 +121,25 @@ glyph-block AutoBuild-Enclosure : begin
define [EnclosureStrokeScale dscale digits width] : dscale / [Math.pow [AdjustDigitCount digits width] 0.66]

define enclosureInnerPartActualWidth : new Map
define [EnsureInnerSubGlyphImpl miniatureFont markClass dscale xCompress yCompress mp mpShift bal baly kExtraYShift] : lambda [gidPart] : begin
define [EnsureInnerSubGlyphImpl gniPrefix markClass miniatureFont mp actualWidth accumulatedTfm] : function [gidPart] : begin
define subGlyph : miniatureFont.queryByNameEnsured gidPart
define geomHash : hashGeometry subGlyph.geometry
define shift : if mp mpShift : getGlyphDefaultShift bal baly subGlyph
define shiftPartName : if mp "mp\(shift)" "sp"

define gniPart : '.ci.' + geomHash + '@' + [{ dscale xCompress yCompress shiftPartName kExtraYShift [subGlyph.gizmo.toString] }.join '/']
define gniPart : '.ci.' + gniPrefix + '.' + geomHash + '@' + [{ mp actualWidth accumulatedTfm }.join '/']
if [not : query-glyph gniPart] : begin
enclosureInnerPartActualWidth.set gniPart (subGlyph.advanceWidth * dscale * xCompress)
enclosureInnerPartActualWidth.set gniPart (actualWidth)
create-glyph gniPart : glyph-proc
set-width 0
set-mark-anchor 'compositeInner' 0 0
include subGlyph
include : subGlyph.gizmo.inverse
include : Scale (dscale * xCompress) (dscale * yCompress)
include : Translate 0 (dscale * shift + SymbolMid + (kExtraYShift - 0.5) * CAP * dscale)
include subGlyph.gizmo
include subGlyph
include accumulatedTfm
if mp
: then : set-mark-anchor markClass 0 0 (subGlyph.advanceWidth * dscale * xCompress) 0
: else : set-mark-anchor markClass (subGlyph.advanceWidth * dscale * xCompress / 2) 0
then : set-mark-anchor markClass 0 0 (actualWidth) 0
else : set-mark-anchor markClass (actualWidth / 2) 0

return gniPart

define [EnsureInnerSubGlyphSeq markClass miniatureFont job dimens yCompress kExtraYShift] : begin
define [EnsureInnerSubGlyphSeq gniPrefix markClass miniatureFont job dimens yCompress kExtraYShift] : begin
define { gn unicode parts w bal baly } job
define [object width mockInnerWidth dscale] dimens

Expand All @@ -154,13 +151,20 @@ glyph-block AutoBuild-Enclosure : begin
set totalWidth : totalWidth + derivedGlyph.advanceWidth
local xCompress [Math.min 1 (mockInnerWidth / totalWidth)]
set totalWidth : Math.min mockInnerWidth totalWidth
local mpShift : getGlyphDefaultShift bal baly firstDerivedGyph

local shift : getGlyphDefaultShift bal baly firstDerivedGyph
local accumulatedTfm : Transform.Combine
firstDerivedGyph.gizmo.inverse
Scale (dscale * xCompress) (dscale * yCompress)
Translate 0 (dscale * shift + SymbolMid + (kExtraYShift - 0.5) * CAP * dscale)
begin firstDerivedGyph.gizmo

local finalParts {}
foreach partIndex [range 0 parts.length] : do
define gidPart parts.(partIndex)
local actualWidth : [miniatureFont.queryByNameEnsured gidPart].advanceWidth * dscale * xCompress
finalParts.push : EnsureComponentGlyphT gidPart
EnsureInnerSubGlyphImpl miniatureFont markClass dscale xCompress yCompress (parts.length > 1) mpShift bal baly kExtraYShift
EnsureInnerSubGlyphImpl gniPrefix markClass miniatureFont (parts.length > 1) actualWidth accumulatedTfm

return finalParts

Expand All @@ -175,22 +179,22 @@ glyph-block AutoBuild-Enclosure : begin
include : WithTransform [Translate x 0] : refer-glyph gniPart
set x : x + ([enclosureInnerPartActualWidth.get gniPart] || 0)

define [EnclosureInner gnEnclosure miniatureFont job dimens] : begin
define [EnclosureInner gniPrefix gnEnclosure miniatureFont job dimens] : begin
define { gn unicode parts w bal baly } job
define [object width mockInnerWidth dscale] dimens
local finalParts : EnsureInnerSubGlyphSeq 'enclosureInner' miniatureFont job dimens 1 0
local finalParts : EnsureInnerSubGlyphSeq gniPrefix 'enclosureInner' miniatureFont job dimens 1 0
if gnEnclosure : return : glyph-proc
include : EnclosureInnerImpl dimens finalParts
CvDecompose.set currentGlyph [{gnEnclosure}.concat finalParts]
: else : return : new-glyph : EnclosureInnerImpl dimens finalParts

define [TwoRowEnclosureInner gnEnclosure miniatureFont job dimens] : begin
define [TwoRowEnclosureInner gniPrefix gnEnclosure miniatureFont job dimens] : begin
define { gn unicode parts w bal baly } job
define [object width mockInnerWidth dscale] dimens
local jobFirstHalf { gn unicode [parts.slice 0 (parts.length / 2)] w bal baly }
local jobSecondHalf { gn unicode [parts.slice (parts.length / 2) ] w bal baly }
local finalPartsFirstHalf : EnsureInnerSubGlyphSeq 'enclosureInnerFirstHalf' miniatureFont jobFirstHalf dimens 0.45 (+0.55)
local finalPartsSecondHalf : EnsureInnerSubGlyphSeq 'enclosureInnerSecondHalf' miniatureFont jobSecondHalf dimens 0.45 (+0.00)
local finalPartsFirstHalf : EnsureInnerSubGlyphSeq gniPrefix 'enclosureInnerFirstHalf' miniatureFont jobFirstHalf dimens 0.45 (+0.55)
local finalPartsSecondHalf : EnsureInnerSubGlyphSeq gniPrefix 'enclosureInnerSecondHalf' miniatureFont jobSecondHalf dimens 0.45 (+0.00)
if gnEnclosure : return : glyph-proc
include : EnclosureInnerImpl dimens finalPartsFirstHalf
include : EnclosureInnerImpl dimens finalPartsSecondHalf
Expand Down Expand Up @@ -229,72 +233,78 @@ glyph-block AutoBuild-Enclosure : begin
define smoothB : SmoothBOf (SmallSmooth * (right - left) / (RightSB - SB)) width
return : object width mockInnerWidth dscale sw0 sw top bot left right mosaicTop mosaicBot mosaicLeft mosaicRight smoothA smoothB

define [StandardSpacing pp digits rows width] : MiniatureParaT pp
crowd -- [CircCrowd (digits / rows) width]
scale -- [CircScale (digits / rows) width]
sbscale -- 1
mono -- (digits > 1)
mono2 -- (digits > 1)

define [ItalicSpacing pp digits rows width] : begin
define pp1 : pp.reinit : function [a] : begin
set a.shape.slope 'italic'
set a.shape.slopeAngle : mix (para.slopeAngle || 0) 15 (95 / 150)
return : StandardSpacing pp1 digits rows width

define [SansSerifSpacing pp digits rows width] : begin
define pp1 : pp.reinit : function [a] : begin
set a.shape.serifs 'sans'
return : StandardSpacing pp1 digits rows width
define StandardSpacing : object
gniPrefix ''
getPara : function [pp digits rows width] : MiniatureParaT pp
crowd -- [CircCrowd (digits / rows) width]
scale -- [CircScale (digits / rows) width]
sbscale -- 1
mono -- (digits > 1)
mono2 -- (digits > 1)

define ItalicSpacing : object
gniPrefix 'i'
getPara : function[pp digits rows width] : begin
define pp1 : pp.reinit : function [a] : begin
set a.shape.slope 'italic'
set a.shape.slopeAngle : mix (para.slopeAngle || 0) 15 (95 / 150)
return : StandardSpacing.getPara pp1 digits rows width

define SansSerifSpacing : object
gniPrefix 'ss'
getPara : function [pp digits rows width] : begin
define pp1 : pp.reinit : function [a] : begin
set a.shape.serifs 'sans'
return : StandardSpacing.getPara pp1 digits rows width

define [EnclosureT prefix builder spacing digits rows demands fnEnclosure] : begin
foreach {suffix ww gap} [items-of circleWidthClasses] : do
define allowProportional : if (digits > 1) MONOSPACE-ONLY ALLOW-PROPORTIONAL
define jobs : CollectJobs builder.decomposable CENTERED allowProportional (prefix + digits) suffix demands
define forkedPara : spacing para digits rows ww
define forkedPara : spacing.getPara para digits rows ww
define miniatureFont : CreateDerivedFontFromJobs jobs {} : function [gs] : Fork gs forkedPara
define gnEnclosure : CircName null (prefix + digits + '.enclosure') {} suffix
if [not : query-glyph gnEnclosure] : create-glyph gnEnclosure : fnEnclosure digits ww gap
foreach job [items-of jobs.decomposableJobs] : begin
builder.build (prefix + digits) digits ww gap job miniatureFont gnEnclosure true
builder.build (prefix + digits) spacing.gniPrefix digits ww gap job miniatureFont gnEnclosure true
foreach job [items-of jobs.nonDecomposable] : begin
builder.build (prefix + digits) digits ww gap job miniatureFont gnEnclosure false
builder.build (prefix + digits) spacing.gniPrefix digits ww gap job miniatureFont gnEnclosure false
applyRelations jobs.relApplications

# Builders and Enclosure Shapes
define CircledBuilder : object
decomposable true
build : lambda [prefix digits ww gap job miniatureFont gnEnclosure decomposable] : begin
build : lambda [prefix gniPrefix digits ww gap job miniatureFont gnEnclosure decomposable] : begin
define { gn unicode parts w bal baly } job
define dimens : circleDimens digits ww
define [object width mockInnerWidth dscale] dimens
if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc
set-width width
include : EnclosureInner [if decomposable gnEnclosure null] miniatureFont job dimens
include : EnclosureInner gniPrefix [if decomposable gnEnclosure null] miniatureFont job dimens
include : refer-glyph gnEnclosure

define TwoRowBoxedBuilder : object
decomposable true
build : lambda [prefix digits ww gap job miniatureFont gnEnclosure decomposable] : begin
build : lambda [prefix gniPrefix digits ww gap job miniatureFont gnEnclosure decomposable] : begin
define { gn unicode parts w bal baly } job
define dimens : circleDimens digits ww
define [object width mockInnerWidth dscale] dimens
if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc
set-width width
include : TwoRowEnclosureInner [if decomposable gnEnclosure null] miniatureFont job dimens
include : TwoRowEnclosureInner gniPrefix [if decomposable gnEnclosure null] miniatureFont job dimens
include : refer-glyph gnEnclosure

define InsetBuilder : object
decomposable false
build : lambda [prefix digits ww gap job miniatureFont gnEnclosure decomposable] : begin
build : lambda [prefix gniPrefix digits ww gap job miniatureFont gnEnclosure decomposable] : begin
define { gn unicode parts w bal baly } job
define dimens : circleDimens digits ww
define [object width mockInnerWidth dscale] dimens
if [not : query-glyph gn] : create-glyph gn [if (w == ww) unicode null] : glyph-proc
set-width width
include : difference
refer-glyph gnEnclosure
EnclosureInner [if decomposable gnEnclosure null] miniatureFont job dimens
EnclosureInner gniPrefix [if decomposable gnEnclosure null] miniatureFont job dimens

define [AddEnclosureMark digits dimens] : glyph-proc
define [object width dscale mockInnerWidth] dimens
Expand Down Expand Up @@ -460,7 +470,7 @@ glyph-block AutoBuild-Enclosure : begin
define dimens : bracedDottdeDimens digits ww
define [object width mockInnerWidth dscale] dimens
set-width width
include : EnclosureInner [if jobDecomposable gnb null] miniatureFont job dimens
include : EnclosureInner '' [if jobDecomposable gnb null] miniatureFont job dimens
include : refer-glyph gnb

foreach job [items-of jobs.decomposableJobs] : CreateGlyphImpl true job
Expand Down
9 changes: 5 additions & 4 deletions font-src/glyphs/letter/cyrillic/big-yus.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ glyph-block Letter-Cyrillic-BigYus : begin
include : df.markSet.e
include : CyrBigYusShape df XH 0.55

define [CyrIotifiedBigYusShape df top yp] : glyph-proc
define [CyrIotifiedBigYusShape fCapital df top yp] : glyph-proc
local gap : (df.width - 2 * df.leftSB - 4 * df.mvs) / 3
define divSub : (df.width - gap - df.mvs) / Width
define dfSub : DivFrame divSub 3
Expand All @@ -76,17 +76,18 @@ glyph-block Letter-Cyrillic-BigYus : begin
include : HBarTop (df.leftSB - O) [mix df.leftSB df.rightSB (2 / 3)] (top * yp) df.mvs
if SLAB : begin
include : tagged 'serifLT' : LeftwardTopSerif df.leftSB top SideJut df.mvs
if [not para.isItalic] : include : tagged 'serifLB' : LeftwardBottomSerif df.leftSB 0 SideJut df.mvs
if (fCapital || [not para.isItalic]) : begin
include : tagged 'serifLB' : LeftwardBottomSerif df.leftSB 0 SideJut df.mvs
include : tagged 'serifRB' : RightwardBottomSerif (df.rightSB + 0.5 * df.mvs * HVContrast) 0 (SideJut - 0.5 * df.mvs * HVContrast) df.mvs

create-glyph 'cyrl/BigYusIotified' 0x46C : glyph-proc
local df : DivFrame para.diversityM 4
set-width df.width
include : df.markSet.capital
include : CyrIotifiedBigYusShape df CAP 0.575
include : CyrIotifiedBigYusShape true df CAP 0.575

create-glyph 'cyrl/bigYusIotified' 0x46D : glyph-proc
local df : DivFrame para.diversityM 4
set-width df.width
include : df.markSet.e
include : CyrIotifiedBigYusShape df XH 0.55
include : CyrIotifiedBigYusShape false df XH 0.55
19 changes: 12 additions & 7 deletions font-src/glyphs/letter/cyrillic/small-yus.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ glyph-block Letter-Cyrillic-SmallYus : begin
select-variant 'cyrl/SmallYus' 0x466 (follow -- 'grek/Lambda')
select-variant 'cyrl/smallYus' 0x467 (follow -- 'grek/Lambda')

define [CyrIotifiedSmallYusShape df top straightBar] : glyph-proc
define [CyrIotifiedSmallYusShape fCapital df top straightBar] : glyph-proc
local gap : (df.width - 2 * df.leftSB - 4 * df.mvs) / 3
define divSub : (df.width - gap - df.mvs) / Width
define dfSub : DivFrame divSub 3
Expand All @@ -53,25 +53,30 @@ glyph-block Letter-Cyrillic-SmallYus : begin
include : VBarLeft df.leftSB 0 top df.mvs
include : HBarTop (df.leftSB - O) [mix df.leftSB df.rightSB (2 / 3)] (top / 2) df.mvs
if SLAB : begin
include : tagged 'serifLT' : if para.isItalic
include : tagged 'serifLT' : if (!fCapital && para.isItalic)
LeftwardTopSerif df.leftSB top SideJut df.mvs
CenterTopSerif (df.leftSB + 0.5 * df.mvs * HVContrast) top Jut df.mvs
if [not para.isItalic] : include : tagged 'serifLB' : LeftwardBottomSerif df.leftSB 0 SideJut df.mvs
if (fCapital || [not para.isItalic]) : begin
include : tagged 'serifLB' : LeftwardBottomSerif df.leftSB 0 SideJut df.mvs
include : tagged 'serifRB' : RightwardBottomSerif df.rightSB 0 SideJut df.mvs

create-glyph : glyph-proc
local df : DivFrame para.diversityM 4
set-width df.width
include : df.markSet.capital
create-forked-glyph 'cyrl/IotifiedSmallYus.straight' : CyrIotifiedSmallYusShape df CAP true
create-forked-glyph 'cyrl/IotifiedSmallYus.curly' : CyrIotifiedSmallYusShape df CAP false
create-forked-glyph 'cyrl/IotifiedSmallYus.straight'
CyrIotifiedSmallYusShape true df CAP true
create-forked-glyph 'cyrl/IotifiedSmallYus.curly'
CyrIotifiedSmallYusShape true df CAP false

create-glyph : glyph-proc
local df : DivFrame para.diversityM 4
set-width df.width
include : df.markSet.e
create-forked-glyph 'cyrl/iotifiedSmallYus.straight' : CyrIotifiedSmallYusShape df XH true
create-forked-glyph 'cyrl/iotifiedSmallYus.curly' : CyrIotifiedSmallYusShape df XH false
create-forked-glyph 'cyrl/iotifiedSmallYus.straight'
CyrIotifiedSmallYusShape false df XH true
create-forked-glyph 'cyrl/iotifiedSmallYus.curly'
CyrIotifiedSmallYusShape false df XH false

select-variant 'cyrl/IotifiedSmallYus' 0x468 (follow -- 'grek/Lambda')
select-variant 'cyrl/iotifiedSmallYus' 0x469 (follow -- 'grek/Lambda')
12 changes: 7 additions & 5 deletions font-src/glyphs/letter/latin/c.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ glyph-block Letter-Latin-C : begin
include : AutoStartSerifR [DivFrame 1] sty XH
include : AutoStartSerifRB [DivFrame 1] styBot Descender

define [IotifiedEsShape df top sma smb] : glyph-proc
define [IotifiedEsShape fCapital df top sma smb] : glyph-proc
local gap : (df.width - 2 * df.leftSB - 2.5 * df.mvs) * 0.375
define divSub : (df.width - gap - df.mvs) / Width
define dfSub : DivFrame divSub 2
Expand All @@ -234,22 +234,24 @@ glyph-block Letter-Latin-C : begin
local sf : SerifFrame top 0 df.leftSB df.rightSB df.mvs
if (df.width > para.refJut * 7) : begin
include : tagged 'serifLT' sf.lt.full
if [not para.isItalic] : include : tagged 'serifLB' sf.lb.full
if (fCapital || [not para.isItalic]) : begin
include : tagged 'serifLB' sf.lb.full
: else : begin
include : tagged 'serifLT' sf.lt.outer
if [not para.isItalic] : include : tagged 'serifLB' sf.lb.outer
if (fCapital || [not para.isItalic]) : begin
include : tagged 'serifLB' sf.lb.outer

create-glyph "cyrl/iotified{E}.\(suffix)" : glyph-proc
local df : DivFrame para.diversityM 2.5
set-width df.width
include : df.markSet.capital
include : IotifiedEsShape df CAP SmoothA SmoothB
include : IotifiedEsShape true df CAP SmoothA SmoothB

create-glyph "cyrl/iotified{e}.\(suffix)" : glyph-proc
local df : DivFrame para.diversityM 2.5
set-width df.width
include : df.markSet.e
include : IotifiedEsShape df XH SmallSmoothA SmallSmoothB
include : IotifiedEsShape false df XH SmallSmoothA SmallSmoothB

select-variant 'C' 'C'
link-reduced-variant 'C/sansSerif' 'C' MathSansSerif
Expand Down
2 changes: 1 addition & 1 deletion font-src/glyphs/letter/latin/w.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ glyph-block Letter-Latin-W : begin
define y1 : mix 0 top 0.8
define x1 : df.leftSB + 0 * OX
define y3 : mix fine top 0.375
define y4 : top - [Math.max (top * 0.1) (1.125 * [AdviceStroke 3.5])]
define y4 : mix y3 top 0.5
define rInY : 1 * [DiagonalTailInnerRadius]

include : dispiro
Expand Down
3 changes: 1 addition & 2 deletions font-src/glyphs/number/5.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ glyph-block Digits-Five : begin
include : difference
glyph-proc
local fiveStroke : include FiveStroke
local firstKnot : currentGlyph.gizmo.unapply fiveStroke.rhsKnots.(fiveStroke.rhsKnots.length - 1)
local firstKnot : currentGlyph.gizmo.unapply fiveStroke.rhsKnots.0

local oblCor : Math.hypot 1 obl
local xVBar : firstKnot.x - oblCor * sw * HVContrast
Expand All @@ -60,7 +60,6 @@ glyph-block Digits-Five : begin

Rect (t2 / 2 + t2 * kGap) (t2 / 2 - t2 * kGap) 0 Middle


if (!bbd && SLAB) : include : DownwardRightSerif xright top VJut

create-glyph 'five.lnum.verticalUpperLeftBar' : glyph-proc
Expand Down
8 changes: 5 additions & 3 deletions font-src/support/geometry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ class DiSpiroGeometry extends GeometryBase {

asContours() {
if (this.m_cachedContours) return this.m_cachedContours;
const { lhs, rhs } = this.expand();
const expandResult = this.expand();
const lhs = [...expandResult.lhs];
const rhs = [...expandResult.rhs];

let rawGeometry;
if (this.m_closed) {
rawGeometry = new CombineGeometry([
new SpiroGeometry(Transform.Id(), this.m_closed, lhs.slice(0, -1)),
new SpiroGeometry(Transform.Id(), this.m_closed, rhs.reverse().slice(0, -1))
new SpiroGeometry(Transform.Id(), true, lhs.slice(0, -1)),
new SpiroGeometry(Transform.Id(), true, rhs.reverse().slice(0, -1))
]);
} else {
lhs[0].type = lhs[lhs.length - 1].type = "corner";
Expand Down

0 comments on commit 6354b52

Please sign in to comment.