summaryrefslogtreecommitdiff
path: root/librelogo
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-12-05 11:10:16 +0100
committerLászló Németh <nemeth@numbertext.org>2022-12-05 16:16:25 +0000
commitfe5cca63c2a15dfc49cd251a6be4ab3925ab1dab (patch)
treea78e1f7d3f6fb85a7a192e57f1a4f7dce0b26136 /librelogo
parent37d8678d7266fd517953d3db39e30ff8775ade7f (diff)
LibreLogo: fix SVG export of font features and text portions
Text portions of rotated text was exported with bad positions. Text using font features was exported with non-portable font names with colon, working only in LibreOffice correctly. Fix these by converting the text to curve during the SVG export. Change-Id: I3707aaa4143f583b988bbbe37b5eb741530cccba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143668 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'librelogo')
-rw-r--r--librelogo/source/LibreLogo/LibreLogo.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index 5f0c2261f614..1ba5b835244f 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -168,6 +168,7 @@ class __Doc__:
self.time = 0
self.zoomvalue = 0
self.lockturtle = False
+ self.fixSVG = False
self.initialize()
def initialize(self):
@@ -539,6 +540,7 @@ class LogoProgram(threading.Thread):
parent = _.doc.CurrentController.Frame.ContainerWindow
MessageBox(parent, "Document objects with%s script events" % [" possible", ""][secid-1], "LibreLogo program can't start", "errorbox")
else:
+ _.fixSVG = False
_.start_time = __time__.process_time()
exec(self.code)
__unlock__(all_levels = True)
@@ -1440,6 +1442,7 @@ def text(shape, orig_st):
# has HTML-like formatting
if formatting != None:
+ _.fixSVG = True
prev_format = 0
prev_extra_data = extra_data[0]
c.collapseToStart()
@@ -1811,6 +1814,9 @@ def __groupend__(name = ""):
__time__.sleep(0.1)
__dispatcher__(".uno:Paste", (), draw)
__dispatcher__(".uno:FormatGroup", (), draw)
+ # fix bad or non-portable SVG export by converting text to curve
+ if _.fixSVG:
+ __dispatcher__(".uno:ChangeBezier", (), draw)
pic = drawpage.getByIndex(0)
pic.setPosition(__Point__((g.BoundRect.Width - g.Size.Width)//2, (g.BoundRect.Height - g.Size.Height)//2))
drawpage.Height, drawpage.Width = g.BoundRect.Height, g.BoundRect.Width
@@ -1856,6 +1862,8 @@ def fontweight(n = -1):
def fontfamily(s = -1):
if s != -1:
_.fontfamily = s
+ if ':' in s:
+ _.fixSVG = True
else:
return _.fontfamily