Fix a couple minor issues noticed by tests.

This commit is contained in:
Richard Heck 2015-12-12 13:19:41 -05:00
parent 4e9fe808d7
commit 1c66831825
3 changed files with 15 additions and 9 deletions

View File

@ -2394,13 +2394,12 @@ def revert_script(document):
def convert_use_xetex(document):
" convert \\use_xetex to \\use_non_tex_fonts "
i = 0
i = find_token(document.header, "\\use_xetex", 0)
if i == -1:
return
val = get_value(document.header, "\\use_xetex", 0)
document.header[i] = "\\use_non_tex_fonts " + val
document.header.insert(-1, "\\use_non_tex_fonts 0")
else:
val = get_value(document.header, "\\use_xetex", 0)
document.header[i] = "\\use_non_tex_fonts " + val
def revert_use_xetex(document):

View File

@ -1440,6 +1440,10 @@ def revert_mdnomath(document):
document.header[i] = "\\font_roman %s" % mathdesign_dict[val]
def convert_mathfonts(document):
document.header.insert(-1, "\\font_math auto")
def convert_mdnomath(document):
" Change mathdesign font name "
@ -4826,7 +4830,7 @@ convert = [
[437, []],
[438, []],
[439, []],
[440, []],
[440, [convert_mathfonts]],
[441, [convert_mdnomath]],
[442, []],
[443, []],

View File

@ -2010,9 +2010,12 @@ def convert_fontsettings(document):
i = find_token(document.header, f + " ", 0)
if i == -1:
document.warning("Malformed LyX document: No " + f + "!")
j = j + 1
continue
value = document.header[i][len(f):].strip()
# we can fix that
# note that with i = -1, this will insert at the end
# of the header
value = fontdefaults[j]
else:
value = document.header[i][len(f):].strip()
if fontquotes[j]:
if use_non_tex_fonts == "true":
document.header[i:i+1] = [f + ' "' + fontdefaults[j] + '" "' + value + '"']