From 292f48d6b5fb9deafa1c78cbe1ab776512eafef9 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 17 Aug 2012 18:24:18 +0200 Subject: [PATCH] Add support for the txtt font (#4979) --- development/FORMAT | 4 ++++ lib/chkconfig.ltx | 3 ++- lib/doc/LaTeXConfig.lyx | 31 ++++++++++++++++++++++++++++++- lib/latexfonts | 7 +++++++ lib/lyx2lyx/lyx_2_1.py | 15 ++++++++++++++- src/version.h | 4 ++-- 6 files changed, 59 insertions(+), 5 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index d69da59aea..1df9ccfad3 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx. ----------------------- +2012-08-17 Jürgen Spitzmüller + * Format incremented to 435 + Support for the txtt LaTeX font. + 2012-08-17 Jürgen Spitzmüller * Format incremented to 434 Support for the libertine LaTeX font. diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index efbc0d760c..c58f5797de 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -364,6 +364,7 @@ \TestPackage{luximono} \TestPackage{tipa} \TestPackage{tipx} +\TestPackage{txfonts}% For the txtt monospaced font % necessary to get correct size for InstantPreview images created by dvipng \TestPackage[c70fs.fd]{zhmetrics} % symbol packakges supported by LyX for items and the special character dialog @@ -377,7 +378,7 @@ \TestPackage{wasysym} % These packages are disabled in the unicodesymbols file % see comment there -%\TestPackage{txfonts} +%\TestPackage{txfonts}% But see above! %\TestPackage{pxfonts} %\TestPackage{mathabx} %\TestPackage{mathdesign} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index d13259feaa..9fa79879a6 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 433 +\lyxformat 435 \begin_document \begin_header \textclass article @@ -970,6 +970,35 @@ Symbols dialog. \end_layout +\begin_layout Subsection +TX Fonts +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "txfonts" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family sans +fonts/txfonts/ +\end_layout + +\begin_layout Description +Notes: The +\family sans +txfonts +\family default + package provides fonts based on Times Roman with math support. + In LyX, only the monospaced shape (TXTT) is currently natively supported. +\end_layout + \begin_layout Section Standard LaTeX document classes \end_layout diff --git a/lib/latexfonts b/lib/latexfonts index 7fad86e612..794039a091 100644 --- a/lib/latexfonts +++ b/lib/latexfonts @@ -244,3 +244,10 @@ Font luximono ScaleOption scaled=$$val Package luximono EndFont + +Font txtt + GuiName "TX Typewriter" + Family tt + SwitchDefault 1 + Requires txfonts +EndFont diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index bc0c5b3fc1..86e03851f6 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -844,6 +844,17 @@ def revert_libertine(document): document.header[j] = "\\font_osf false" +def revert_txtt(document): + " Revert native txtt font definition to LaTeX " + + if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1: + i = find_token(document.header, "\\font_typewriter txtt", 0) + if i != -1: + preamble = "\\renewcommand{\\ttdefault}{txtt}" + add_to_preamble(document, [preamble]) + document.header[i] = "\\font_typewriter default" + + ## # Conversion hub # @@ -870,10 +881,12 @@ convert = [ [431, [convert_use_amssymb]], [432, []], [433, [convert_armenian]], - [434, []] + [434, []], + [435, []] ] revert = [ + [434, [revert_txtt]], [433, [revert_libertine]], [432, [revert_armenian]], [431, [revert_languages, revert_ancientgreek]], diff --git a/src/version.h b/src/version.h index ead5f99847..06cd46d99f 100644 --- a/src/version.h +++ b/src/version.h @@ -30,8 +30,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 434 // spitz: support for the libertine font -#define LYX_FORMAT_TEX2LYX 434 // spitz: support for the libertine font +#define LYX_FORMAT_LYX 435 // spitz: support for the txtt font +#define LYX_FORMAT_TEX2LYX 435 // spitz: support for the txtt font #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #ifndef _MSC_VER -- 2.39.5