]> git.lyx.org Git - features.git/commitdiff
More osf (texfont) fixes
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 14 Jul 2019 07:09:46 +0000 (09:09 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:36 +0000 (15:48 +0200)
lib/latexfonts
lib/lyx2lyx/lyx_2_4.py
src/tex2lyx/Preamble.cpp

index 75dba78ae92dbaef2f3092b4de9d4fa58f3493b8..72917f3c2e6e4ce6f862bb2a466c3af71c3e268c 100644 (file)
@@ -721,11 +721,12 @@ Font IBMPlexSansSemibold
        MoreOptions      1
 EndFont
 
-Font   ADOBESourceSansPro
-       GuiName         "Adobe Source Sans Pro"
-       Family          sf
-       Package         sourcesanspro
-       ScaleOption     scaled=$$val
+Font ADOBESourceSansPro
+       GuiName          "Adobe Source Sans Pro"
+       Family           sf
+       Package          sourcesanspro
+       ScaleOption      scaled=$$val
+       OsfOption        osf
        MoreOptions      1
 EndFont
 
@@ -984,11 +985,12 @@ Font IBMPlexMonoSemibold
        MoreOptions      1
 EndFont
 
-Font   ADOBESourceCodePro
-       GuiName         "Adobe Source Code Pro"
-       Family          tt
-       Package         sourcecodepro
-       ScaleOption     scaled=$$val
+Font ADOBESourceCodePro
+       GuiName          "Adobe Source Code Pro"
+       Family           tt
+       Package          sourcecodepro
+       ScaleOption      scaled=$$val
+       OsfOption        osf
        MoreOptions      1
 EndFont
 
index b26f941991a7055643d0302e88eaebe4a8a38b82..ca55c8ec17247b9ee8acee8bcba18711b90df76e 100644 (file)
@@ -161,8 +161,8 @@ def createFontMapping(fontlist):
                                  "typewriter", "tt", "plex-mono", "scale")
         elif font == 'Adobe':
             fm.expandFontMapping(['ADOBESourceSerifPro'], "roman", None, "sourceserifpro", None, "osf")
-            fm.expandFontMapping(['ADOBESourceSansPro'], "sans", "sf", "sourcesanspro", "scaled")
-            fm.expandFontMapping(['ADOBESourceCodePro'], "typewriter", "tt", "sourcecodepro", "scaled")
+            fm.expandFontMapping(['ADOBESourceSansPro'], "sans", "sf", "sourcesanspro", "scaled", "osf")
+            fm.expandFontMapping(['ADOBESourceCodePro'], "typewriter", "tt", "sourcecodepro", "scaled", "osf")
         elif font == 'Noto':
             fm.expandFontMapping(['NotoSerifRegular,regular', 'NotoSerifMedium,medium',
                                   'NotoSerifThin,thin', 'NotoSerifLight,light',
@@ -305,10 +305,9 @@ def revert_fonts(document, fm, fontmap, OnlyWithXOpts = False):
                 if xval1 != "100":
                     # set correct scale option
                     fontmap[val].extend([fontinfo.scaleopt + "=" + format(float(xval1) / 100, '.2f')])
-        if fontinfo.osfopt != None and fontinfo.fonttype == "roman":
+        if fontinfo.osfopt != None:
             osf = find_token(document.header, "\\font_osf true")
             if osf != -1:
-                document.header[osf] = "\\font_osf false"
                 fontmap[val].extend([fontinfo.osfopt])
         if len(fontinfo.options) > 0:
             fontmap[val].extend(fontinfo.options)
index a5906d7c7bfe059909c42a21490db813300612d7..336a939dd206d6d5247bafefcf1c892410c53a31 100644 (file)
@@ -1075,6 +1075,10 @@ void Preamble::handle_package(Parser &p, string const & name,
                                scale_as_percentage(opt, h_font_sf_scale[0]);
                                continue;
                        }
+                       if (opt == "osf") {
+                               h_font_osf = "true";
+                               continue;
+                       }
                        if (!xopts.empty())
                                xopts += ", ";
                        xopts += opt;
@@ -1168,6 +1172,10 @@ void Preamble::handle_package(Parser &p, string const & name,
                                scale_as_percentage(opt, h_font_tt_scale[0]);
                                continue;
                        }
+                       if (opt == "osf") {
+                               h_font_osf = "true";
+                               continue;
+                       }
                        if (!xopts.empty())
                                xopts += ", ";
                        xopts += opt;