More no-math fonts

For the sake of completeness, it is now also possible to load fourier and the mathdesign fonts without changing the default math font.
This commit is contained in:
Juergen Spitzmueller 2012-09-23 12:30:19 +02:00
parent 46826a9188
commit 5170489b98
4 changed files with 98 additions and 8 deletions

View File

@ -11,9 +11,14 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
-----------------------
2012-09-23 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 441:
- rename fonts: mdbch > md-charter, mdput > md-utopia, mdugm > md-garamond
- add support for the mathdesign fonts without loading mathfonts
(via \renewcommand{\rmfamily}{mdbch|mdput|mdugm}
2012-09-22 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 440
* Format incremented to 440:
Math (TeX) font UI.
New Buffer param "\math_font <value>",
supported values are:

View File

@ -160,7 +160,7 @@ AltFont lmr
Requires lmodern
EndFont
Font mdbch
Font md-charter
GuiName "Bitstream Charter (Mathdesign)"
Family rm
OsfOption expert
@ -170,9 +170,17 @@ Font mdbch
PackageOption charter
Requires mdbch
Provides amssymb,amsfonts
NoMathFont mdbch
EndFont
Font mdput
AltFont mdbch
GuiName "Bitstream Charter (Mathdesign)"
Family rm
SwitchDefault 1
Requires mdbch
EndFont
Font md-utopia
GuiName "Utopia (Mathdesign)"
Family rm
OsfOption expert
@ -182,9 +190,17 @@ Font mdput
PackageOption utopia
Requires mdput
Provides amssymb,amsfonts
NoMathFont mdput
EndFont
Font mdugm
AltFont mdput
GuiName "Utopia (Mathdesign)"
Family rm
SwitchDefault 1
Requires mdput
EndFont
Font md-garamond
GuiName "Adobe Garamond (Mathdesign)"
Family rm
OsfOption expert
@ -194,6 +210,14 @@ Font mdugm
PackageOption garamond
Requires mdugm
Provides amssymb,amsfonts
NoMathFont mdugm
EndFont
AltFont mdugm
GuiName "Adobe Garamond (Mathdesign)"
Family rm
SwitchDefault 1
Requires mdugm
EndFont
Font minionpro
@ -327,6 +351,7 @@ Font utopia
Package fourier
AltFonts utopia-sty
OT1Font utopia-sty
NoMathFont futs
EndFont
AltFont utopia-sty
@ -335,6 +360,19 @@ AltFont utopia-sty
Package utopia
EndFont
AltFont futs
GuiName "Utopia (Fourier)"
Family rm
SwitchDefault 1
OsfFont futj
EndFont
AltFont futj
GuiName "Utopia (Fourier)"
Family rm
SwitchDefault 1
EndFont
#
# SANS SERIF FONTS
@ -463,4 +501,4 @@ Font eulervm
GuiName "Euler VM"
Family math
Package eulervm
EndFont
EndFont

View File

@ -1023,6 +1023,8 @@ def revert_mathfonts(document):
"palatino": "\\renewcommand{\\rmdefault}{ppl}",
"palatino-osf": "\\renewcommand{\\rmdefault}{pplj}",
"times": "\\renewcommand{\\rmdefault}{ptm}",
"utopia": "\\renewcommand{\\rmdefault}{futs}",
"utopia-osf": "\\renewcommand{\\rmdefault}{futj}",
}
j = find_token(document.header, "\\font_roman", 0)
if j != -1:
@ -1037,6 +1039,49 @@ def revert_mathfonts(document):
document.header[k] = "\\font_osf false"
del document.header[i]
def revert_mdnomath(document):
" Revert mathdesign and fourier without math "
if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1:
mathdesign_dict = {
"md-charter": "mdbch",
"md-utopia": "mdput",
"md-garamond": "mdugm"
}
i = find_token(document.header, "\\font_roman", 0)
if i == -1:
return
val = get_value(document.header, "\\font_roman", i)
if val in mathdesign_dict.keys():
j = find_token(document.header, "\\font_math", 0)
if j == -1:
document.header[i] = "\\font_roman %s" % mathdesign_dict[val]
mval = get_value(document.header, "\\font_math", j)
if mval == "default":
document.header[i] = "\\font_roman default"
add_to_preamble(document, "\\renewcommand{\\rmdefault}{%s}" % mathdesign_dict[val])
else:
document.header[i] = "\\font_roman %s" % mathdesign_dict[val]
def convert_mdnomath(document):
" Change mathdesign font name "
if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1:
mathdesign_dict = {
"mdbch": "md-charter",
"mdput": "md-utopia",
"mdugm": "md-garamond"
}
i = find_token(document.header, "\\font_roman", 0)
if i == -1:
return
val = get_value(document.header, "\\font_roman", i)
if val in mathdesign_dict.keys():
document.header[i] = "\\font_roman %s" % mathdesign_dict[val]
##
# Conversion hub
#
@ -1069,10 +1114,12 @@ convert = [
[437, []],
[438, []],
[439, []],
[440, []]
[440, []],
[441, [convert_mdnomath]]
]
revert = [
[440, [revert_mdnomath]],
[439, [revert_mathfonts]],
[438, [revert_minionpro]],
[437, [revert_ipadeco, revert_ipachar]],

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 440 // spitz: basic UI for math (TeX) fonts
#define LYX_FORMAT_TEX2LYX 440 // spitz: basic UI for math (TeX) fonts
#define LYX_FORMAT_LYX 441 // spitz: mathdesign tex font changes
#define LYX_FORMAT_TEX2LYX 441 // spitz: mathdesign tex font changes
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER