Add support for the txtt font (#4979)

This commit is contained in:
Juergen Spitzmueller 2012-08-17 18:24:18 +02:00
parent bfec6d2552
commit 292f48d6b5
6 changed files with 59 additions and 5 deletions

View File

@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
-----------------------
2012-08-17 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 435
Support for the txtt LaTeX font.
2012-08-17 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 434
Support for the libertine LaTeX font.

View File

@ -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}

View File

@ -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

View File

@ -244,3 +244,10 @@ Font luximono
ScaleOption scaled=$$val
Package luximono
EndFont
Font txtt
GuiName "TX Typewriter"
Family tt
SwitchDefault 1
Requires txfonts
EndFont

View File

@ -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]],

View File

@ -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