kopia lustrzana https://github.com/inkstitch/inkstitch
rodzic
c429bf5f17
commit
f807ccf49a
|
|
@ -231,8 +231,18 @@ class Font(object):
|
||||||
position.x = 0
|
position.x = 0
|
||||||
position.y += self.leading
|
position.y += self.leading
|
||||||
|
|
||||||
|
# We need to insert the destination_group now, even though it is possibly empty
|
||||||
|
# otherwise we could run into a FragmentError in case a glyph contains commands
|
||||||
|
destination_group.append(letter_group)
|
||||||
|
bounding_box = None
|
||||||
|
try:
|
||||||
bounding_box = letter_group.bounding_box()
|
bounding_box = letter_group.bounding_box()
|
||||||
|
except AttributeError:
|
||||||
|
# letter group is None
|
||||||
|
continue
|
||||||
|
# remove destination_group if it is empty
|
||||||
if not bounding_box:
|
if not bounding_box:
|
||||||
|
destination_group.remove(letter_group)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
line_width = bounding_box.width
|
line_width = bounding_box.width
|
||||||
|
|
@ -243,8 +253,6 @@ class Font(object):
|
||||||
if text_align == 2:
|
if text_align == 2:
|
||||||
letter_group.transform = f'translate({-line_width}, 0)'
|
letter_group.transform = f'translate({-line_width}, 0)'
|
||||||
|
|
||||||
destination_group.append(letter_group)
|
|
||||||
|
|
||||||
if text_align in [3, 4]:
|
if text_align in [3, 4]:
|
||||||
for line_group in destination_group.iterchildren():
|
for line_group in destination_group.iterchildren():
|
||||||
# print(line_group.label, len(line_group), file=sys.stderr)
|
# print(line_group.label, len(line_group), file=sys.stderr)
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue