Macro cleanup

This commit is contained in:
be5invis 2020-09-06 06:48:56 -07:00
parent 2c3585cfb0
commit 8703edc125
4 changed files with 10 additions and 35 deletions

View file

@ -5,6 +5,7 @@ import '../../support/transform' as Transform
import [mix linreg clamp fallback] from '../../support/utils'
import [Cv AnyDerivingCv Radical] from '../../support/gr'
import [designParameters] from '../../meta/aesthetics'
import '../../support/point' as Point
glyph-module
@ -438,13 +439,13 @@ glyph-block CommonShapes : begin
flat (x + extend - [if (extend > 0) 0.01 (-0.01)]) (y - depth)
curl (x + extend) (y - depth)
define [LegShape] : params [[ztop nothing (xt <> top)] [zbot nothing (xs <> bottom)] xb [fine Stroke]] : glyph-proc
define [LegShape] : params [ztop zbot xb [fine Stroke]] : glyph-proc
include : dispiro
widths.lhs fine
flat xt top [heading Downward]
curl xb (bottom + LongJut)
flat ztop.x ztop.y [heading Downward]
curl xb (zbot.y + LongJut)
alsoThruThem {{0.5 0.94}}
g4.left.end xs (bottom + fine) [heading Leftward]
g4.left.end zbot.x (zbot.y + fine) [heading Leftward]
define [LeftHook x y xextend] : glyph-proc
local fine : adviceBlackness 4.25

View file

@ -2,6 +2,7 @@ $$include '../../meta/macros.ptl'
import [mix barmixL linreg clamp fallback] from '../../support/utils'
import [designParameters] from '../../meta/aesthetics'
import '../../support/point' as Point
glyph-module
@ -309,8 +310,8 @@ glyph-block Letter-Cyrillic-El : begin
include : VBarRight cutright 0 top
include : HBar cutleft cutright (top - HalfStroke)
include : LegShape
ztop -- (cutleft <> top)
zbot -- ([mix SB 0 [if SLAB 1 0.75]] <> 0)
ztop -- [Point.cornerFromXY cutleft top]
zbot -- [Point.cornerFromXY [mix SB 0 [if SLAB 1 0.75]] 0]
xb -- cutleft2
if SLAB : begin
include : RightwardTopSerif cutright top SideJut
@ -651,8 +652,8 @@ glyph-block Letter-Cyrillic-Lje : begin
local jut : Jut * 0.72
set-width df.width
include : LegShape
ztop -- (xlefttop <> top)
zbot -- ([mix l 0 [if SLAB 1 0.75]] <> 0)
ztop -- [Point.cornerFromXY xlefttop top]
zbot -- [Point.cornerFromXY [mix l 0 [if SLAB 1 0.75]] 0]
xb -- [mix l r 0.025]
fine -- MVertStroke
include : CyrYeriShape top (middle - MVertStroke / 2 * HVContrast) (r - O) MVertStroke jut

View file

@ -31,31 +31,6 @@ define-macro params : syntax-rules
ps.push : formOf body
return : dirty ps
### Point macro
define-operator "<>" 800 "never" : begin
local tClass [definingEnv.newt 'class']
local m : syntax-rules
`(@x <> @y) `[new @tClass @x @y]
set coinit.initFn : lambda [m] : begin
set m.toPattern : lambda [form env wrapper] : match form
`(@x <> @y) : begin
local p1 [toPattern x env wrapper]
local p2 [toPattern y env wrapper]
object
whether : lambda [t] `(@t && @[p1.whether `(@t.x)] && @[p2.whether `(@t.y)])
assign : lambda [t locallyQ] : ex `[begin
@{".preserve" [p1.assign `(@t.x) locallyQ]}
@{".preserve" [p2.assign `(@t.y) locallyQ]}
] env
set coinit.injectForm `[define [@tClass x y] : begin \\
set this.x x
set this.y y
return nothing
]
return m
### Necessary macros
# A glyph construction is a function which "modifies" a glyph.
define-macro glyph-proc : syntax-rules

View file

@ -1,7 +1,5 @@
"use strict";
const { z } = require("typo-geom");
module.exports = class Point {
constructor(x, y, on, cubic) {
this.x = x;