Adjust Libertine font support to most recent version

This needs yet a file format change. I hope the interface is stable now (I had an exchange with the package maintainer, Bob Tennent, about that)
This commit is contained in:
Juergen Spitzmueller 2013-02-15 10:45:11 +01:00
parent 557e2f5ef9
commit 6885007f1d
7 changed files with 140 additions and 11 deletions

View File

@ -11,6 +11,18 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
-----------------------
2013-02-15 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 462: Support for recent libertine LaTeX fonts
a.) Support Libertine Mono:
\usepackage[scaled=$val]{libertineMono-type1}
=> \font_typewriter libertine-mono
b.) Support Biolinum scaling:
\usepackage[scaled=$val]{biolinum-type1}
=> \font_sans biolinum
FORMAT 461 (uwestoehr): UNDOCUMENTED!
FORMAT 460 (uwestoehr): UNDOCUMENTED!
2012-12-31 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 459: Introduce new beamer frames:

View File

@ -417,6 +417,7 @@
\TestPackage{libertine}
\TestPackage{fontaxes} % required by libertine
\TestPackage{libertine-type1}
\TestPackage{libertineMono-type1}
\TestPackage{lmodern}
\TestPackage{luximono}
\TestPackage{mathdesign}% for Roman fonts

View File

@ -1,5 +1,5 @@
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 450
\lyxformat 462
\begin_document
\begin_header
\textclass article
@ -35,6 +35,8 @@
\use_package mathdots 0
\use_package mathtools 0
\use_package mhchem 0
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type numerical
@ -57,7 +59,7 @@
\papercolumns 1
\papersides 1
\paperpagestyle plain
\tracking_changes true
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
@ -319,7 +321,7 @@ arg "biolinum-type1"
\begin_layout Description
CTAN:
\family typewriter
fonts/biolinum-type1/
fonts/libertine/
\end_layout
\begin_layout Description
@ -342,7 +344,8 @@ Libertine
Biolinum
\emph default
supports Old Style Figures, which will be automatically activated if those
figures are available and requested for the roman font.
figures are available and requested for the roman font, and in newer versions
also scaling.
An older version of the font is provided by the package
\family sans
libertine-legacy
@ -755,7 +758,7 @@ arg "libertine-type1"
\begin_layout Description
CTAN:
\family typewriter
fonts/libertine-type1/
fonts/libertine/
\end_layout
\begin_layout Description
@ -781,6 +784,39 @@ arg "libertine"
), is also supported and used as a fallback.
\end_layout
\begin_layout Subsection
Libertine Mono
\end_layout
\begin_layout Description
Found:
\begin_inset Info
type "package"
arg "libertineMono-type1"
\end_inset
\end_layout
\begin_layout Description
CTAN:
\family typewriter
fonts/libertine/
\end_layout
\begin_layout Description
Notes: The
\family sans
libertineMono-type1
\family default
package provides support for the
\emph on
Libertine Mono
\emph default
typewriter font.
This font is shipped with libertine font package as of February 2013.
\end_layout
\begin_layout Subsection
Mathdesign
\end_layout

View File

@ -152,12 +152,20 @@ AltFont ugm
EndFont
Font libertine
GuiName "Libertine"
Family rm
OsfOption osf
Package libertine-type1
AltFonts libertine-2012,libertine-legacy
Requires libertineMono-type1
EndFont
AltFont libertine-2012
GuiName "Libertine"
Family rm
OsfOption lining
OsfDefault 1
Package libertine-type1
AltFonts libertine-legacy
EndFont
AltFont libertine-legacy
@ -414,6 +422,16 @@ Font berasans
EndFont
Font biolinum
GuiName "Biolinum"
Family sf
OsfOption osf
ScaleOption scaled=$$val
Package biolinum-type1
Requires libertineMono-type1
AltFonts biolinum-2012
EndFont
AltFont biolinum-2012
GuiName "Biolinum"
Family sf
OsfOption lining
@ -529,6 +547,13 @@ Font courier
Requires psnfss
EndFont
Font libertine-mono
GuiName "Libertine Mono"
Family tt
ScaleOption scaled=$$val
Package libertineMono-type1
EndFont
Font lmtt
GuiName "Latin Modern Typewriter"
Family tt
@ -580,9 +605,11 @@ Font kurier-math
Family math
Requires kurier
Preamble
\let\Myrmdefault\rmdefault
% store roman font
\let\origrmdefault\rmdefault
\usepackage[math]{kurier}
\renewcommand{\rmdefault}{\Myrmdefault}
% reset stored roman font
\renewcommand{\rmdefault}{\origrmdefault}
EndPreamble
EndFont

View File

@ -959,6 +959,7 @@ def revert_libertine(document):
preamble = "\\usepackage"
if osf:
document.header[j] = "\\font_osf false"
preamble += "[osf]"
else:
preamble += "[lining]"
preamble += "{libertine-type1}"
@ -3551,6 +3552,47 @@ def revert_kurier_fonts(document):
document.header[k] = "\\font_sans default"
def revert_new_libertines(document):
" Revert new libertine font definition to LaTeX "
if find_token(document.header, "\\use_non_tex_fonts true", 0) != -1:
return
i = find_token(document.header, "\\font_typewriter libertine-mono", 0)
if i != -1:
preamble = "\\usepackage"
sc = find_token(document.header, "\\font_tt_scale", 0)
if sc != -1:
scval = get_value(document.header, "\\font_tt_scale", sc)
if scval != "100":
preamble += "[scale=%f]" % (float(scval) / 100)
document.header[sc] = "\\font_tt_scale 100"
preamble += "{libertineMono-type1}"
add_to_preamble(document, [preamble])
document.header[i] = "\\font_typewriter default"
k = find_token(document.header, "\\font_sans biolinum", 0)
if k != -1:
preamble = "\\usepackage"
options = ""
j = find_token(document.header, "\\font_osf true", 0)
if j != -1:
options += "osf"
else:
options += "lining"
sc = find_token(document.header, "\\font_sf_scale", 0)
if sc != -1:
scval = get_value(document.header, "\\font_sf_scale", sc)
if scval != "100":
options += ",scale=%f" % (float(scval) / 100)
document.header[sc] = "\\font_sf_scale 100"
if options != "":
preamble += "[" + options +"]"
preamble += "{biolinum-type1}"
add_to_preamble(document, [preamble])
document.header[k] = "\\font_sans default"
##
# Conversion hub
#
@ -3604,10 +3646,12 @@ convert = [
[458, [convert_captioninsets, convert_captionlayouts]],
[459, []],
[460, []],
[461, []]
[461, []],
[462, []]
]
revert = [
[461, [revert_new_libertines]],
[460, [revert_kurier_fonts]],
[459, [revert_IEEEtran_3]],
[458, [revert_fragileframe, revert_newframes]],

View File

@ -91,6 +91,15 @@ Format LaTeX feature LyX feature
459 beamer: \begin{frame}, \begin_layout Frame
\begin{frame}[plain], \begin_layout PlainFrame
\begin{frame}[fragile] \begin_layout FragileFrame
460
461
462 New libertine LaTeX fonts:
\usepackage[scale|scaled|ttscale=$val]{libertineMono-type1}
\font_typewriter
\font_tt_scale
\usepackage[scale|scaled=$val]{biolinum-type1}
\font_sans
\font_sf_scale
General

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 461 // uwestoehr: support for the kurier fonts
#define LYX_FORMAT_TEX2LYX 461 // uwestoehr: support for the kurier fonts
#define LYX_FORMAT_LYX 462 // spitz: support for the newest libertine fonts
#define LYX_FORMAT_TEX2LYX 462 // spitz: support for the newest libertine fonts
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER