]> git.lyx.org Git - features.git/commitdiff
tex2lyx: support cantarell font
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 15 Jul 2019 06:10:47 +0000 (08:10 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 15 Jul 2019 06:10:47 +0000 (08:10 +0200)
src/tex2lyx/Preamble.cpp

index 26065bef5f03ffc72a35345b495864384f2e57fd..33229e61a3e3ae2789be41bcefb2d73c486c34d4 100644 (file)
@@ -148,7 +148,7 @@ const char * const known_roman_font_packages[] = { "ae", "beraserif", "bookman",
 "tgpagella", "tgschola", "tgtermes", "utopia", "xcharter", 0 };
 
 const char * const known_sans_font_packages[] = { "avant", "berasans", "biolinum",
-"biolinum-type1", "cmbr", "cmss", "DejaVuSans", "DejaVuSansCondensed", "helvet", "iwona", "iwonac", "iwonal", "iwonalc",
+"biolinum-type1", "cantarell", "cmbr", "cmss", "DejaVuSans", "DejaVuSansCondensed", "helvet", "iwona", "iwonac", "iwonal", "iwonalc",
 "kurier", "kurierc", "kurierl", "kurierlc", "lmss", "noto", "noto-sans", "PTSans",
 "tgadventor", "tgheros", "uop", 0 };
 
@@ -1088,6 +1088,27 @@ void Preamble::handle_package(Parser &p, string const & name,
                        h_font_sans_osf = "true";
        }
 
+       if (name == "cantarell") {
+               for (auto const & opt : allopts) {
+                       if (opt == "defaultsans")
+                               continue;
+                       if (prefixIs(opt, "oldstyle")) {
+                               h_font_sans_osf = "true";
+                               continue;
+                       }
+                       if (prefixIs(opt, "scale=")) {
+                               scale_as_percentage(opt, h_font_sf_scale[0]);
+                               continue;
+                       }
+                       if (!xopts.empty())
+                               xopts += ", ";
+                       xopts += opt;
+               }
+               if (!xopts.empty())
+                       h_font_sans_opts = xopts;
+               options.clear();
+       }
+
        if (name == "PTSans") {
                h_font_sans[0] = "PTSans-TLF";
                if (options.size() >= 1) {