Beispiel #1
0
 def css(self):
     "Return the CSS markup for this card."
     t = ""
     for type in ("question", "answer"):
         t += ".%s { font-family: \"%s\"; color: %s; font-size: %dpx; }\n" % (
             type,
             toPlatformFont(getattr(self, type+"FontFamily")),
             getattr(self, type+"FontColour"),
             getattr(self, type+"FontSize"))
     return t
Beispiel #2
0
 def css(self, type="quiz"):
     t = ".%s { " % self.name.replace(" ", "")
     if getattr(self, type+'FontFamily'):
         t += "font-family: \"%s\"; " % toPlatformFont(
             getattr(self, type+'FontFamily'))
     if getattr(self, type+'FontSize'):
         t += "font-size: %dpx; " % getattr(self, type+'FontSize')
     if type == "quiz" and getattr(self, type+'FontColour'):
         t += "color: %s; " % getattr(self, type+'FontColour')
     t += " }\n"
     return t