diff options
author | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2021-05-15 13:10:40 +0700 |
---|---|---|
committer | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2021-05-15 13:10:40 +0700 |
commit | 0f44a64b58b27475509aecedf19d4149403860f7 (patch) | |
tree | 2d7d4054e938cc826df834631c3ce6f0cc8c811c | |
parent | f6cb23d832d552b8969c5fbfb46f64c05122b6f0 (diff) | |
download | haasdaiga-0f44a64b58b27475509aecedf19d4149403860f7.tar.gz |
Handle the space
-rw-r--r-- | utils/draw_syllable.py | 4 | ||||
-rw-r--r-- | utils/parse-syllable.raku | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/utils/draw_syllable.py b/utils/draw_syllable.py index 589e32a..fa0f0d4 100644 --- a/utils/draw_syllable.py +++ b/utils/draw_syllable.py @@ -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') diff --git a/utils/parse-syllable.raku b/utils/parse-syllable.raku index 22ff38b..16deb04 100644 --- a/utils/parse-syllable.raku +++ b/utils/parse-syllable.raku @@ -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; |