From 30e511b0d56ad8ea2602d877b504e69997cbbddf Mon Sep 17 00:00:00 2001 From: be5invis Date: Sat, 19 Sep 2020 03:49:53 -0700 Subject: [PATCH] Add white squares and circles with quadrants (`U+25F0` ... `U+25F7`) and white diagonal half triangles (`U+25F8` ... `U+25FA`, `U+25FF`). --- changes/3.6.1.md | 2 +- font-src/glyphs/symbol/geometric.ptl | 51 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/changes/3.6.1.md b/changes/3.6.1.md index 8c82a42d7..ea4079eab 100644 --- a/changes/3.6.1.md +++ b/changes/3.6.1.md @@ -1,2 +1,2 @@ * Add dice symbols (`U+2680` ... `U+2685`). - * Add medium and extra-small squares (`U+25FB` ... `U+25FE`). \ No newline at end of file + * Add medium and extra-small squares (`U+25FB` ... `U+25FE`), white squares and circles with quadrants (`U+25F0` ... `U+25F7`) and white diagonal half triangles (`U+25F8` ... `U+25FA`, `U+25FF`). \ No newline at end of file diff --git a/font-src/glyphs/symbol/geometric.ptl b/font-src/glyphs/symbol/geometric.ptl index afcda22e2..5b4c30838 100644 --- a/font-src/glyphs/symbol/geometric.ptl +++ b/font-src/glyphs/symbol/geometric.ptl @@ -827,6 +827,57 @@ glyph-block Symbol-Geometric : begin if LTh : include : UpperLeftHalfMark if RBh : include : LowerRightHalfMark + # Quarter-line square and circle + define quarterLineParts : list + list 0x25F0 'whiteSquare' 1 1 0 0 + list 0x25F1 'whiteSquare' 0 1 1 0 + list 0x25F2 'whiteSquare' 0 0 1 1 + list 0x25F3 'whiteSquare' 1 0 0 1 + list 0x25F4 'whiteCircle' 1 1 0 0 + list 0x25F5 'whiteCircle' 0 1 1 0 + list 0x25F6 'whiteCircle' 0 0 1 1 + list 0x25F7 'whiteCircle' 1 0 0 1 + foreach { u frame T L B R } [items-of quarterLineParts] : begin + create-glyph [MangleName ('uni' + u)] [MangleUnicode u] : glyph-proc + local hh : GeometryStroke / 2 * HVContrast + local hv : GeometryStroke / 2 + local s GeometryStroke + set-width MosaicWidth + include : union + refer-glyph [MangleName frame] + if L [HBar (MosaicMiddle - squareRadiusFW + hh) (MosaicMiddle + hh) SymbolMid s] [glyph-proc] + if R [HBar (MosaicMiddle + squareRadiusFW - hh) (MosaicMiddle - hh) SymbolMid s] [glyph-proc] + if T [VBar MosaicMiddle (SymbolMid + squareRadiusFW - hv) (SymbolMid - hv) s] [glyph-proc] + if B [VBar MosaicMiddle (SymbolMid - squareRadiusFW + hv) (SymbolMid + hv) s] [glyph-proc] + + # White diagonal-half square + define whiteHalfTriangleParts : list + list 0x25F8 1 0 0 0 1 0 + list 0x25F9 0 1 0 0 0 1 + list 0x25FA 0 0 1 0 0 1 + list 0x25FF 0 0 0 1 1 0 + foreach { u LT RT LB RB P Q } [items-of whiteHalfTriangleParts] : begin + create-glyph [MangleName ('uni' + u)] [MangleUnicode u] : glyph-proc + set-width MosaicWidth + include : intersection + intersection + refer-glyph [MangleName 'blackSquare'] + union + if LT [UpperLeftHalfMark] [glyph-proc] + if RT [UpperRightHalfMark] [glyph-proc] + if LB [LowerLeftHalfMark] [glyph-proc] + if RB [LowerRightHalfMark] [glyph-proc] + union + refer-glyph [MangleName 'whiteSquare'] + if [not P] [glyph-proc] : dispiro + widths.center (GeometryStroke * 2) + corner (MosaicMiddle - squareRadiusFW * 2) (SymbolMid - squareRadiusFW * 2) + corner (MosaicMiddle + squareRadiusFW * 2) (SymbolMid + squareRadiusFW * 2) + if [not Q] [glyph-proc] : dispiro + widths.center (GeometryStroke * 2) + corner (MosaicMiddle + squareRadiusFW * 2) (SymbolMid - squareRadiusFW * 2) + corner (MosaicMiddle - squareRadiusFW * 2) (SymbolMid + squareRadiusFW * 2) + create-glyph [MangleName 'dottedWhiteTriangle'] [MangleUnicode 0x25EC] : glyph-proc set-width MosaicWidth include : refer-glyph : MangleName 'whiteTriangleUp'