fix lettering along path with scaled text (#3736)

kall/test
Kaalleen 2025-05-20 15:57:06 +02:00 zatwierdzone przez GitHub
rodzic 0bbf0f3195
commit 0d92f6bad5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -84,6 +84,8 @@ class TextAlongPath:
errormsg(_("Couldn't identify the font specified in the lettering group."))
return
self.font_scale = self.settings.scale / 100
if self.glyphs[0].get('transform', None) is not None:
self._reset_glyph_transforms()
@ -128,12 +130,12 @@ class TextAlongPath:
line_glyphs = [glyph for glyph in line.iterdescendants(SVG_GROUP_TAG) if glyph.get('inkstitch:letter-group', '') == 'glyph']
total_stretch_spaces = len(line_glyphs) - 1 + num_spaces
stretch_space = (path.length - text_width) / total_stretch_spaces
stretch_space = (path.length - text_width * self.font_scale) / total_stretch_spaces
else:
stretch_space = 0
start_position = self.get_start_position(text_width, path.length)
text_scale = Transform(f'scale({self.settings.scale / 100})')
text_scale = Transform(f'scale({self.font_scale})')
distance = start_position
old_bbox = None
@ -176,6 +178,7 @@ class TextAlongPath:
distance += stretch_space
def get_start_position(self, text_length, path_length):
text_length = text_length * self.font_scale
start_position = 0
if self.text_position == 'center':
start_position = (path_length - text_length) / 2