From b349a96fa5bb6f2fa856c90cca0db24e60f4e3b8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 29 Nov 2010 22:27:19 +0900 Subject: [PATCH] drop most of the per-card formatting --- anki/deck.py | 10 ++++------ anki/models.py | 5 +++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index 46b09e0c8..c31da1f3f 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -1658,12 +1658,10 @@ facts.id = cards.factId""", id=model.id)) return t css = "".join([_genCSS(".fm", row) for row in self.s.all(""" select id, quizFontFamily, quizFontSize, quizFontColour, -1, features from fieldModels""")]) - css += "".join([_genCSS("#cmq", row) for row in self.s.all(""" -select id, questionFontFamily, questionFontSize, questionFontColour, -questionAlign, 0 from cardModels""")]) - css += "".join([_genCSS("#cma", row) for row in self.s.all(""" -select id, answerFontFamily, answerFontSize, answerFontColour, -answerAlign, 0 from cardModels""")]) + cardRows = self.s.all(""" +select id, null, null, null, questionAlign, 0 from cardModels""") + css += "".join([_genCSS("#cmq", row) for row in cardRows]) + css += "".join([_genCSS("#cma", row) for row in cardRows]) css += "".join([".cmb%s {background:%s;}\n" % (hexifyID(row[0]), row[1]) for row in self.s.all(""" select id, lastFontColour from cardModels""")]) diff --git a/anki/models.py b/anki/models.py index b794a17a9..446ad645f 100644 --- a/anki/models.py +++ b/anki/models.py @@ -89,16 +89,17 @@ cardModelsTable = Table( Column('qedformat', UnicodeText), Column('aedformat', UnicodeText), Column('questionInAnswer', Boolean, nullable=False, default=False), - # display + # unused Column('questionFontFamily', UnicodeText, default=u"Arial"), Column('questionFontSize', Integer, default=20), Column('questionFontColour', String(7), default=u"#000000"), + # used for both question & answer Column('questionAlign', Integer, default=0), + # ununsed Column('answerFontFamily', UnicodeText, default=u"Arial"), Column('answerFontSize', Integer, default=20), Column('answerFontColour', String(7), default=u"#000000"), Column('answerAlign', Integer, default=0), - # not used Column('lastFontFamily', UnicodeText, default=u"Arial"), Column('lastFontSize', Integer, default=20), # used as background colour