Handle the space

This commit is contained in:
Ngô Ngọc Đức Huy 2021-05-15 13:10:40 +07:00
parent f6cb23d832
commit 0f44a64b58
Signed by: huyngo
GPG Key ID: 904AF1C7CDF695C3
2 changed files with 8 additions and 1 deletions

View File

@ -44,6 +44,8 @@ for glyph in glyphs:
glyph_root = prepare_letter(name)
glyph_root.moveto(offset, 0)
background.append([glyph_root])
elif glyph['type'] == 'space':
offset -= 400
else:
C1 = glyph['C1']
C2 = glyph['C2']
@ -110,6 +112,6 @@ for glyph in glyphs:
T_root.scale(1, 0.5)
T_root.moveto(offset, 400)
background.append([T_root])
offset += 900
offset += 800
background.save('output.svg')

View File

@ -87,6 +87,11 @@ sub parse-one ($word) {
if $word <. , ? ! ( ) :> {
return extras($word);
}
if $word eqv '-' {
my %parsing;
%parsing{"type"} = "space";
return %parsing
}
my $C1 = Syllable.parse($word)<onset><consonant>.join;
my $C2 = Syllable.parse(
$word, actions => Parser)<coda>.made;