added degree_C and degree_F

This commit is contained in:
be5invis 2016-06-22 02:27:07 +08:00
parent c35d36f451
commit 1c22cb2cb0
2 changed files with 30 additions and 14 deletions

View File

@ -744,10 +744,13 @@ export : define [apply] : begin
# Unicode Ligatures
let : begin
define shrink : clamp 0.75 0.9 : linreg 72 0.75 108 0.9 STROKE
define [createLigatures records] : if [not recursive] : begin
local pendingGlyphs : [records.map : [record] => record.1].concat : records.map : [record] => record.2
local df : Thinner pendingGlyphs shrink 1
define stdShrink : clamp 0.75 0.9 : linreg 72 0.75 108 0.9 STROKE
define [createLigatures shrink1 shrink2 wadj1 wadj2 records] : if [not recursive] : begin
local pendingGlyphs1 : records.map : [record] => record.1
local pendingGlyphs2 : records.map : [record] => record.2
local df1 : Thinner pendingGlyphs1 shrink1
local df2 : Thinner pendingGlyphs2 shrink2
foreach [{unicode c1 c2 mark} : items-of records] : begin
local glyphName "\(c1)_\(c2)"
if glyphs.(glyphName) : begin
@ -755,20 +758,23 @@ export : define [apply] : begin
while glyphs.(glyphName + j) : inc j
set glyphName (glyphName + j)
local kern : SB * 7/8 * (shrink1 + shrink2)
local refw : WIDTH * (shrink1 * wadj1 + shrink2 * wadj2) - kern
sketch
include df.(c2)
include : Translate (WIDTH * shrink - SB * shrink * 1.75) 0
include df.(c1)
include df2.(c2)
include : Translate (WIDTH * shrink1 * wadj1 - kern) 0
include df1.(c1)
include : Translate (-WIDTH * shrink1 * (1 - wadj1) / 2) 0
include : Upright
include : Translate (-WIDTH * shrink + (SB * shrink * 7/8)) 0
include : Scale ((WIDTH - SB * 1.25) / (WIDTH - SB * 2) * WIDTH / (WIDTH * shrink * 2 - SB * shrink * 1.75)) 1
include : Translate (-refw / 2) 0
include : Scale ((WIDTH - SB * 1.25) / (WIDTH - SB * 2) * WIDTH / refw) 1
include : Translate (WIDTH / 2) 0
include : Italify
if mark : include mark
save glyphName unicode
createLigatures : list
createLigatures stdShrink stdShrink 1 1 : list
list 0x1C4 'D' 'Zcaron'
list 0x1C5 'D' 'zcaron'
list 0x1C6 'd' 'zcaron'
@ -794,6 +800,9 @@ export : define [apply] : begin
list 0x479 'o' 'y' markset.p
list 0x20A7 'P' 's'
list 0x20A8 'R' 's'
createLigatures 0.7 0.8 0.75 0.9 : list
list 0x2103 'degree' 'C'
list 0x2109 'degree' 'F'
# Composite superscripts and subscripts
let : begin

View File

@ -591,6 +591,7 @@ export : define [apply] : begin
flat RIGHTSB XH [heading DOWNWARD]
curl RIGHTSB SMOOTHA [heading DOWNWARD]
g4 [mix SB RIGHTSB 1.075] 0 [heading DOWNWARD]
set-anchor 'bottomright' BASE [mix SB RIGHTSB 1.075] 0
save 'a.singlestorey'
select-variant 'a' 'a' [if para.isItalic 'singlestorey' 'doublestorey'] {
@ -607,7 +608,6 @@ export : define [apply] : begin
line-to (RIGHTSB - STROKE * HVCONTRAST) (CAP - STROKE / 2)
line-to RIGHTSB (CAP - O)
save 'largescripta' 0x2C6D
include : FlipAround MIDDLE (CAP / 2)
save 'turnlargescripta' 0x2C70
@ -621,12 +621,16 @@ export : define [apply] : begin
if SLAB : begin
include : RightwardBottomSerif RIGHTSB 0 SIDEJUT
tag-contour 'serifRB'
save 'scripta' 0x0251
turned 'turna' 0x250 'a.doublestorey' MIDDLE (XH / 2)
turned nothing 0x252 'scripta' MIDDLE (XH / 2)
sketch # artail
include glyphs.'a.doublestorey' AS_BASE
eject-contour 'serifRB'
include glyphs.rtailBR
save 'artail' 0x1D8F
### W and w
define [WShape top] : glyph-construction
local wheight (top * 0.6)
@ -1297,7 +1301,10 @@ export : define [apply] : begin
sketch # dhooktop
include markset.b
include glyphs.'a.singlestorey'
include : OBarRightShape
include : VBarRight RIGHTSB 0 XH
include : RightwardBottomSerif RIGHTSB 0 SIDEJUT
tag-contour 'serifRB'
include : VerticalHook (RIGHTSB - HALFSTROKE * HVCONTRAST) XH HOOKX (-HOOK)
save 'dhooktop' 0x257