]> git.lyx.org Git - features.git/blobdiff - src/tex2lyx/Preamble.cpp
tex2lyx: support for the cochineal fonts
[features.git] / src / tex2lyx / Preamble.cpp
index 96df0a0f70cc1f540dfab76d7933acd9aa481b23..26563f818c2d1f863fb1572672201548c27fc5f8 100644 (file)
@@ -125,9 +125,10 @@ const char * const known_old_language_packages[] = {"french", "frenchle",
 char const * const known_fontsizes[] = { "10pt", "11pt", "12pt", 0 };
 
 const char * const known_roman_fonts[] = { "ae", "beraserif", "bookman",
-"ccfonts", "chancery", "charter", "cmr", "fourier", "garamondx", "libertine",
-"libertine-type1", "lmodern", "mathdesign", "mathpazo", "mathptmx", "newcent",
-"tgbonum", "tgchorus", "tgpagella", "tgschola", "tgtermes", "utopia", 0};
+"ccfonts", "chancery", "charter", "cmr", "cochineal", "crimson", "fourier",
+"garamondx", "libertine", "libertine-type1", "lmodern", "mathdesign", "mathpazo",
+"mathptmx", "newcent", "tgbonum", "tgchorus", "tgpagella", "tgschola", "tgtermes",
+"utopia", 0};
 
 const char * const known_sans_fonts[] = { "avant", "berasans", "biolinum-type1",
 "cmbr", "cmss", "helvet", "iwona", "iwonac", "iwonal", "iwonalc", "kurier",
@@ -748,6 +749,17 @@ void Preamble::handle_package(Parser &p, string const & name,
        else if (name == "mathptmx")
                h_font_roman[0] = "times";
 
+       if (name == "crimson")
+               h_font_roman[0] = "cochineal";
+
+       if (name == "cochineal") {
+               h_font_roman[0] = "cochineal";
+               // cochineal can have several options, e.g. [proportional,osf]
+               string::size_type pos = opts.find("osf");
+               if (pos != string::npos)
+                       h_font_osf = "true";
+       }
+
        // sansserif fonts
        if (is_known(name, known_sans_fonts)) {
                h_font_sans[0] = name;
@@ -799,6 +811,8 @@ void Preamble::handle_package(Parser &p, string const & name,
                        h_font_math[0] = "libertine-ntxm";
                else if (opts == "minion")
                        h_font_math[0] = "minion-ntxm";
+               else if (opts == "cochineal")
+                       h_font_math[0] = "cochineal-ntxm";
        }
 
        if (name == "iwona")