changeset 28254:3d6c5eb54515 stable

svgconvert: Allow switching fontangle in part of a text string (bug #58274) * octave-svgconvert.cc(draw): Add forgotten block for handling font-style in tspan elements.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Wed, 29 Apr 2020 22:08:43 +0200
parents 9646d752c76c
children 18bd65ad4e7d 3241ede9806c
files src/octave-svgconvert.cc
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/octave-svgconvert.cc	Tue Apr 28 16:23:52 2020 -0700
+++ b/src/octave-svgconvert.cc	Wed Apr 29 22:08:43 2020 +0200
@@ -435,7 +435,7 @@
       else if (elt.tagName () == "tspan")
         {
           // Font
-          QFont saved_font(font);
+          QFont saved_font (font);
 
           QString str = elt.attribute ("font-family");
           if (! str.isEmpty ())
@@ -450,6 +450,15 @@
                 font.setWeight (QFont::Normal);
             }
 
+          str = elt.attribute ("font-style");
+          if (! str.isEmpty ())
+            {
+              if (str != "normal")
+                font.setStyle (QFont::StyleItalic);
+              else
+                font.setStyle (QFont::StyleNormal);
+            }
+
           int sz = elt.attribute ("font-size").toInt ();
           if (sz > 0)
             font.setPixelSize (sz);