From 238d9c4acee9adeef473077f8fd2b8e4cc0759f6 Mon Sep 17 00:00:00 2001 From: be5invis Date: Mon, 16 Jan 2017 18:53:09 +0800 Subject: [PATCH] optimize shape for /sym --- glyphs/autobuilds.ptl | 1 + glyphs/common-shapes.ptl | 14 +------------- glyphs/letters-unified-basic.ptl | 10 ++++++++-- glyphs/overmarks.ptl | 6 +++--- glyphs/symbol-math.ptl | 23 ++++++++++++++++------- meta/macros.ptl | 4 ++-- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/glyphs/autobuilds.ptl b/glyphs/autobuilds.ptl index 9dabed6..02d07ff 100644 --- a/glyphs/autobuilds.ptl +++ b/glyphs/autobuilds.ptl @@ -537,6 +537,7 @@ export : define [apply] : begin list 0x1D58 'u' list 0x1D5A 'turnm' list 0x1D5B 'v' + list 0x1D5C 'latinayin' list 0x1D5D 'beta' list 0x1D5E 'gamma' list 0x1D5F 'delta' diff --git a/glyphs/common-shapes.ptl b/glyphs/common-shapes.ptl index 808d335..bb219f7 100644 --- a/glyphs/common-shapes.ptl +++ b/glyphs/common-shapes.ptl @@ -544,18 +544,6 @@ export : define [apply] : begin .af [lambda [before after] [HookShape before after false y tight sw kkaf dontadjust]] } - define [WaveShape] : params [l r cy extendy tension sw] : glyph-construction - local cx : mix l r 0.5 - local wavex : (r - l) * tension - local endwavey : extendy * 0.97 - include : dispiro - widths.center sw - g4 l (cy - endwavey) - bezcontrols.absolute (l + wavex) (cy + extendy) (cx - wavex * 0.8) (cy + extendy) 8 important - g4 cx cy - bezcontrols.absolute (cx + wavex * 0.8) (cy - extendy) (r - wavex) (cy - extendy) 8 important - g4 r (cy + endwavey) - define [CyrDescender x shift connex] : glyph-construction local descenderOverflow : if SLAB SIDEJUT ((RIGHTSB - SB) * [fallback shift 0.1]) include : VBarRight (x + descenderOverflow + 0.25 * STROKE) (HALFSTROKE - LONGJUT) STROKE @@ -642,4 +630,4 @@ export : define [apply] : begin apply-transform : Translate sx sy apply-transform : Italify - return [object select-variant italic-variant alias composite into-unicode turned dual vdual fwl fwr dwl dwr dwc Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend WaveShape CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign] \ No newline at end of file + return [object select-variant italic-variant alias composite into-unicode turned dual vdual fwl fwr dwl dwr dwc Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign] \ No newline at end of file diff --git a/glyphs/letters-unified-basic.ptl b/glyphs/letters-unified-basic.ptl index 5baa770..d2f5b85 100644 --- a/glyphs/letters-unified-basic.ptl +++ b/glyphs/letters-unified-basic.ptl @@ -1633,8 +1633,14 @@ export : define [apply] : begin save 'cyres' 0x441 save 'lunatesigma' 0x3F2 - turned nothing 0x186 'C' MIDDLE (CAP / 2) - turned nothing 0x254 'c' MIDDLE (XH / 2) + turned 'turnC' 0x186 'C' MIDDLE (CAP / 2) + turned 'turnc' 0x254 'c' MIDDLE (XH / 2) + composite glyphs.turnc [into-unicode 0x037B] + composite glyphs.turnC [into-unicode 0x03FD] + composite glyphs.c [DotAt (MIDDLE + HALFSTROKE / 4) (XH/2) DOTRADIUS] [into-unicode 0x037C] + composite glyphs.turnc [DotAt (MIDDLE - HALFSTROKE / 4) (XH/2) DOTRADIUS] [into-unicode 0x037D] + composite glyphs.C [DotAt (MIDDLE + HALFSTROKE / 4) (CAP/2) DOTRADIUS] [into-unicode 0x03FE] + composite glyphs.turnC [DotAt (MIDDLE - HALFSTROKE / 4) (CAP/2) DOTRADIUS] [into-unicode 0x03FF] sketch # strenchedC set-width WIDTH diff --git a/glyphs/overmarks.ptl b/glyphs/overmarks.ptl index 2795bbc..bad3738 100644 --- a/glyphs/overmarks.ptl +++ b/glyphs/overmarks.ptl @@ -190,8 +190,8 @@ export : define [apply] : begin define [TildeShape] : params [ttop tbot leftEnd rightEnd hs] : glyph-construction local fine : hs * 8 / 9 - local hsvh : hs * 2 / (ttop - tbot) - local hvc : (rightEnd - leftEnd) / (ttop - tbot) + local hsvh : hs * 2 / [Math.abs (ttop - tbot)] + local hvc : (rightEnd - leftEnd) / [Math.abs (ttop - tbot)] local defaultHvc : markExtend * 3 / (aboveMarkTop - aboveMarkBot - markFine / 2) local hsvhThin 0.116 @@ -1307,4 +1307,4 @@ export : define [apply] : begin return [object markExtend markHalfStroke markStress markFine markMiddle markDotsRadius aboveMarkTop aboveMarkBot aboveMarkMid belowMarkBot belowMarkTop commaOvershoot - commaOvershoot2 commaAboveRadius] \ No newline at end of file + commaOvershoot2 commaAboveRadius TildeShape] \ No newline at end of file diff --git a/glyphs/symbol-math.ptl b/glyphs/symbol-math.ptl index 00f5c86..d993363 100644 --- a/glyphs/symbol-math.ptl +++ b/glyphs/symbol-math.ptl @@ -320,14 +320,21 @@ export : define [apply] : begin composite glyphs.element glyphs.underlineBelow [into-unicode 0x22F8] sketch # sym - include : WaveShape - l -- SB - r -- RIGHTSB - cy -- parenMid - extendy -- ((operTop - parenMid) * 0.17) - tension -- 0.15 - sw -- OPERATORSTROKE + include : TildeShape + ttop -- parenMid + ((operTop - parenMid) * 0.17) + tbot -- parenMid - ((operTop - parenMid) * 0.17) + leftEnd -- SB + rightEnd -- RIGHTSB + hs -- OPERATORSTROKE / 2 save 'sym' 0x223C + sketch # flipsym + include : TildeShape + tbot -- parenMid + ((operTop - parenMid) * 0.17) + ttop -- parenMid - ((operTop - parenMid) * 0.17) + leftEnd -- SB + rightEnd -- RIGHTSB + hs -- OPERATORSTROKE / 2 + save 'flipsym' 0x223D sketch # ident include : HBar SB RIGHTSB (parenMid + equalHalfSpace * 1.5) OPERATORSTROKE @@ -533,9 +540,11 @@ export : define [apply] : begin ### Others alias 'mathbullet' 0x2219 'bullet' alias 'mathbar' 0x2223 'bar' + notGlyph 'notmathbar' 0x2224 'mathbar' [mix parenMid operTop 0.5] [mix parenMid operBot 0.5] 0.1 alias 'mathsmallcircle' 0x2218 'hwsmallwhitecircle' alias 'mathstar' 0x22C6 'hwblackstar' + sketch # sqrt include : dispiro widths.center OPERATORSTROKE diff --git a/meta/macros.ptl b/meta/macros.ptl index fad6632..73cdfe3 100644 --- a/meta/macros.ptl +++ b/meta/macros.ptl @@ -133,9 +133,9 @@ define-macro save : syntax-rules define-macro glyph-module-entry : syntax-rules `[glyph-module-entry @::_opts] : begin define optionalImports : object - commonShapes `[define [object select-variant italic-variant alias composite into-unicode turned dual vdual fwl fwr dwl dwr dwc Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend WaveShape CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign] $capture.commonShapes] + commonShapes `[define [object select-variant italic-variant alias composite into-unicode turned dual vdual fwl fwr dwl dwr dwc Ring RingAt DotAt CircleRing CircleRingAt CircleDotAt OShape OBarLeftShape OBarRightShape LeftwardTopSerif LeftwardBottomSerif RightwardTopSerif RightwardBottomSerif CenterTopSerif CenterBottomSerif DownwardRightSerif UpwardRightSerif DownwardLeftSerif UpwardLeftSerif AIVSerifs AIHSerifs AINSerifs AICyrISerifs AIMSerifs halfXStrand xStrand nShoulderKnots nShoulder mShoulderSpiro HBar HBarTop HBarBottom HOverlayBar VBar VBarLeft VBarRight VerticalHook LegShape LeftHook HooktopLeftBar CurlyTail HCurlyTail FlatSlashShape determineMixR HookShape hookstart hookend CyrDescender refair Fork Miniature Thinner Widen FlipAround ScaleAround Realign] $capture.commonShapes] - overmarks `[define [object markExtend markHalfStroke markStress markFine markMiddle markDotsRadius aboveMarkTop aboveMarkBot aboveMarkMid belowMarkBot belowMarkTop commaOvershoot commaOvershoot2 commaAboveRadius] $capture.overmarks] + overmarks `[define [object markExtend markHalfStroke markStress markFine markMiddle markDotsRadius aboveMarkTop aboveMarkBot aboveMarkMid belowMarkBot belowMarkTop commaOvershoot commaOvershoot2 commaAboveRadius TildeShape] $capture.overmarks] letterBasic `[define [object ISerifShape IotaShape LShape Belt VShape VHooktopShape WShape WHooktopShape YShape yBaseKnots SmallYShape KShape BShape ItalicCyrveShape PShape RShape CyrYaShape CShape GShape NShape UShape LatinUpsilon2Shape MShape SmallMShape HShape FShape fovershoot LongSShape EShape SmallEShape RevSmallEShape TShape SmallTShape] $capture.letterBasic]