]> git.lyx.org Git - features.git/commitdiff
Add support for the Crimson font
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 29 Dec 2016 15:45:19 +0000 (16:45 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 29 Dec 2016 15:45:19 +0000 (16:45 +0100)
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
development/FORMAT
lib/chkconfig.ltx
lib/latexfonts
lib/lyx2lyx/lyx_2_3.py
src/tex2lyx/TODO.txt
src/version.h

index 51d51bc3c86ed1188425dad9fc83ff1c9cd8d0a3..595b9340a2b3bcc4e4737ad83ad30d37caa4a5ff 100644 (file)
@@ -11,6 +11,14 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2016-12-29 Jürgen Spitzmüller <spitz@lyx.org>
+       * 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 <spitz@lyx.org>
        * 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 <spitz@lyx.org>
        * 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 <spitz@lyx.org>
        * Format incremented to 449: Support for \item arguments.
index 009d9ed16ff043ec39859f635f6feedca566dffe..140014af727563b6f828ade5fd5c592ac2ab8ab6 100644 (file)
 \TestPackage{bookman}
 \TestPackage{chancery}
 \TestPackage{charter}
+\TestPackage{cochineal}
 \TestPackage{courier}
+\TestPackage{crimson}
 \TestPackage{helvet}
 \TestPackage{mathpazo}
 \TestPackage{mathpple}
index b390efe27d7c0e74ab29fe2c1be9f44eb6ab1434..bf6152ac388237078e7a0523578278f760da36a4 100644 (file)
@@ -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
index 20bfde981986120b2d316fbc5d7b6fc09f42065f..b1154bcbb813182a84ba4b42a14e6d56c981ac59 100644 (file)
@@ -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]],
index aaf647d8d269034bdb0c38631a15c4c2ee8aca9f..d6e1a86ce1d1fadb92c1e4a2c03be4cc679cca49 100644 (file)
@@ -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
 
index d62781f08077f865a954164a097dc0e5932b84de..4d7abcb7cb219ddbb3e0f37bca6cd222ea113e69 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 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