]> git.lyx.org Git - features.git/commitdiff
Amend a25b9702, lyx2lyx: Corrected handling of system-font-specs
authorKornel Benko <kornel@lyx.org>
Tue, 29 Jan 2019 12:21:05 +0000 (13:21 +0100)
committerKornel Benko <kornel@lyx.org>
Tue, 29 Jan 2019 12:21:05 +0000 (13:21 +0100)
In the lines specifying the font, e.g.
\font_typewriter "DejaVuSansMono" "DejaVu Sans Mono"
the system font specs may contain words separated by spaces

lib/lyx2lyx/lyx_2_4.py

index 85f7314eaeebbbf7db6f6b52dde86de050af5c4d..a74cc237bd6348cc0fa7c999f284de3c9c3b22aa 100644 (file)
@@ -220,7 +220,8 @@ def convert_fonts(document, fm):
         if j != -1:
             val = get_value(document.header, ft, j)
             vals = val.split()
-            document.header[j] = ft + ' "' + fn + '" ' + vals[1]
+            vals[0] = '"' + fn + '"'
+            document.header[j] = ft + ' ' + ' '.join(vals)
 
 def revert_fonts(document, fm, fontmap):
     " Revert native font definition to LaTeX "
@@ -251,7 +252,8 @@ def revert_fonts(document, fm, fontmap):
         val = fontinfo.package
         if not val in fontmap:
             fontmap[val] = []
-        document.header[i] = ft + ' "default" ' + words[1]
+        words[0] = '"default"'
+        document.header[i] = ft + ' ' + ' '.join(words) 
         if fontinfo.scaleopt != None:
             xval =  get_value(document.header, "\\font_" + fontinfo.scaletype + "_scale", 0)
             mo = rscales.search(xval)