From 97e5eb35056e67eb8ef8661c757b310e48fce05c Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Wed, 17 Jul 2019 18:02:22 +0200 Subject: [PATCH] Add sans serif font series "Chivo" --- lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 35 +++++++++++++++++++++++++++++++- lib/latexfonts | 44 ++++++++++++++++++++++++++++++++++++++++ src/LaTeXFonts.cpp | 1 + src/tex2lyx/Preamble.cpp | 34 ++++++++++++++++++++++++++++++- src/version.h | 4 ++-- 6 files changed, 115 insertions(+), 4 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index a8e8247871..19256a3681 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -476,6 +476,7 @@ %\TestFont[glic1000]{cbgreek}% for Greek % suported by LyX but too large to force downloading \TestPackage{cantarell} \TestPackage{ccfonts} +\TestPackage{Chivo} \TestFont[ccr10]{concrete} % required by ccfonts \TestFont[eorm10]{ecc} % required by ccfonts \TestPackage[ot1ccr.fd]{concmath} % required by ccfonts diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 41241f5b9f..69c65abcb6 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 582 +\lyxformat 583 \begin_document \begin_header \save_transient_properties true @@ -445,6 +445,39 @@ Notes: Cantarell is a contemporary humanist sans serif, and is used by the \end_layout +\begin_layout Subsection + +\change_inserted -1174727462 1563362850 +Chivo +\end_layout + +\begin_layout Description + +\change_inserted -1174727462 1563363590 +Found: +\begin_inset Info +type "package" +arg "Chivo" +\end_inset + + +\end_layout + +\begin_layout Description + +\change_inserted -1174727462 1563363604 +CTAN: fonts/Chivo +\end_layout + +\begin_layout Description + +\change_inserted -1174727462 1563363027 +Notes: Chivo is a set of fourteen fonts provided by Héctor Gatti & [Omnibus-Type +](http://www.omnibus-type.com/fonts/chivo.php) Team under the Open Font License + [(OFL)](http://scripts.sil.org/OFL), version 1.1. + The fonts are copyright (c) 2011-2019, Omnibus-Type. +\end_layout + \begin_layout Subsection CM bright \end_layout diff --git a/lib/latexfonts b/lib/latexfonts index 1d7903f2f1..a5bef04a09 100644 --- a/lib/latexfonts +++ b/lib/latexfonts @@ -653,6 +653,50 @@ Font cantarell ScaleOption scale=$$val EndFont +Font ChivoThin + GuiName "Chivo (Thin)" + Family sf + OsfOption oldstyle + Package Chivo + PackageOption "thin" + MoreOptions 1 + FontEncoding OT1,LY1,T1,TS1 + ScaleOption scale=$$val +EndFont + +Font ChivoLight + GuiName "Chivo (Light)" + Family sf + OsfOption oldstyle + Package Chivo + PackageOption "light" + MoreOptions 1 + FontEncoding OT1,LY1,T1,TS1 + ScaleOption scale=$$val +EndFont + +Font Chivo + GuiName "Chivo" + Family sf + OsfOption oldstyle + Package Chivo + PackageOption "regular" + MoreOptions 1 + FontEncoding OT1,LY1,T1,TS1 + ScaleOption scale=$$val +EndFont + +Font ChivoMedium + GuiName "Chivo (Medium)" + Family sf + OsfOption oldstyle + Package Chivo + PackageOption "medium" + MoreOptions 1 + FontEncoding OT1,LY1,T1,TS1 + ScaleOption scale=$$val +EndFont + Font cmbr GuiName "CM Bright" Family sf diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp index 29d454dfb3..824986052a 100644 --- a/src/LaTeXFonts.cpp +++ b/src/LaTeXFonts.cpp @@ -388,6 +388,7 @@ bool LaTeXFont::readFont(Lexer & lex) { "ot1font", LF_OT1_FONT }, { "package", LF_PACKAGE }, { "packageoption", LF_PACKAGEOPTION }, + { "packageoptions", LF_PACKAGEOPTION }, { "preamble", LF_PREAMBLE }, { "provides", LF_PROVIDES }, { "requires", LF_REQUIRES }, diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 1525112a46..2f4342f412 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", "cantarell", "cmbr", "cmss", "DejaVuSans", "DejaVuSansCondensed", "FiraSans", "helvet", "iwona", +"biolinum-type1", "cantarell", "Chivo", "cmbr", "cmss", "DejaVuSans", "DejaVuSansCondensed", "FiraSans", "helvet", "iwona", "iwonac", "iwonal", "iwonalc", "kurier", "kurierc", "kurierl", "kurierlc", "lmss", "noto", "noto-sans", "PTSans", "tgadventor", "tgheros", "uop", 0 }; @@ -1135,6 +1135,38 @@ void Preamble::handle_package(Parser &p, string const & name, options.clear(); } + if (name == "Chivo") { + h_font_roman[0] = "Chivo"; + for (auto const & opt : allopts) { + if (opt == "thin") { + h_font_roman[0] = "ChivoThin"; + continue; + } + if (opt == "light") { + h_font_roman[0] = "ChivoLight"; + continue; + } + if (opt == "regular") { + h_font_roman[0] = "Chivo"; + continue; + } + if (opt == "medium") { + h_font_roman[0] = "ChivoMedium"; + continue; + } + if (prefixIs(opt, "oldstyle")) { + h_font_sans_osf = "true"; + 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"; } diff --git a/src/version.h b/src/version.h index 1fb7c5d5f0..e957b7ad21 100644 --- a/src/version.h +++ b/src/version.h @@ -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 582 // Kornel: Add cantarell sans serif font -#define LYX_FORMAT_TEX2LYX 582 +#define LYX_FORMAT_LYX 583 // Kornel: Add Chivo sans serif font +#define LYX_FORMAT_TEX2LYX 583 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #ifndef _MSC_VER -- 2.39.5