Skip to content

Commit

Permalink
Cleaned up fusion edge-cases and fallback cases.
Browse files Browse the repository at this point in the history
Part of the implementation for gregorio-project#679, gregorio-project#687, and gregorio-project#692.
  • Loading branch information
henryso committed Dec 21, 2015
1 parent f2145ad commit 820d3a0
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 89 deletions.
57 changes: 29 additions & 28 deletions doc/GregorioRef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ local EXCLUDE = {
['.null'] = true,
nonmarkingreturn = true,
PunctumAuctusLineBL = true,
PunctumLineBL = true,
PunctumLineBLBR = true,
PunctumLineBR = true,
PunctumLineTL = true,
PunctumLineTR = true,
PunctumSmall = true,
FlexusNobar = true,
Expand Down Expand Up @@ -85,6 +83,7 @@ local GABC = {
Natural = [[gy]],
NaturalHole = [[\excluded{gy}]],
Oriscus = [[go]],
OriscusLineBL = [[\excluded{e}@go]],
OriscusReversus = [[go^^^^003c]],
OriscusScapus = [[gO]],
OriscusScapusLongqueue = [[hO]],
Expand All @@ -109,6 +108,8 @@ local GABC = {
PunctumCavumInclinatumHole = [[\excluded{Gr}]],
PunctumInclinatum = [[G]],
PunctumInclinatumAuctus = [[G>]],
PunctumLineBL = [[\excluded{e}@g]],
PunctumLineTL = [[\excluded{i}@g]],
Quilisma = [[gw]],
RoundBrace = '[ob:1;6mm]',
RoundBraceDown = '[ub:1;6mm]',
Expand Down Expand Up @@ -139,27 +140,29 @@ local GABC = {

local GABC_FUSE = {
Upper = {
Punctum = [[\excluded{f}@]],
Oriscus = [[\excluded{f}@]],
Pes = [[\excluded{f}@]],
PesQuadratum = [[\excluded{f}@]],
PesQuadratumLongqueue = [[\excluded{g}@]],
PesQuassus = [[\excluded{f}@]],
PesQuassusLongqueue = [[\excluded{g}@]],
Flexus = [[\excluded{f}@]],
Punctum = [[\excluded{e}@]],
Oriscus = [[\excluded{e}@]],
Pes = [[\excluded{e}@]],
PesQuadratum = [[\excluded{e}@]],
PesQuadratumLongqueue = [[\excluded{f}@]],
PesQuassus = [[\excluded{e}@]],
PesQuassusLongqueue = [[\excluded{f}@]],
Flexus = [[\excluded{e}@]],
},
Lower = {
Punctum = [[\excluded{h}@]],
Pes = [[\excluded{h}@]],
PesQuadratum = [[\excluded{h}@]],
PesQuadratumLongqueue = [[\excluded{i}@]],
PesQuassus = [[\excluded{h}@]],
Flexus = [[\excluded{h}@]],
FlexusOriscus = [[\excluded{h}@]],
Punctum = [[\excluded{i}@]],
Pes = [[\excluded{i}@]],
PesQuadratum = [[\excluded{i}@]],
PesQuadratumLongqueue = [[\excluded{j}@]],
PesQuassus = [[\excluded{i}@]],
Flexus = [[\excluded{i}@]],
FlexusOriscus = [[\excluded{i}@]],
},
Up = {
Punctum = [[\excluded{@ij}]],
Oriscus = [[\excluded{@ij}]],
OriscusScapus = [[\excluded{@ij}]],
OriscusScapusLongqueue = [[\excluded{@jk}]],
Quilisma = [[\excluded{@ij}]],
Flexus = [[\excluded{@gi}]],
FlexusNobar = [[\excluded{@hj}]],
Expand Down Expand Up @@ -298,20 +301,18 @@ function GregorioRef.emit_score_glyphs(cs_greciliae, cs_gregorio, cs_parmesan)
end
end
local function compare(x, y)
if x[1] < y[1] then
local nx = x[1]..x[2]
local ny = y[1]..y[2]
if nx < ny then
return true
elseif x[1] == y[1] then
if x[2] < y[2] then
elseif nx == ny then
if x[4] < y[4] then
return true
elseif x[2] == y[2] then
if x[4] < y[4] then
elseif x[4] == y[4] then
if x[5] < y[5] then
return true
elseif x[5] == y[5] and x[3] < y[3] then
return true
elseif x[4] == y[4] then
if x[5] < y[5] then
return true
elseif x[5] == y[5] and x[3] < y[3] then
return true
end
end
end
end
Expand Down
74 changes: 63 additions & 11 deletions fonts/greciliae-base.sfd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1176402534
ModificationTime: 1450573924
ModificationTime: 1450668591
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
Expand Down Expand Up @@ -67,7 +67,7 @@ Grid
17.75 -700 l 0
EndSplineSet
TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144
BeginChars: 379 162
BeginChars: 379 164

StartChar: Punctum
Encoding: 0 -1 0
Expand Down Expand Up @@ -2766,7 +2766,7 @@ EndSplineSet
Validated: 33
EndChar

StartChar: obase4
StartChar: OriscusLineBL
Encoding: 117 -1 114
Width: 166
VWidth: 2537
Expand Down Expand Up @@ -2801,19 +2801,19 @@ VStem: 0 18<-74 -12.5> 148 18<113.639 159>
LayerCount: 2
Fore
SplineSet
127 112 m 0
136 112 148 115 148 120 c 2
148 159 l 1
166 159 l 1
127 112 m 4
136 112 148 115 148 120 c 6
148 159 l 5
166 159 l 5
166 6 l 2
166 -20 159 -45 127 -45 c 0
106 -45 61 -11 39 -11 c 0
30 -11 23 -13 18 -17 c 1
18 -74 l 1
0 -74 l 1
0 94 l 2
0 133 27 137 41 137 c 0
70 137 106 112 127 112 c 0
0 94 l 6
0 133 27 137 41 137 c 4
70 137 106 112 127 112 c 4
EndSplineSet
Validated: 1
EndChar
Expand Down Expand Up @@ -3955,10 +3955,62 @@ SplineSet
6.5 125.101 l 2
2.16699 125.101 0 122.067 0 116 c 2
0 -63 l 25
7.01953 -63 18 -63 18 -63 c 0
18 -63 l 0
18 -53 22 -46 30 -41 c 0
30.9537 -31.9418 51.467 -26.3018 79.2998 -26.2998 c 0
EndSplineSet
EndChar

StartChar: OriscusScapusLongqueueLineTR
Encoding: 162 -1 162
Width: 166
VWidth: 2537
Flags: HW
HStem: -409 15 -94 15 221 15 536 15
LayerCount: 2
Fore
SplineSet
166 13 m 2
166 -13.5195 158.4 -37.1504 127.2 -37.1504 c 0
106.136 -37.1504 61.2451 -3.34961 38.7998 -3.34961 c 0
30.4809 -3.34961 23.6299 -5.4375 18.666 -9.35352 c 1
18.7998 -328.5 l 2
18.8184 -373.741 17.5 -375.3 12.2998 -375.3 c 1
4.5 -372.7 0.0146484 -365.935 0 -354.668 c 1
0 94 l 2
0 133 27 137 41 137 c 0
70 137 106 112 127 112 c 0
136 112 148 115 148 120 c 2
148 159 l 1
166 159 l 1
166 13 l 2
EndSplineSet
EndChar

StartChar: OriscusScapusLineTR
Encoding: 163 -1 163
Width: 166
VWidth: 2537
Flags: HW
HStem: -409 15 -94 15 221 15 536 15
LayerCount: 2
Fore
SplineSet
166 13 m 2
166 -13.5195 158.4 -37.1504 127.2 -37.1504 c 0
106.136 -37.1504 61.2451 -3.34961 38.7998 -3.34961 c 0
30.0989 -3.34961 23.3105 -5.96582 17.833 -9.80957 c 1
17.7998 -204.3 l 2
17.792 -249.54 16.5 -251.1 11.2998 -251.1 c 1
3.5 -249.367 0.00683594 -242.433 0 -230.3 c 2
0 94 l 2
0 133 27 137 41 137 c 0
70 137 106 112 127 112 c 0
136 112 148 115 148 120 c 2
148 159 l 1
166 159 l 1
166 13 l 2
EndSplineSet
EndChar
EndChars
EndSplineFont
75 changes: 65 additions & 10 deletions fonts/gregorio-base.sfd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1176402534
ModificationTime: 1450575277
ModificationTime: 1450668723
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
Expand All @@ -41,7 +41,7 @@ NameList: Adobe Glyph List
DisplaySize: -96
AntiAlias: 1
FitToEm: 1
WinInfo: 32 16 4
WinInfo: 96 16 4
Grid
-1000 -77.1348 m 0
2000 -77.1348 l 0
Expand All @@ -53,7 +53,7 @@ Grid
22 -700 l 0
EndSplineSet
TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144
BeginChars: 375 149
BeginChars: 375 151

StartChar: Punctum
Encoding: 0 -1 0
Expand Down Expand Up @@ -2595,7 +2595,7 @@ EndSplineSet
Validated: 33
EndChar

StartChar: obase4
StartChar: OriscusLineBL
Encoding: 113 -1 110
Width: 164
VWidth: 2048
Expand Down Expand Up @@ -2638,12 +2638,12 @@ SplineSet
41 26 30 21 22 16 c 1
22 -24 l 1
0 -24 l 1
0 130 l 1
12 144 31 160 52 160 c 0
83 160 99 133 118 129 c 0
135 126 139 135 142 142 c 1
142 157 l 1
164 157 l 1
0 130 l 5
12 144 31 160 52 160 c 4
83 160 99 133 118 129 c 4
135 126 139 135 142 142 c 5
142 157 l 5
164 157 l 5
164 22 l 2
164 6.09481 145.261 -6.68724 125.721 -6.68724 c 0
EndSplineSet
Expand Down Expand Up @@ -3577,5 +3577,60 @@ SplineSet
0 130.332 l 1
EndSplineSet
EndChar

StartChar: OriscusScapusLongqueueLineTR
Encoding: 150 -1 149
Width: 164
VWidth: 2048
Flags: HW
HStem: -409 15 -94 15 221 15 536 15
LayerCount: 2
Fore
SplineSet
164 22 m 17
164 21 164 20 164 19 c 0
164 5 144 -7 125 -7 c 0
123 -7 120 -6 118 -6 c 1
90 0 84 24 52 26 c 1
40 25 22 18 22 8 c 2
22 -356 l 25
22 -356 19 -365 0 -365 c 1
0 130 l 1
12 144 31 160 52 160 c 0
83 160 99 133 118 129 c 0
135 126 139 135 142 142 c 1
142 157 l 1
164 157 l 1
164 22 l 17
EndSplineSet
EndChar

StartChar: OriscusScapusLineTR
Encoding: 151 -1 150
Width: 164
VWidth: 2048
Flags: HW
HStem: -409 15 -94 15 221 15 536 15
LayerCount: 2
Fore
SplineSet
0 130 m 1
12 144 31 160 52 160 c 0
83 160 99 133 118 129 c 0
135 126 139 135 142 142 c 1
142 157 l 1
164 157 l 1
164 22.1729 l 17
164.202 21.1722 164.299 20.1788 164.299 19.1961 c 0
164.299 5.03959 144.092 -6.90644 125.048 -6.90644 c 0
122.667 -6.90644 120.304 -6.71969 118.001 -6.32715 c 1
89.751 -0.827148 84.7041 24.1152 52.251 26.1729 c 1
40.6015 25.2549 22 17.4121 22 7.5 c 2
22.0039 -212.293 l 25
22.0039 -212.293 18.667 -220.667 0 -220.668 c 1
0 -41.25 l 25
0 130 l 1
EndSplineSet
EndChar
EndChars
EndSplineFont
Loading

0 comments on commit 820d3a0

Please sign in to comment.