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,11 +2394,10 @@ def revert_script(document):
def convert_use_xetex(document): def convert_use_xetex(document):
" convert \\use_xetex to \\use_non_tex_fonts " " convert \\use_xetex to \\use_non_tex_fonts "
i = 0
i = find_token(document.header, "\\use_xetex", 0) i = find_token(document.header, "\\use_xetex", 0)
if i == -1: if i == -1:
return document.header.insert(-1, "\\use_non_tex_fonts 0")
else:
val = get_value(document.header, "\\use_xetex", 0) val = get_value(document.header, "\\use_xetex", 0)
document.header[i] = "\\use_non_tex_fonts " + val document.header[i] = "\\use_non_tex_fonts " + val

View File

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

View File

@ -2010,8 +2010,11 @@ def convert_fontsettings(document):
i = find_token(document.header, f + " ", 0) i = find_token(document.header, f + " ", 0)
if i == -1: if i == -1:
document.warning("Malformed LyX document: No " + f + "!") document.warning("Malformed LyX document: No " + f + "!")
j = j + 1 # we can fix that
continue # 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() value = document.header[i][len(f):].strip()
if fontquotes[j]: if fontquotes[j]:
if use_non_tex_fonts == "true": if use_non_tex_fonts == "true":