From 0f44a64b58b27475509aecedf19d4149403860f7 Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Sat, 15 May 2021 13:10:40 +0700 Subject: Handle the space --- utils/draw_syllable.py | 4 +++- utils/parse-syllable.raku | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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).join; my $C2 = Syllable.parse( $word, actions => Parser).made; -- cgit 1.4.1