Drei alte Fehler behoben

- create_picture: </svg> und Dateiausgabe erst nach allen Zeilen
  (vorher pro Zeile, kaputtes SVG bei mehreren Zeilen)
- yalign=bottom: word_height wird jetzt berechnet (vorher NameError)
- CompleteEnding: ValueError statt undefiniertem Csv2CouchError

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Stangl
2026-10-09 08:55:46 +02:00
co-authored by Claude Opus 5.5
parent d4cb697f14
commit 75db9b7024
2 changed files with 9 additions and 8 deletions
+8 -7
View File
@@ -108,6 +108,7 @@ def write_font_line( content, font, params ):
word_height = w.calc_height()
y = ystart * scale_faktor + (pic_height - word_height * scale_faktor)/2.0
elif params['yalign'] == 'bottom':
word_height = w.calc_height()
y = ystart * scale_faktor + pic_height - word_height * scale_faktor
else:
y = ystart
@@ -301,14 +302,14 @@ def create_picture(config, fontinfos, data, pic_path):
randstr = write_random_font_line( content, font, lineparams)
if randstr: svgstr = svgstr + randstr
svgstr = svgstr + picend
svgstr = svgstr + picend
if options.dry:
print(svgstr)
else:
f = open(pic_path, 'w', encoding='utf-8')
f.write( svgstr )
f.close()
if options.dry:
print(svgstr)
else:
f = open(pic_path, 'w', encoding='utf-8')
f.write( svgstr )
f.close()
def main( config ):