preserve old default card-level formatting

This commit is contained in:
Damien Elmes 2011-01-21 06:41:34 +09:00
parent 0e08092f65
commit 4859778d2c

View file

@ -4337,24 +4337,17 @@ or quizFontFamily is null""")
<span style="font-family: %s; font-size: %spx; color: %s;">%s</span>'''
for m in deck.models:
for cm in m.cardModels:
# embed the old font information into card templates if
# it's been customized
if (cm.questionFontFamily != "Arial" or
cm.questionFontSize != 20 or
cm.questionFontColour != "#000000"):
cm.qformat = txt % (
cm.questionFontFamily,
cm.questionFontSize,
cm.questionFontColour,
cm.qformat)
if (cm.answerFontFamily != "Arial" or
cm.answerFontSize != 20 or
cm.answerFontColour != "#000000"):
cm.aformat = txt % (
cm.answerFontFamily,
cm.answerFontSize,
cm.answerFontColour,
cm.aformat)
# embed the old font information into card templates
cm.qformat = txt % (
cm.questionFontFamily,
cm.questionFontSize,
cm.questionFontColour,
cm.qformat)
cm.aformat = txt % (
cm.answerFontFamily,
cm.answerFontSize,
cm.answerFontColour,
cm.aformat)
# fix newlines
cm.qformat = cm.qformat.replace("\n", "<br>\n")
cm.aformat = cm.aformat.replace("\n", "<br>\n")