Add Heavy Black Heart (U+2764
) (#920).
This commit is contained in:
parent
ab00d5719e
commit
941e12fb31
5 changed files with 132 additions and 61 deletions
|
@ -7,6 +7,7 @@
|
|||
- Small Element Of with Overbar (`U+22F7`).
|
||||
- Contains with Overbar (`U+22FD`).
|
||||
- Small Contains with Overbar (`U+22FE`).
|
||||
- Heavy Black Heart (`U+2764`) (#920).
|
||||
* Fix misplaced descender on `U+04AD` (#1005).
|
||||
* Fix inconsistent serif on italic variants of Cyrillic En (#1006).
|
||||
* Fix inconsistent serifs on letters with retroflex hooks, like `U+1D99` and `U+01AE` (#1008).
|
||||
|
|
|
@ -10,6 +10,7 @@ export : define [apply] : begin
|
|||
run-glyph-module './pictograph/corner-shape.js'
|
||||
run-glyph-module './pictograph/faces.js'
|
||||
run-glyph-module './pictograph/flags.js'
|
||||
run-glyph-module './pictograph/heart.js'
|
||||
run-glyph-module './pictograph/i-ching.js'
|
||||
run-glyph-module './pictograph/iec-power-and-playback.js'
|
||||
run-glyph-module './pictograph/kome.js'
|
||||
|
|
41
font-src/glyphs/symbol/pictograph/heart.ptl
Normal file
41
font-src/glyphs/symbol/pictograph/heart.ptl
Normal file
|
@ -0,0 +1,41 @@
|
|||
$$include '../../../meta/macros.ptl'
|
||||
|
||||
import [mix linreg clamp fallback] from '../../../support/utils'
|
||||
import [Box] from "../../../support/box"
|
||||
|
||||
glyph-module
|
||||
|
||||
glyph-block Symbol-Pictograph-Heart : begin
|
||||
glyph-block-import CommonShapes
|
||||
glyph-block-import Common-Derivatives
|
||||
glyph-block-import Symbol-Geometric-Shared : GeometricDim
|
||||
|
||||
glyph-block-export HeartShapeImpl
|
||||
define [HeartShapeImpl bound sw tip ext] : begin
|
||||
define heart : bound.withTop : bound.mixY 0.975
|
||||
local y2 : heart.mixY 0.75
|
||||
local y3 : heart.mixY 0.75
|
||||
return : spiro-outline
|
||||
corner heart.xMid (heart.bottom + sw * tip)
|
||||
quadcontrols 1 (2 / 3)
|
||||
g4 (heart.right - O - sw) y2
|
||||
arcvh
|
||||
g4 [heart.mixXMidRight 0.5] (heart.top - sw * tip / 1.75)
|
||||
archv
|
||||
if sw
|
||||
: then : list
|
||||
corner (heart.xMid + sw / 3) (y3 - sw * ext)
|
||||
corner (heart.xMid - sw / 3) (y3 - sw * ext)
|
||||
: else : corner heart.xMid (y3 - sw)
|
||||
arcvh
|
||||
g4 [heart.mixXMidLeft 0.5] (heart.top - sw * tip / 1.75)
|
||||
archv
|
||||
g4 (heart.left + O + sw) y2
|
||||
quadcontrols 0 (1 / 3)
|
||||
close
|
||||
|
||||
for-width-kinds WideWidth1 : begin
|
||||
define Geom : GeometricDim MosaicUnitWidth MosaicWidth
|
||||
create-glyph [MangleName 'blackHeart'] [MangleUnicode 0x2764] : glyph-proc
|
||||
set-width Geom.Width
|
||||
include : HeartShapeImpl [new Box Geom.Top Geom.Bot Geom.Left Geom.Right] 0 0 0
|
|
@ -1,88 +1,69 @@
|
|||
$$include '../../../meta/macros.ptl'
|
||||
|
||||
import [mix linreg clamp fallback] from '../../../support/utils'
|
||||
import [Box] from "../../../support/box"
|
||||
|
||||
glyph-module
|
||||
|
||||
glyph-block Symbol-Pictograph-Suit-Cards : begin
|
||||
glyph-block-import CommonShapes
|
||||
glyph-block-import Common-Derivatives
|
||||
glyph-block-import Symbol-Pictograph-Heart : HeartShapeImpl
|
||||
|
||||
local df : DivFrame para.diversityM
|
||||
local suitTop : mix SymbolMid PictTop 0.75
|
||||
local suitBot : mix SymbolMid PictBot 0.75
|
||||
local suitRight : df.middle + [mix RightSB Width (1 / 2)] - Middle
|
||||
local suitLeft : df.middle - (suitRight - df.middle)
|
||||
local sw : AdviceStroke 4.25
|
||||
|
||||
define df : DivFrame para.diversityM
|
||||
define sw : AdviceStroke 4.25
|
||||
define suit : new Box
|
||||
mix SymbolMid PictTop 0.75
|
||||
mix SymbolMid PictBot 0.75
|
||||
df.middle - [mix RightSB Width (1 / 2)] + Middle
|
||||
df.middle + [mix RightSB Width (1 / 2)] - Middle
|
||||
|
||||
define [wrap g] : glyph-proc
|
||||
set-width df.width
|
||||
include g AS_BASE
|
||||
|
||||
define heartTop : mix suitBot suitTop 0.975
|
||||
define [HeartInnerShape top sw tip ext] : begin
|
||||
local y2 : mix suitBot top 0.75
|
||||
local y3 : mix suitBot top 0.75
|
||||
return : spiro-outline
|
||||
corner df.middle (suitBot + sw * tip)
|
||||
quadcontrols 1 (2 / 3)
|
||||
g4 (suitRight - O - sw) y2
|
||||
arcvh
|
||||
g4 [mix df.middle suitRight 0.5] (top - sw * tip / 1.75)
|
||||
archv
|
||||
if sw
|
||||
: then : list
|
||||
corner (df.middle + sw / 3) (y3 - sw * ext)
|
||||
corner (df.middle - sw / 3) (y3 - sw * ext)
|
||||
: else : corner df.middle (y3 - sw)
|
||||
arcvh
|
||||
g4 [mix df.middle suitLeft 0.5] (top - sw * tip / 1.75)
|
||||
archv
|
||||
g4 (suitLeft + O + sw) y2
|
||||
quadcontrols 0 (1 / 3)
|
||||
close
|
||||
create-glyph 'heartSuit' 0x2665 : wrap
|
||||
HeartShapeImpl suit 0 0 0
|
||||
|
||||
create-glyph 'heartSuit' 0x2665 : wrap : HeartInnerShape heartTop 0 0 0
|
||||
|
||||
create-glyph 'whiteHeartSuit' 0x2661 : wrap : difference [refer-glyph 'heartSuit'] [HeartInnerShape heartTop sw 1.75 0.8]
|
||||
create-glyph 'whiteHeartSuit' 0x2661 : wrap : difference [refer-glyph 'heartSuit']
|
||||
HeartShapeImpl suit sw 1.75 0.8
|
||||
|
||||
create-glyph 'spadeSuit' 0x2660 : wrap : union
|
||||
create-glyph : glyph-proc
|
||||
include : HeartInnerShape suitTop 0 0 0
|
||||
include : HeartShapeImpl [suit.withTop : suit.mixY (1 / 0.975)] 0 0 0
|
||||
include : Upright
|
||||
include : Translate (-df.middle) (-suitBot)
|
||||
include : Translate (-suit.xMid) (-suit.bottom)
|
||||
include : Scale 1 (-0.75)
|
||||
include : Translate df.middle suitTop
|
||||
include : Translate suit.xMid suit.top
|
||||
include : Italify
|
||||
HBarBottom [mix SB df.rightSB 0.25] [mix df.rightSB SB 0.25] suitBot sw
|
||||
VBar df.middle suitBot [mix suitBot suitTop (1 - 0.75 * 0.75)] sw
|
||||
HBarBottom [mix df.leftSB df.rightSB 0.25] [mix df.rightSB df.leftSB 0.25] suit.bottom sw
|
||||
VBar suit.xMid suit.bottom [suit.mixY (1 - 0.75 * 0.75)] sw
|
||||
|
||||
create-glyph 'whiteSpadeSuit' 0x2664 : wrap : difference [refer-glyph 'spadeSuit'] : create-glyph : glyph-proc
|
||||
include : HeartInnerShape suitTop sw 2 0
|
||||
include : HeartShapeImpl [suit.withTop : suit.mixY (1 / 0.975)] sw 2 0
|
||||
include : Upright
|
||||
include : Translate (-df.middle) (-suitBot)
|
||||
include : Translate (-suit.xMid) (-suit.bottom)
|
||||
include : Scale 1 (-0.75)
|
||||
include : Translate df.middle suitTop
|
||||
include : Translate suit.xMid suit.top
|
||||
include : Italify
|
||||
|
||||
local clubTopY : mix suitTop suitBot 0.22
|
||||
local clubTriangleHeight : (suitTop - suitBot) * 0.3
|
||||
local clubTopY : suit.mixY 0.78
|
||||
local clubTriangleHeight : (suit.top - suit.bottom) * 0.3
|
||||
define [ClubTriangles r] : union
|
||||
RingAt df.middle clubTopY r
|
||||
RingAt (df.middle - clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight) r
|
||||
RingAt (df.middle + clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight) r
|
||||
RingAt suit.xMid clubTopY r
|
||||
RingAt (suit.xMid - clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight) r
|
||||
RingAt (suit.xMid + clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight) r
|
||||
spiro-outline
|
||||
corner df.middle clubTopY
|
||||
corner (df.middle - clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight)
|
||||
corner (df.middle + clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight)
|
||||
corner suit.xMid clubTopY
|
||||
corner (suit.xMid - clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight)
|
||||
corner (suit.xMid + clubTriangleHeight / [Math.sqrt 3]) (clubTopY - clubTriangleHeight)
|
||||
|
||||
define [ClubShape r] : create-glyph : glyph-proc
|
||||
include : ClubTriangles r
|
||||
include : HBarBottom [mix SB df.rightSB 0.25] [mix df.rightSB SB 0.25] suitBot sw
|
||||
include : VBar df.middle suitBot [mix suitBot suitTop 0.45] sw
|
||||
define [ClubShape r] : create-glyph : union
|
||||
ClubTriangles r
|
||||
HBarBottom [mix df.leftSB df.rightSB 0.25] [mix df.rightSB df.leftSB 0.25] suit.bottom sw
|
||||
VBar suit.xMid suit.bottom [suit.mixY 0.45] sw
|
||||
|
||||
local circleRadius : (suitTop - suitBot) * 0.18
|
||||
local circleRadius : (suit.top - suit.bottom) * 0.18
|
||||
|
||||
create-glyph 'clubSuit' 0x2663 : wrap : ClubShape circleRadius
|
||||
|
||||
|
@ -92,14 +73,14 @@ glyph-block Symbol-Pictograph-Suit-Cards : begin
|
|||
include : difference [ClubShape ro] [ClubTriangles ri]
|
||||
|
||||
create-glyph 'diamondSuit' 0x2666 : wrap : spiro-outline
|
||||
corner df.middle suitTop
|
||||
corner (suitRight - O) SymbolMid
|
||||
corner df.middle suitBot
|
||||
corner (suitLeft + O) SymbolMid
|
||||
corner suit.xMid suit.top
|
||||
corner (suit.right - O) SymbolMid
|
||||
corner suit.xMid suit.bottom
|
||||
corner (suit.left + O) SymbolMid
|
||||
|
||||
create-glyph 'whiteDiamondSuit' 0x2662 : wrap : intersection [refer-glyph 'diamondSuit']
|
||||
union
|
||||
dispiro [widths.rhs sw] [flat df.middle suitTop] [curl (suitRight - O) SymbolMid]
|
||||
dispiro [widths.rhs sw] [flat (suitRight - O) SymbolMid] [curl df.middle suitBot]
|
||||
dispiro [widths.rhs sw] [flat df.middle suitBot] [curl (suitLeft + O) SymbolMid]
|
||||
dispiro [widths.rhs sw] [flat (suitLeft + O) SymbolMid] [curl df.middle suitTop]
|
||||
dispiro [widths.rhs sw] [flat suit.xMid suit.top] [curl (suit.right - O) SymbolMid]
|
||||
dispiro [widths.rhs sw] [flat (suit.right - O) SymbolMid] [curl suit.xMid suit.bottom]
|
||||
dispiro [widths.rhs sw] [flat suit.xMid suit.bottom] [curl (suit.left + O) SymbolMid]
|
||||
dispiro [widths.rhs sw] [flat (suit.left + O) SymbolMid] [curl suit.xMid suit.top]
|
||||
|
|
47
font-src/support/box.js
Normal file
47
font-src/support/box.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
const { mix } = require("./utils");
|
||||
|
||||
class Box {
|
||||
constructor(t, b, l, r) {
|
||||
this.top = t;
|
||||
this.bottom = b;
|
||||
this.left = l;
|
||||
this.right = r;
|
||||
this.xMid = this.xMiddle = mix(l, r, 0.5);
|
||||
this.yMid = this.yMiddle = mix(b, t, 0.5);
|
||||
}
|
||||
|
||||
withTop(t) {
|
||||
return new Box(t, this.bottom, this.left, this.right);
|
||||
}
|
||||
withBottom(b) {
|
||||
return new Box(this.top, b, this.left, this.right);
|
||||
}
|
||||
withLeft(l) {
|
||||
return new Box(this.top, this.bottom, l, this.right);
|
||||
}
|
||||
withRight(r) {
|
||||
return new Box(this.top, this.bottom, this.left, r);
|
||||
}
|
||||
|
||||
withXPadding(d) {
|
||||
return new Box(this.top, this.bottom, this.left + d, this.right - d);
|
||||
}
|
||||
withYPadding(d) {
|
||||
return new Box(this.top - d, this.bottom + d, this.left, this.right);
|
||||
}
|
||||
|
||||
mixX(t) {
|
||||
return mix(this.left, this.right, t);
|
||||
}
|
||||
mixXMidLeft(t) {
|
||||
return mix(this.xMid, this.left, t);
|
||||
}
|
||||
mixXMidRight(t) {
|
||||
return mix(this.xMid, this.right, t);
|
||||
}
|
||||
mixY(t) {
|
||||
return mix(this.bottom, this.top, t);
|
||||
}
|
||||
}
|
||||
|
||||
exports.Box = Box;
|
Loading…
Add table
Add a link
Reference in a new issue