allow for the fact that field font/size may be null

This commit is contained in:
Damien Elmes 2010-12-27 01:06:48 +09:00
parent 647ec63677
commit f41d2c2e0a

View file

@ -152,8 +152,8 @@ class View(object):
fn = u"Arial"
for fm in self.main.currentCard.fact.model.fieldModels:
if fm.name == self.main.currentCard.cardModel.typeAnswer:
sz = fm.quizFontSize
fn = fm.quizFontFamily
sz = fm.quizFontSize or sz
fn = fm.quizFontFamily or fn
break
st = "background: %s; color: #000; font-size: %dpx; font-family: %s;"
ok = st % (passedCharColour, sz, fn)