commit b50336c0b085956b85bc93a81d6d649c28eb0326
Author: Juergen Spitzmueller <[email protected]>
Date: Mon Jul 15 08:10:47 2019 +0200
tex2lyx: support cantarell font
---
src/tex2lyx/Preamble.cpp | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 26065be..33229e6 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -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) {