More cleanup (#1568, #1569, # 1570, #1571)

This commit is contained in:
be5invis 2023-02-26 06:40:11 -08:00
parent c5d322709a
commit e5178514c7
5 changed files with 36 additions and 31 deletions

View file

@ -6,4 +6,4 @@
- MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE (`U+1E06D`).
- COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I (`U+1E08F`).
* Add variants for partial differential symbol (#1503).
* Prevent pathological geometry produced in phonetic ligatures (#1562, #1565, #1566).
* Prevent pathological geometry produced in phonetic ligatures (#1562, #1565, #1566, #1568, #1569, # 1570, #1571).

View file

@ -359,7 +359,7 @@ class CoordinateAligner {
}
apply() {
for (let i = 0; i < this.c.length; i++) {
this.lensSet(this.c[i], this.lens(this.c[this.find(i)]));
this.lensSet(this.c[i], Math.round(this.lens(this.c[this.find(i)])));
}
}
}
@ -379,12 +379,11 @@ function occurrentPrecisionEqual(a, b) {
function aligned(a, b, c) {
return a === b && b === c;
}
function between(a, b, c) {
return (a <= b && b <= c) || (a >= b && b >= c);
}
function pointsColinear(zPrev, zCurr, zNext) {
if (aligned(zPrev.x, zCurr.x, zNext.x) && between(zPrev.y, zCurr.y, zNext.y)) return true;
if (aligned(zPrev.y, zCurr.y, zNext.y) && between(zPrev.x, zCurr.x, zNext.x)) return true;
// No need to check in-betweenness, we can safely remove the corner
if (aligned(zPrev.x, zCurr.x, zNext.x)) return true;
if (aligned(zPrev.y, zCurr.y, zNext.y)) return true;
return false;
}

View file

@ -1269,8 +1269,8 @@ glyph-block Autobuild-Pnonetic-Ligatures : begin
local dist (Stroke * 2)
local maskOuts : list
createMaskout c1 c2 0.1
createMaskout c1 c2 (dist - 0.1)
createMaskout c1 c2 0.01
createMaskout c1 c2 (dist - 0.01)
while (s < dist) : begin
maskOuts.push : createMaskout c1 c2 s
set s : s + step

View file

@ -214,37 +214,43 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
create-glyph [MangleName 'uni25D8'] [MangleUnicode 0x25D8] : glyph-proc
set-width Geom.Width
include : difference
refer-glyph : MangleName 'blackLongRectangle'
intersection [MaskAbove SymbolMid] : refer-glyph : MangleName 'blackLongRectangle'
refer-glyph : MangleName 'blackInvInnerCircle'
create-glyph [MangleName 'uni25D9'] [MangleUnicode 0x25D9] : glyph-proc
set-width Geom.Width
include : difference
refer-glyph : MangleName 'blackLongRectangle'
refer-glyph : MangleName 'whiteInvInnerCircle'
intersection [MaskBelow SymbolMid] : refer-glyph : MangleName 'blackLongRectangle'
refer-glyph : MangleName 'blackInvInnerCircle'
create-glyph [MangleName 'uni25DA'] [MangleUnicode 0x25DA] : glyph-proc
set-width Geom.Width
include : intersection
refer-glyph : MangleName 'uni25D9'
UpperHalfMask
include : difference
intersection [MaskAbove SymbolMid] : refer-glyph : MangleName 'blackLongRectangle'
refer-glyph : MangleName 'whiteInvInnerCircle'
create-glyph [MangleName 'uni25DB'] [MangleUnicode 0x25DB] : glyph-proc
set-width Geom.Width
include : intersection
refer-glyph : MangleName 'uni25D9'
LowerHalfMask
include : difference
intersection [MaskBelow SymbolMid] : refer-glyph : MangleName 'blackLongRectangle'
refer-glyph : MangleName 'whiteInvInnerCircle'
create-glyph [MangleName 'uni25D9'] [MangleUnicode 0x25D9] : glyph-proc
set-width Geom.Width
include : refer-glyph : MangleName 'uni25DA'
include : refer-glyph : MangleName 'uni25DB'
create-glyph [MangleName 'uni2389'] [MangleUnicode 0x2389] : glyph-proc
define shiftUp : ApparentTranslate 0
Math.max
0.5 * [Math.sqrt 2] * Size.MediumSmall.sw
Geom.Size * (1 - Size.MediumSmall.size)
set-width Geom.Width
define shiftUp : Translate 0 [Math.max (0.5 * [Math.sqrt 2] * Size.MediumSmall.sw) (Geom.Size * (1 - Size.MediumSmall.size))]
include : refer-glyph : MangleName 'whiteCircle'
include : intersection
refer-glyph : MangleName 'blackCircle'
refer-glyph : MangleName 'blackCircleO'
union
difference
HBar.m 0 Geom.Width Geom.MidY GeometryStroke
WithTransform shiftUp : refer-glyph : MangleName 'blackMediumEqualDiamond'
WithTransform [ApparentTranslate 0 0.01] : WithTransform shiftUp : refer-glyph : MangleName 'blackMediumEqualDiamond'
intersection
MaskBelow (Geom.MidY + GeometryStroke / 2)
WithTransform shiftUp : refer-glyph : MangleName 'whiteMediumEqualDiamond'
@ -253,7 +259,7 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
set-width Geom.Width
include : refer-glyph : MangleName 'whiteCircle'
include : intersection
refer-glyph : MangleName 'blackCircle'
refer-glyph : MangleName 'blackCircleO'
refer-glyph : MangleName 'whiteEqualTriangleDown'
do "Moon Phases"
@ -265,7 +271,7 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
define [WaxingMoonMask] : union
MaskLeft Geom.MidX
composite-proc
refer-glyph [MangleName 'blackCircle']
refer-glyph [MangleName 'blackCircleO']
Ungizmo
ScaleAround Geom.MidX Geom.MidY 0.625 (1 - 0.5 * GeometryStroke / Geom.Size)
Translate (-GeometryStroke * HVContrast) 0
@ -275,14 +281,14 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
set-width Geom.Width
include : refer-glyph [MangleName 'whiteCircle']
include : intersection
refer-glyph [MangleName 'blackCircle']
refer-glyph [MangleName 'blackCircleO']
WaxingMoonMask
create-glyph [MangleName 'waxingGibbousMoon'] [MangleUnicode 0x1F314] : glyph-proc
set-width Geom.Width
include : refer-glyph [MangleName 'whiteCircle']
include : difference
refer-glyph [MangleName 'blackCircle']
refer-glyph [MangleName 'blackCircleO']
composite-proc
WaxingMoonMask
FlipAround Geom.MidX Geom.MidY
@ -291,14 +297,14 @@ glyph-block Symbol-Geometric-Masked : for-width-kinds WideWidth1
set-width Geom.Width
include : refer-glyph [MangleName 'whiteCircle']
include : difference
refer-glyph [MangleName 'blackCircle']
refer-glyph [MangleName 'blackCircleO']
WaxingMoonMask
create-glyph [MangleName 'waningCrescentMoon'] [MangleUnicode 0x1F318] : glyph-proc
set-width Geom.Width
include : refer-glyph [MangleName 'whiteCircle']
include : intersection
refer-glyph [MangleName 'blackCircle']
refer-glyph [MangleName 'blackCircleO']
composite-proc
WaxingMoonMask
FlipAround Geom.MidX Geom.MidY

View file

@ -409,7 +409,7 @@ glyph-block Symbol-Geometric-Plain : for-width-kinds WideWidth1
define rs : Geom.TallSize / (sizeOrig * 1.5)
return : CircleShape cx cy (sizeOrig * rs - sw)
StdBlackShape CircleShape 'blackCircleO' null
StdBlackShape CircleShape 'blackCircleO' null {.size 0.995}
StdBlackShape CircleShape 'blackCircle' 0x25CF
StdWhiteShape CircleShape 'whiteCircle' 0x25CB