mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
make sure all fields have a font set
This commit is contained in:
parent
9fed5e2bc1
commit
bb901dfa16
2 changed files with 9 additions and 2 deletions
|
@ -69,7 +69,7 @@ SEARCH_FIELD = 6
|
|||
SEARCH_FIELD_EXISTS = 7
|
||||
SEARCH_QA = 8
|
||||
SEARCH_PHRASE_WB = 9
|
||||
DECK_VERSION = 54
|
||||
DECK_VERSION = 55
|
||||
|
||||
deckVarsTable = Table(
|
||||
'deckVars', metadata,
|
||||
|
@ -4258,6 +4258,13 @@ syncing again via Settings>Deck Properties>Synchronsiation. \
|
|||
deck.s.statement("update fieldModels set editFontFamily = 1");
|
||||
deck.version = 54
|
||||
deck.s.commit()
|
||||
if deck.version < 55:
|
||||
# set a default font for unset fonts
|
||||
deck.s.statement("""
|
||||
update fieldModels set quizFontFamily = 'Arial' where not quizFontFamily
|
||||
or quizFontFamily is null""")
|
||||
deck.version = 55
|
||||
deck.s.commit()
|
||||
# executing a pragma here is very slow on large decks, so we store
|
||||
# our own record
|
||||
if not deck.getInt("pageSize") == 4096:
|
||||
|
|
|
@ -46,7 +46,7 @@ fieldModelsTable = Table(
|
|||
Column('unique', Boolean, nullable=False, default=True), # sqlite keyword
|
||||
Column('numeric', Boolean, nullable=False, default=False),
|
||||
# display
|
||||
Column('quizFontFamily', UnicodeText),
|
||||
Column('quizFontFamily', UnicodeText, default=u"Arial"),
|
||||
Column('quizFontSize', Integer, default=20),
|
||||
Column('quizFontColour', String(7)),
|
||||
Column('editFontFamily', Boolean, default=True), # reused as <pre> toggle
|
||||
|
|
Loading…
Reference in a new issue