author | Alberto Bertogli
<albertito@blitiri.com.ar> 2025-06-15 17:28:53 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2025-06-15 17:28:53 UTC |
parent | 30a7e8f92adb31294f2bf22d986eed9fd66e8d97 |
svg.go | +7 | -0 |
test/golden/auto/catra % adora.png | +1 | -0 |
test/golden/auto/catra - adora.png | +1 | -0 |
test/golden/auto/catra adora.png | +0 | -0 |
diff --git a/svg.go b/svg.go index d181645..6830ff2 100644 --- a/svg.go +++ b/svg.go @@ -292,6 +292,13 @@ func wordsToSVG(words []string) (SVG, int, int, error) { return svg, 0, 0, fmt.Errorf( "error converting %q to glyphs: %v", word, err) } + + if len(wordG) == 0 { + // Skip empty words, this can happen with words that contain just + // "-" or "/". + continue + } + wordsG = append(wordsG, wordG) } diff --git a/test/golden/auto/catra % adora.png b/test/golden/auto/catra % adora.png new file mode 120000 index 0000000..6f9d550 --- /dev/null +++ b/test/golden/auto/catra % adora.png @@ -0,0 +1 @@ +catra adora.png \ No newline at end of file diff --git a/test/golden/auto/catra - adora.png b/test/golden/auto/catra - adora.png new file mode 120000 index 0000000..6f9d550 --- /dev/null +++ b/test/golden/auto/catra - adora.png @@ -0,0 +1 @@ +catra adora.png \ No newline at end of file diff --git a/test/golden/auto/catra adora.png b/test/golden/auto/catra adora.png new file mode 100644 index 0000000..b37cc73 Binary files /dev/null and b/test/golden/auto/catra adora.png differ