Added below marks /dotBelow; Added above mark /dieresisAbove and /caronAbove

This commit is contained in:
Belleve Invis 2015-07-23 23:24:16 +08:00
parent a64f51c74d
commit 9b50c251e7
8 changed files with 2305 additions and 4434 deletions

View File

@ -102,10 +102,10 @@ define [tm anchor] : return (
.type anchor.type
)
define markAboveLower (.anchors (.above [tm (.x MIDDLE .y XH .type BASE)]))
define markAboveCap (.anchors (.above [tm (.x MIDDLE .y CAP .type BASE)]))
define markBelowLower (.anchors (.below [tm (.x MIDDLE .y DESCENDER .type BASE)]))
define markBelowZero (.anchors (.below [tm (.x MIDDLE .y 0 .type BASE)]))
define markAboveLower (.anchors (.above [tm (.x MIDDLE .y XH .type BASE)]))
define markAboveCap (.anchors (.above [tm (.x MIDDLE .y [CAP * 0.97] .type BASE)]))
define markBelowLower (.anchors (.below [tm (.x MIDDLE .y DESCENDER .type BASE)]))
define markBelowZero (.anchors (.below [tm (.x MIDDLE .y 0 .type BASE)]))
define capitalMarks (.anchors (.above markAboveCap.anchors.above .below markBelowZero.anchors.below))
define bMarks (.anchors (.above markAboveCap.anchors.above .below markBelowZero.anchors.below))

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ ClearTable('maxp');
Print("Outline Cleanup...");
AddExtrema();
RemoveOverlap();
ReplaceWithReference(2, 1);
ReplaceWithReference(3, 1);
Simplify(0, 1);
RoundToInt()
RemoveOverlap();

View File

@ -5,17 +5,24 @@ define [isAboveMark mark] : mark && mark.anchors && mark.anchors.above && mark.a
foreach code [range 0x00A0 0xFFFF] : if [not unicodeGlyphs`code] : begin {
local str : String.fromCharCode code
local nfd : str.normalize 'NFD'
if [nfd.length === 2] : begin {
local base unicodeGlyphs`[nfd.charCodeAt 0]
local mark unicodeGlyphs`[nfd.charCodeAt 1]
if [base === glyphs.i && [isAboveMark mark]] : base = glyphs.dotlessi
if [base === glyphs.j && [isAboveMark mark]] : base = glyphs.dotlessj
if [base && mark] : create-glyph [base.name + '_' + mark.name] : glyph-construction {
assign-unicode code
include base true
include mark
if [nfd.length > 1] : begin {
local parts ()
local allFound true
local hasMarkAbove false
foreach j [range 0 nfd.length] : begin {
set parts`j unicodeGlyphs`[nfd.charCodeAt j]
if [not parts`j] : set allFound false
if [isAboveMark parts`j] : set hasMarkAbove true
}
if allFound : begin {
if [parts.0 === glyphs.i && hasMarkAbove] : parts.0 = glyphs.dotlessi
if [parts.0 === glyphs.j && hasMarkAbove] : parts.0 = glyphs.dotlessj
create-glyph [parts.map [[part] -> part.name] :.join '_'] : glyph-construction {
assign-unicode code
include parts.0 BASE
foreach part [items-of : parts.slice 1] : include part
}
}
}
}

View File

@ -2,13 +2,20 @@
### Combining marks
local markExtend [ACCENTX * 0.5]
local markHalfStroke : 0.5 * [Math.min STROKE [ACCENT * 0.6]]
local markFine : markHalfStroke * 0.8
local markStress : 0.5 * [Math.min STROKE [ACCENT * 0.6]]
local markFine : markStress * 0.8
local markHalfStroke : mix markFine markStress 0.5
local markMiddle [-MIDDLE]
local markDotsRadius : DOTRADIUS * markHalfStroke / HALFSTROKE
local markDotsRadius : DOTRADIUS * markStress / HALFSTROKE
local aboveMarkTop [XH + ACCENT * 1.6 - HALFSTROKE]
local aboveMarkBot [XH + ACCENT - STROKE]
local aboveMarkTop [XH + ACCENT * 1.375]
local aboveMarkBot [XH + ACCENT * 0.35]
local belowMarkBot [0 - ACCENT * 1.375]
local belowMarkTop [0 - ACCENT * 0.35]
### Above marks
create-glyph 'dotAbove' : glyph-construction {
set-width 0
@ -46,10 +53,10 @@ create-glyph 'graveAbove' : glyph-construction {
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
put-shapes : create-stroke
:.start-from [markMiddle + markHalfStroke] aboveMarkBot
:.start-from [markMiddle + markStress] aboveMarkBot
:.set-width markFine markFine
:.line-to [markMiddle - markExtend] aboveMarkTop
:.set-width markHalfStroke markHalfStroke
:.set-width markStress markStress
:.to-outline
}
create-glyph 'acuteAbove' : glyph-construction {
@ -58,10 +65,10 @@ create-glyph 'acuteAbove' : glyph-construction {
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
put-shapes : create-stroke
:.start-from [markMiddle - markHalfStroke] aboveMarkBot
:.start-from [markMiddle - markStress] aboveMarkBot
:.set-width markFine markFine
:.line-to [markMiddle + markExtend] aboveMarkTop
:.set-width markHalfStroke markHalfStroke
:.set-width markStress markStress
:.to-outline
}
create-glyph 'circumflexAbove' : glyph-construction {
@ -70,18 +77,37 @@ create-glyph 'circumflexAbove' : glyph-construction {
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
put-shapes : create-stroke
:.start-from [markMiddle - markExtend - markHalfStroke] aboveMarkBot
:.set-width markHalfStroke markHalfStroke
:.start-from [markMiddle - markExtend - markStress] [aboveMarkBot + markStress - markFine]
:.set-width markStress markStress
:.line-to markMiddle [aboveMarkTop + markFine * 0.7]
:.heads-to UPWARD
:.to-outline
:.to-outline 0 0 1
put-shapes : create-stroke
:.start-from [markMiddle + markExtend + markHalfStroke] aboveMarkBot
:.set-width markHalfStroke markHalfStroke
:.start-from [markMiddle + markExtend + markStress] [aboveMarkBot + markStress - markFine]
:.set-width markStress markStress
:.line-to markMiddle [aboveMarkTop + markFine * 0.7]
:.heads-to UPWARD
:.to-outline
:.to-outline 0 0 1
}
create-glyph 'caronAbove' : glyph-construction {
set-width 0
assign-unicode 0x30c
set-anchor 'above' MARK markMiddle XH markMiddle aboveMarkTop
put-shapes : create-stroke
:.start-from [markMiddle - markExtend - markStress] aboveMarkTop
:.set-width markStress markStress
:.line-to markMiddle [aboveMarkBot - markFine * 1.7 + markStress]
:.heads-to DOWNWARD
:.to-outline 0 0 1
put-shapes : create-stroke
:.start-from [markMiddle + markExtend + markStress] aboveMarkTop
:.set-width markStress markStress
:.line-to markMiddle [aboveMarkBot - markFine * 1.7 + markStress]
:.heads-to DOWNWARD
:.to-outline 0 0 1
}
create-glyph 'tildeAbove' : glyph-construction {
set-width 0
@ -96,13 +122,13 @@ create-glyph 'tildeAbove' : glyph-construction {
local top : ttop + [markFine * 2]
local bot : tbot - [markFine * 2]
local tildeWave [linreg 40 1.45 52 1.33 markHalfStroke]
local tildeWave [linreg 40 1.52 52 1.33 markStress]
local tildeWaveX 0.52
local tildeWaveEnd 0
put-shapes : create-stroke
:.start-from leftEnd [mix tbot ttop tildeWaveEnd]
:.set-width markHalfStroke markHalfStroke
:.set-width markStress markStress
:.cubic-to [mix leftEnd rightEnd tildeWaveX] [mix bot top tildeWave] [mix leftEnd rightEnd [1 - tildeWaveX]] [mix bot top [1 - tildeWave]] rightEnd [mix tbot ttop [1 - tildeWaveEnd]]
:.to-outline 0 0 11
}
@ -115,10 +141,21 @@ create-glyph 'macronAbove' : glyph-construction {
local rightEnd [markMiddle + markExtend * 1.5]
put-shapes : create-stroke
:.start-from leftEnd [mix aboveMarkTop aboveMarkBot 0.5]
:.start-from leftEnd [aboveMarkTop - DOTRADIUS]
:.set-width markHalfStroke markHalfStroke
:.heads-to RIGHTWARD
:.line-to rightEnd [mix aboveMarkTop aboveMarkBot 0.5]
:.line-to rightEnd [aboveMarkTop - DOTRADIUS]
:.heads-to RIGHTWARD
:.to-outline
}
### Below marks
create-glyph 'dotBelow' : glyph-construction {
set-width 0
assign-unicode 0x323
set-anchor 'below' MARK markMiddle 0 markMiddle belowMarkBot
put-shapes : list {
Ring [0 - ACCENT + DOTRADIUS] [0 - ACCENT - DOTRADIUS] [markMiddle - DOTRADIUS] [markMiddle + DOTRADIUS]
}
}

View File

@ -33,7 +33,7 @@ $(SUPPORT_FILES) :
.buildglyphs.all.patel : buildglyphs-intro.patel $(GLYPH_SEGMENTS) buildglyphs-final.patel
cat $^ > .buildglyphs.all.patel
buildglyphs.js : .buildglyphs.all.patel
patel-c --strict -o $@ $^
patel-c --strict $^ | uglifyjs -c -b -o $@
support/glyph.js : support/glyph.patel
support/stroke.js : support/stroke.patel
parameters.js : parameters.patel

View File

@ -24,7 +24,7 @@
'kappa': 0.515,
'italicangle': 0,
'longjut': 175,
'accent': 175,
'accent': 160,
'accentx': 200,
'tbalance': 70,
'tbalance2': 30,

View File

@ -25,8 +25,9 @@ define regular (
.kappa 0.515
.italicangle 0
.longjut 175
.accent 175
.accent 160
.accentx 200
.tbalance 70
.tbalance2 30
.rbalance 25