mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -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_FIELD_EXISTS = 7
|
||||||
SEARCH_QA = 8
|
SEARCH_QA = 8
|
||||||
SEARCH_PHRASE_WB = 9
|
SEARCH_PHRASE_WB = 9
|
||||||
DECK_VERSION = 54
|
DECK_VERSION = 55
|
||||||
|
|
||||||
deckVarsTable = Table(
|
deckVarsTable = Table(
|
||||||
'deckVars', metadata,
|
'deckVars', metadata,
|
||||||
|
@ -4258,6 +4258,13 @@ syncing again via Settings>Deck Properties>Synchronsiation. \
|
||||||
deck.s.statement("update fieldModels set editFontFamily = 1");
|
deck.s.statement("update fieldModels set editFontFamily = 1");
|
||||||
deck.version = 54
|
deck.version = 54
|
||||||
deck.s.commit()
|
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
|
# executing a pragma here is very slow on large decks, so we store
|
||||||
# our own record
|
# our own record
|
||||||
if not deck.getInt("pageSize") == 4096:
|
if not deck.getInt("pageSize") == 4096:
|
||||||
|
|
|
@ -46,7 +46,7 @@ fieldModelsTable = Table(
|
||||||
Column('unique', Boolean, nullable=False, default=True), # sqlite keyword
|
Column('unique', Boolean, nullable=False, default=True), # sqlite keyword
|
||||||
Column('numeric', Boolean, nullable=False, default=False),
|
Column('numeric', Boolean, nullable=False, default=False),
|
||||||
# display
|
# display
|
||||||
Column('quizFontFamily', UnicodeText),
|
Column('quizFontFamily', UnicodeText, default=u"Arial"),
|
||||||
Column('quizFontSize', Integer, default=20),
|
Column('quizFontSize', Integer, default=20),
|
||||||
Column('quizFontColour', String(7)),
|
Column('quizFontColour', String(7)),
|
||||||
Column('editFontFamily', Boolean, default=True), # reused as <pre> toggle
|
Column('editFontFamily', Boolean, default=True), # reused as <pre> toggle
|
||||||
|
|
Loading…
Reference in a new issue