Balanced /at.
This commit is contained in:
parent
6ecbfe6f15
commit
f64a11c4e3
|
@ -61,10 +61,10 @@ create-glyph 'at' : glyph-construction {
|
||||||
|
|
||||||
local sw : adviceBlackness 3.5
|
local sw : adviceBlackness 3.5
|
||||||
local m1 : [mix [SB + sw] [RIGHTSB - sw] 0.47] - sw / 2
|
local m1 : [mix [SB + sw] [RIGHTSB - sw] 0.47] - sw / 2
|
||||||
local m2 : mix m1 RIGHTSB 0.5
|
local m2 : [mix m1 RIGHTSB 0.52] + globalTransform.yx * sw
|
||||||
|
|
||||||
local sma : SMOOTHA * [[RIGHTSB - m1] / [RIGHTSB - SB]]
|
local sma : SMOOTHA * [[RIGHTSB - m1] / [RIGHTSB - SB] * 1.1]
|
||||||
local smb : SMOOTHB * [[RIGHTSB - m1] / [RIGHTSB - SB]]
|
local smb : SMOOTHB * [[RIGHTSB - m1] / [RIGHTSB - SB] * 1.1]
|
||||||
|
|
||||||
include : create-stroke
|
include : create-stroke
|
||||||
:.start-from RIGHTSB [otop - O]
|
:.start-from RIGHTSB [otop - O]
|
||||||
|
@ -73,10 +73,11 @@ create-glyph 'at' : glyph-construction {
|
||||||
:.line-to m2 [otop - O]
|
:.line-to m2 [otop - O]
|
||||||
:.arc-hv-to m1 [otop - sma]
|
:.arc-hv-to m1 [otop - sma]
|
||||||
:.line-to m1 [obot + smb]
|
:.line-to m1 [obot + smb]
|
||||||
:.arc-vh-to [m2 + STROKE * globalTransform.yx] [obot + O]
|
:.arc-vh-to m2 [obot + O]
|
||||||
:.arc-hv-to RIGHTSB [obot + sma]
|
:.arc-hv-to RIGHTSB [obot + sma]
|
||||||
:.line-to RIGHTSB [top - SMOOTHB]
|
:.line-to RIGHTSB [top - SMOOTHB]
|
||||||
:.arc-vh-to MIDDLE [top - O]
|
:.arc-vh-to MIDDLE [top - O]
|
||||||
|
:.heads-to LEFTWARD
|
||||||
:.set-width STROKE 0
|
:.set-width STROKE 0
|
||||||
:.arc-hv-to SB [top - SMOOTHA]
|
:.arc-hv-to SB [top - SMOOTHA]
|
||||||
:.set-width sw 0
|
:.set-width sw 0
|
||||||
|
@ -84,9 +85,8 @@ create-glyph 'at' : glyph-construction {
|
||||||
:.arc-vh-to MIDDLE [bot + O]
|
:.arc-vh-to MIDDLE [bot + O]
|
||||||
:.set-width STROKE 0
|
:.set-width STROKE 0
|
||||||
:.heads-to RIGHTWARD
|
:.heads-to RIGHTWARD
|
||||||
:.line-to [RIGHTSB - HALFSTROKE] [bot + O]
|
:.line-to [RIGHTSB - HALFSTROKE + globalTransform.yx * sw] [bot + O]
|
||||||
:.heads-to RIGHTWARD
|
:.set-samples 6
|
||||||
:.set-samples 4
|
|
||||||
}
|
}
|
||||||
|
|
||||||
### Brackets
|
### Brackets
|
||||||
|
|
|
@ -182,6 +182,9 @@ define [Stroke.prototype.to-outline d1 d2 _samples straight] : begin {
|
||||||
local right ()
|
local right ()
|
||||||
for [local j 0] [j < subSegments.length] [inc j] : begin {
|
for [local j 0] [j < subSegments.length] [inc j] : begin {
|
||||||
local curve subSegments`j
|
local curve subSegments`j
|
||||||
|
left.push [begin [local last [computeOffsetPoint curve j j f1 fpdx fpdy]] (.x last.x .y last.y .onCurve true)]
|
||||||
|
right.push [begin [local last [computeOffsetPoint curve j j f2 fpdx fpdy]] (.x last.x .y last.y .onCurve true)]
|
||||||
|
|
||||||
foreach sample [range 0 samples] : begin {
|
foreach sample [range 0 samples] : begin {
|
||||||
local t : j + sample / samples
|
local t : j + sample / samples
|
||||||
local tn : j + [sample + 1] / samples
|
local tn : j + [sample + 1] / samples
|
||||||
|
@ -210,23 +213,22 @@ define [Stroke.prototype.to-outline d1 d2 _samples straight] : begin {
|
||||||
|
|
||||||
local il : intersection lthis.x lthis.y dlthis.x dlthis.y lnext.x lnext.y dlnext.x dlnext.y
|
local il : intersection lthis.x lthis.y dlthis.x dlthis.y lnext.x lnext.y dlnext.x dlnext.y
|
||||||
if [[not straight] && [nonlinear lthis lnext dlthis] && [nonlinear lthis lnext dlnext] && [il.x != null] && [il.y != null] && [nonlinear lthis il lnext] && [near lthis il lnext]] [then {
|
if [[not straight] && [nonlinear lthis lnext dlthis] && [nonlinear lthis lnext dlnext] && [il.x != null] && [il.y != null] && [nonlinear lthis il lnext] && [near lthis il lnext]] [then {
|
||||||
left.push (.x lthis.x .y lthis.y .onCurve true) (.x il.x .y il.y .onCurve false)
|
left.push (.x il.x .y il.y .onCurve false) (.x lnext.x .y lnext.y .onCurve true)
|
||||||
}] [else {
|
}] [else {
|
||||||
left.push (.x lthis.x .y lthis.y .onCurve true)
|
left.push (.x lnext.x .y lnext.y .onCurve true)
|
||||||
}]
|
}]
|
||||||
|
|
||||||
local ir : intersection rthis.x rthis.y drthis.x drthis.y rnext.x rnext.y drnext.x drnext.y
|
local ir : intersection rthis.x rthis.y drthis.x drthis.y rnext.x rnext.y drnext.x drnext.y
|
||||||
if [[not straight] && [nonlinear rthis rnext drthis] && [nonlinear rthis rnext drnext] && [ir.x != null] && [ir.y != null] && [nonlinear rthis ir rnext] && [near rthis ir rnext]] [then {
|
if [[not straight] && [nonlinear rthis rnext drthis] && [nonlinear rthis rnext drnext] && [ir.x != null] && [ir.y != null] && [nonlinear rthis ir rnext] && [near rthis ir rnext]] [then {
|
||||||
right.push (.x rthis.x .y rthis.y .onCurve true) (.x ir.x .y ir.y .onCurve false)
|
right.push (.x ir.x .y ir.y .onCurve false) (.x rnext.x .y rnext.y .onCurve true)
|
||||||
}] [else {
|
}] [else {
|
||||||
right.push (.x rthis.x .y rthis.y .onCurve true)
|
right.push (.x rnext.x .y rnext.y .onCurve true)
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
left.push [begin [local last [computeOffsetPoint curve [j + 1] j f1 fpdx fpdy]] (.x last.x .y last.y .onCurve true)]
|
|
||||||
right.push [begin [local last [computeOffsetPoint curve [j + 1] j f2 fpdx fpdy]] (.x last.x .y last.y .onCurve true)]
|
|
||||||
}
|
|
||||||
|
|
||||||
shapes.push : left.concat [right.reverse]
|
shapes.push : left.concat [right.reverse]
|
||||||
|
set left ()
|
||||||
|
set right ()
|
||||||
|
}
|
||||||
|
|
||||||
return : shapes.map : function [shape] : begin {
|
return : shapes.map : function [shape] : begin {
|
||||||
# Remove duplicate points
|
# Remove duplicate points
|
||||||
|
|
Loading…
Reference in New Issue
Block a user