]> git.lyx.org Git - features.git/commitdiff
latexfonts: support for the Noto fonts
authorUwe Stöhr <uwestoehr@lyx.org>
Tue, 4 Apr 2017 21:02:47 +0000 (23:02 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Tue, 4 Apr 2017 21:02:47 +0000 (23:02 +0200)
- fileformat change
- the support to scale the sf and the tt fonts can be added later, see enhancement #10611

development/FORMAT
development/Win32/packaging/installer/Packages.txt
lib/chkconfig.ltx
lib/latexfonts
lib/lyx2lyx/lyx_2_3.py
src/tex2lyx/Preamble.cpp
src/version.h

index c601311c832d050d51de5c7016928b0afa3e28e0..a1931efc2f1d05b88ea6d6c358c40a5469ee3874 100644 (file)
@@ -7,6 +7,13 @@ changes happened in particular if possible. A good example would be
 
 -----------------------
 
+2017-04-04 Uwe Stöhr <uwestoehr@web.de>
+       * Format incremented to 536: support for Noto fonts.
+         - \usepackage[rm]{noto} > \font_roman "NotoSerif-TLF" "<nontexfont>"
+         - \usepackage[sf]{noto} > \font_sans "NotoSans-TLF" "<nontexfont>"
+         - \renewcommand{\ttdefault}{NotoMono-TLF} 
+                 > \font_typewriter "NotoMono-TLF" "<nontexfont>"
+
 2017-03-19 Enrico Forestieri <forenr@lyx.org>
        * Format incremented to 535: support for en/em-dash as ligatures.
          The en- and em-dashes (U+2013 and U+2014) are now exported as
index dd3a150898b4db177eebc482783ee2577a8baae6..9e6f75285c48270de7ff922a8abb0919cda7b1ba 100644 (file)
@@ -157,6 +157,7 @@ luxi
 mathdesign
 minion2newtx
 newtx
+noto
 binhex
 symbol
 tex-gyre
index 544ce7cbd2dadb3ac4f508075773a7af8d04e5bd..bccd179f7d8038766f7dd967e796922e58b55cdf 100644 (file)
 \TestPackage{MinionPro}
 \TestFont[rzmnr]{minion2newtx}
 \TestPackage{newtxmath}
+\TestPackage{noto}
 \TestPackage[binhex.tex]{binhex} % required by newtxmath
 \TestFont[psyr]{symbol}
 \TestPackage{tgadventor}
index bf6152ac388237078e7a0523578278f760da36a4..1475e7ef1dc21cde68f2676b601b15fa6cf3eaf7 100644 (file)
@@ -289,6 +289,20 @@ Font newcent
        Package          newcent
 EndFont
 
+Font NotoSerif-TLF
+       GuiName          "Noto Serif"
+       Family           rm
+       SwitchDefault    1
+       Requires         noto
+       CompleteFont     noto
+EndFont
+
+AltFont noto
+       GuiName          "Noto Serif"
+       Family           rm
+       Package          noto
+EndFont
+
 Font palatino
        GuiName          "Palatino"
        Family           rm
@@ -538,6 +552,13 @@ Font lmss
        Requires         lmodern
 EndFont
 
+Font NotoSans-TLF
+       GuiName          "Noto Sans"
+       Family           sf
+       SwitchDefault    1
+       Requires         noto
+EndFont
+
 Font tgadventor
        GuiName          "TeX Gyre Adventor"
        Family           sf
@@ -611,6 +632,17 @@ Font luximono
        Package          luximono
 EndFont
 
+Font NotoMono-TLF
+       GuiName          "Noto Mono"
+       Family           tt
+       SwitchDefault    1
+       ScaleOption      $$val
+       Preamble
+        \newcommand*{\NotoMono@scale}{$$val}
+       EndPreamble
+       Requires         noto
+EndFont
+
 Font tgcursor
        GuiName          "TeX Gyre Cursor"
        Family           tt
index ddf7822fb9f0c14723e3a27bfdabc6a0fff1de8f..4d0e403fa77ccc1f25a9131ba683a302b09d0dd7 100644 (file)
@@ -1941,6 +1941,25 @@ def revert_dashligatures(document):
         i += 1
 
 
+def revert_noto(document):
+    " Revert Noto font definitions to LaTeX "
+
+    if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1:
+        preamble = ""
+        i = find_token(document.header, "\\font_roman \"NotoSerif-TLF\"", 0)
+        if i != -1:
+            add_to_preamble(document, ["\\renewcommand{\\rmdefault}{NotoSerif-TLF}"])
+            document.header[i] = document.header[i].replace("NotoSerif-TLF", "default")
+        i = find_token(document.header, "\\font_sans \"NotoSans-TLF\"", 0)
+        if i != -1:
+            add_to_preamble(document, ["\\renewcommand{\\sfdefault}{NotoSans-TLF}"])
+            document.header[i] = document.header[i].replace("NotoSans-TLF", "default")
+        i = find_token(document.header, "\\font_typewriter \"NotoMono-TLF\"", 0)
+        if i != -1:
+            add_to_preamble(document, ["\\renewcommand{\\ttdefault}{NotoMono-TLF}"])
+            document.header[i] = document.header[i].replace("NotoMono-TLF", "default")
+
+
 ##
 # Conversion hub
 #
@@ -1973,10 +1992,12 @@ convert = [
            [532, [convert_literalparam]],
            [533, []],
            [534, []],
-           [535, [convert_dashligatures]]
+           [535, [convert_dashligatures]],
+           [536, []]
           ]
 
 revert =  [
+           [535, [revert_noto]],
            [534, [revert_dashligatures]],
            [533, [revert_chapterbib]],
            [532, [revert_multibib]],
index 26563f818c2d1f863fb1572672201548c27fc5f8..b9d9a61aec52e610c0341ce9940bf75444d0919a 100644 (file)
@@ -127,16 +127,16 @@ char const * const known_fontsizes[] = { "10pt", "11pt", "12pt", 0 };
 const char * const known_roman_fonts[] = { "ae", "beraserif", "bookman",
 "ccfonts", "chancery", "charter", "cmr", "cochineal", "crimson", "fourier",
 "garamondx", "libertine", "libertine-type1", "lmodern", "mathdesign", "mathpazo",
-"mathptmx", "newcent", "tgbonum", "tgchorus", "tgpagella", "tgschola", "tgtermes",
-"utopia", 0};
+"mathptmx", "newcent", "NotoSerif-TLF", "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",
-"kurierc", "kurierl", "kurierlc", "lmss", "tgadventor", "tgheros", 0};
+"kurierc", "kurierl", "kurierlc", "lmss", "NotoSans-TLF", "tgadventor", "tgheros", 0};
 
 const char * const known_typewriter_fonts[] = { "beramono", "cmtl", "cmtt",
 "courier", "lmtt", "luximono", "fourier", "libertineMono-type1", "lmodern",
-"mathpazo", "mathptmx", "newcent", "tgcursor", "txtt", 0};
+"mathpazo", "mathptmx", "newcent", "NotoMono-TLF", "tgcursor", "txtt", 0};
 
 const char * const known_math_fonts[] = { "eulervm", "newtxmath", 0};
 
@@ -760,6 +760,25 @@ void Preamble::handle_package(Parser &p, string const & name,
                        h_font_osf = "true";
        }
 
+       if (name == "noto") {
+               // noto can have several options
+               if (opts.empty())
+                       h_font_roman[0] = "NotoSerif-TLF";
+               string::size_type pos = opts.find("rm");
+               if (pos != string::npos)
+                       h_font_roman[0] = "NotoSerif-TLF";
+               pos = opts.find("sf");
+               if (pos != string::npos)
+                       h_font_sans[0] = "NotoSans-TLF";
+               pos = opts.find("nott");
+               if (pos != string::npos) {
+                       h_font_roman[0] = "NotoSerif-TLF";
+                       h_font_sans[0] = "NotoSans-TLF";
+               }
+               // noto as typewriter is handled in handling of \ttdefault
+               // special cases are handled in handling of \rmdefault and \sfdefault
+       }
+
        // sansserif fonts
        if (is_known(name, known_sans_fonts)) {
                h_font_sans[0] = name;
index 5a03e0d31246a37ea6418d9e2443d3590671f1a2..874491df62097e9069f801478981d3e179bc38ae 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 535 // ef: support for en/em-dash as ligatures
-#define LYX_FORMAT_TEX2LYX 535
+#define LYX_FORMAT_LYX 536 // uwestoehr: support for Noto fonts
+#define LYX_FORMAT_TEX2LYX 536
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER