Skip to content

Commit

Permalink
Clock Face (#1913)
Browse files Browse the repository at this point in the history
* clock face

* minor fixes

* fix version
  • Loading branch information
Logo121 committed Aug 12, 2023
1 parent cf61c2d commit 2824f4c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changes/26.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Add characters:
- CLOCK FACE ONE OCLOCK (`U+1F550`) ... CLOCK FACE TWELVE-THIRTY (`U+1F567`) (#1850).
2 changes: 1 addition & 1 deletion font-src/glyphs/symbol/geometric/stars.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ glyph-block Symbol-Geometric-Stars : for-width-kinds WideWidth1
corner
Geom.MidX + Geom.Size * mag * [Math.sin (-angle)]
Geom.MidY + Geom.Size * mag * [Math.cos (-angle)]
widths.center sw
widths.center sw
3 changes: 2 additions & 1 deletion font-src/glyphs/symbol/pictograph.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ export : define [apply] : begin
run-glyph-module "./pictograph/astronomy.mjs"
run-glyph-module "./pictograph/atom.mjs"
run-glyph-module "./pictograph/bolt-symbol.mjs"
run-glyph-module "./pictograph/cross.mjs"
run-glyph-module "./pictograph/checking-marks.mjs"
run-glyph-module "./pictograph/clock.mjs"
run-glyph-module "./pictograph/cross.mjs"
run-glyph-module "./pictograph/faces.mjs"
run-glyph-module "./pictograph/flags.mjs"
run-glyph-module "./pictograph/heart.mjs"
Expand Down
42 changes: 42 additions & 0 deletions font-src/glyphs/symbol/pictograph/clock.ptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$$include '../../../meta/macros.ptl'

import [mix linreg clamp fallback] from"../../../support/utils.mjs"
import [DesignParameters] from"../../../meta/aesthetics.mjs"

glyph-module

glyph-block Symbol-Geometric-Clock : for-width-kinds WideWidth1
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Symbol-Geometric-Shared : GeometricDim UnicodeWeightGrade GeometricSizes

define Geom : GeometricDim MosaicUnitWidth MosaicWidth

define pHour 0.6
define pMin 0.8

define lightSw : UnicodeWeightGrade 3 Geom.Scalar
define mediumSw : UnicodeWeightGrade 5 Geom.Scalar

define [patterns min su] : foreach [hr: range 0 12] : begin
local name : 'clock' + [(hr + 1).toString 10 :.padStart 2 '0'] + [min.toString 10 :.padStart 2 '0']
create-glyph [MangleName name] [MangleUnicode (su + hr)] : glyph-proc
set-width MosaicWidth

include : RingStrokeAt Geom.MidX Geom.MidY Geom.Size mediumSw
include : CircleRingAt Geom.MidX Geom.MidY [Math.max (0.6 * mediumSw) (0.1 * Geom.Size)]
local minAngle : 2 * Math.PI * (min / 60)
include : dispiro
corner Geom.MidX Geom.MidY [widths.center lightSw]
corner
Geom.MidX + (Geom.Size - mediumSw) * pMin * [Math.sin minAngle]
Geom.MidY + (Geom.Size - mediumSw) * pMin * [Math.cos minAngle]
local hrAngle : 2 * Math.PI * ((min / 60 + hr + 1) / 12)
include : dispiro
corner Geom.MidX Geom.MidY [widths.center mediumSw]
corner
Geom.MidX + (Geom.Size - mediumSw) * pHour * [Math.sin hrAngle]
Geom.MidY + (Geom.Size - mediumSw) * pHour * [Math.cos hrAngle]

patterns 0 0x1F550
patterns 30 0x1F55C
1 change: 0 additions & 1 deletion font-src/glyphs/symbol/pictograph/cross.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ glyph-block Symbol-Cross : for-width-kinds WideWidth1
set-width Geom.Width
include : LatinCross mediumSw false
include : RingStrokeAt Geom.MidX yCenter (pRing * shortSize + 0.5 * mediumSw) mediumSw

0 comments on commit 2824f4c

Please sign in to comment.