From: Juergen Spitzmueller Date: Thu, 29 Dec 2016 15:45:19 +0000 (+0100) Subject: Add support for the Crimson font X-Git-Tag: 2.3.0alpha1~558 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f8a85f35befaeb35a5dc17c3a00329c7aac7e383;p=features.git Add support for the Crimson font We use the more comprehensive cochineal package if available and fall back to the crimson package, if not. Math support is provided by means of newtxmath Fixes: #9974, #9976 --- diff --git a/development/FORMAT b/development/FORMAT index 51d51bc3c8..595b9340a2 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -11,6 +11,14 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx. ----------------------- +2016-12-29 Jürgen Spitzmüller + * Format incremented to 524: Support Crimson/Cochineal fonts + - \usepackage{cochineal} > \font_roman cochineal + - [osf] > \font_osf true + - \usepackage{crimson} > \font_roman cochineal + - \usepackage[cochineal]{newtxmath} > \font_math cochineal-ntxm + + 2016-12-26 Jürgen Spitzmüller * Format incremented to 523: Implement cjk quotation marks. - cjk (corner marks): \begin_inset Quotes j.. @@ -435,11 +443,11 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx. 2012-12-04 Jürgen Spitzmüller * Format incremented to 450: Support for the URW Garamond LaTeX fonts. - - \usepackage{garamondx} > \font_serif garamondx + - \usepackage{garamondx} > \font_roman garamondx - [osf], [osfI] > \font_osf true - \usepackage[garamondx]{newtxmath} > \font_math garamondx-ntxm Also (fallback): - - \renewcommand{\sffamily}{ugm} > \font_serif garamondx + - \renewcommand{\sffamily}{ugm} > \font_roman garamondx 2012-11-29 Jürgen Spitzmüller * Format incremented to 449: Support for \item arguments. diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 009d9ed16f..140014af72 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -410,7 +410,9 @@ \TestPackage{bookman} \TestPackage{chancery} \TestPackage{charter} +\TestPackage{cochineal} \TestPackage{courier} +\TestPackage{crimson} \TestPackage{helvet} \TestPackage{mathpazo} \TestPackage{mathpple} diff --git a/lib/latexfonts b/lib/latexfonts index b390efe27d..bf6152ac38 100644 --- a/lib/latexfonts +++ b/lib/latexfonts @@ -124,6 +124,20 @@ Font charter Package charter EndFont +Font cochineal + GuiName "Crimson (Cochineal)" + Family rm + OsfOption "proportional,osf" + Package cochineal + AltFonts crimson +EndFont + +AltFont crimson + GuiName "Crimson" + Family rm + Package crimson +EndFont + Font cmr GuiName "Computer Modern Roman" Family rm @@ -615,6 +629,14 @@ EndFont # MATH FONTS # +Font cochineal-ntxm + GuiName "Crimson (New TX)" + Family math + Package newtxmath + PackageOption cochineal + Provides amssymb,amsfonts +EndFont + Font eulervm GuiName "Euler VM" Family math diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py index 20bfde9819..b1154bcbb8 100644 --- a/lib/lyx2lyx/lyx_2_3.py +++ b/lib/lyx2lyx/lyx_2_3.py @@ -1035,6 +1035,36 @@ def revert_cjkquotes(document): i = l +def revert_crimson(document): + " Revert native Cochineal/Crimson font definition to LaTeX " + + if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1: + preamble = "" + i = find_token(document.header, "\\font_roman \"cochineal\"", 0) + if i != -1: + osf = False + j = find_token(document.header, "\\font_osf true", 0) + if j != -1: + osf = True + preamble = "\\usepackage" + if osf: + document.header[j] = "\\font_osf false" + preamble += "[proportional,osf]" + preamble += "{cochineal}" + add_to_preamble(document, [preamble]) + document.header[i] = document.header[i].replace("cochineal", "default") + + +def revert_cochinealmath(document): + " Revert cochineal newtxmath definitions to LaTeX " + + if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1: + i = find_token(document.header, "\\font_math \"cochineal-ntxm\"", 0) + if i != -1: + add_to_preamble(document, "\\usepackage[cochineal]{newtxmath}") + document.header[i] = document.header[i].replace("cochineal-ntxm", "auto") + + ## # Conversion hub # @@ -1055,10 +1085,12 @@ convert = [ [520, []], [521, [convert_frenchquotes]], [522, []], - [523, []] + [523, []], + [524, []] ] revert = [ + [523, [revert_crimson, revert_cochinealmath]], [522, [revert_cjkquotes]], [521, [revert_dynamicquotes]], [520, [revert_britishquotes, revert_swedishgquotes, revert_frenchquotes, revert_frenchinquotes, revert_russianquotes, revert_swissquotes]], diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index aaf647d8d2..d6e1a86ce1 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -100,6 +100,11 @@ Format LaTeX feature LyX feature 523 CJK Quote Styles InsetQuote - cjk (corner brackets) \begin_inset Quotes j.. - cjkangle (angle brackets) \begin_inset Quotes k.. +524 Crimson/Cochineal fonts \font_roman, \font_math + \usepackage{cochineal} \font_roman cochineal + - [osf] \font_osf true + \usepackage{crimson} \font_roman cochineal + \usepackage[cochineal]{newtxmath} \font_math cochineal-ntxm General diff --git a/src/version.h b/src/version.h index d62781f080..4d7abcb7cb 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 523 // spitz: cjk quotes styles -#define LYX_FORMAT_TEX2LYX 523 +#define LYX_FORMAT_LYX 524 // spitz: crimson/cochineal font +#define LYX_FORMAT_TEX2LYX 524 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #ifndef _MSC_VER