Add more fontsizes to KOMA classes.

Theoretically, KOMA supports any font size. We add a sensible range.
This commit is contained in:
Juergen Spitzmueller 2019-08-06 19:29:18 +02:00
parent 50abaa0e57
commit 9f61c8d4af
3 changed files with 40 additions and 4 deletions

View File

@ -8,7 +8,9 @@ changes happened in particular if possible. A good example would be
----------------------- -----------------------
2019-08-06 Jürgen Spitzmüller <spitz@lyx.org> 2019-08-06 Jürgen Spitzmüller <spitz@lyx.org>
* Format incremented to 585: Add more page sizes to KOMA and memoir. * Format incremented to 585:
- Add more page sizes to KOMA and memoir.
- Add more font sizes to KOMA.
2019-07-26 Joel Kulesza <jkulesza@gmail.com> 2019-07-26 Joel Kulesza <jkulesza@gmail.com>
* Format incremented to 584: support for revision InsetInfo addition of * Format incremented to 584: support for revision InsetInfo addition of

View File

@ -8,13 +8,15 @@
# Labeling is now used also in non-KOMA classes # Labeling is now used also in non-KOMA classes
Format 77 Format 78
SecNumDepth 2 SecNumDepth 2
TocDepth 2 TocDepth 2
DefaultStyle Standard DefaultStyle Standard
Provides subscript 1 Provides subscript 1
ClassOptions ClassOptions
FontSize 9|10|11|12|13|14|15|16|17|18|19|20
FontSizeFormat fontsize=$$s
PageSize a0paper|a1paper|a2paper|a3paper|a4paper|a5paper|a6paper|b0paper|b1paper|b2paper|b3paper|b4paper|b5paper|b6paper|c0paper|c1paper|c2paper|c3paper|c4paper|c5paper|c6paper|executivepaper|legalpaper|letterpaper PageSize a0paper|a1paper|a2paper|a3paper|a4paper|a5paper|a6paper|b0paper|b1paper|b2paper|b3paper|b4paper|b5paper|b6paper|c0paper|c1paper|c2paper|c3paper|c4paper|c5paper|c6paper|executivepaper|legalpaper|letterpaper
End End

View File

@ -3160,7 +3160,7 @@ def revert_pagesizes(document):
def convert_pagesizes(document): def convert_pagesizes(document):
" Convert to new page sizes in memoir and KOMA to options " " Convert to new page sizes in memoir and KOMA to options "
if document.textclass != "memoir" and document.textclass[:2] != "scr": if document.textclass != "memoir" and document.textclass[:3] != "scr":
return return
i = find_token(document.header, "\\use_geometry true", 0) i = find_token(document.header, "\\use_geometry true", 0)
@ -3183,6 +3183,38 @@ def convert_pagesizes(document):
# Maintain use of geometry # Maintain use of geometry
document.header[1] = "\\use_geometry true" document.header[1] = "\\use_geometry true"
def revert_komafontsizes(document):
" Revert new font sizes in KOMA to options "
if document.textclass[:3] != "scr":
return
i = find_token(document.header, "\\paperfontsize", 0)
if i == -1:
document.warning("Malformed LyX document! Missing \\paperfontsize header.")
return
defsizes = ["default", "10", "11", "12"]
val = get_value(document.header, "\\paperfontsize", i)
if val in defsizes:
# nothing to do
return
document.header[i] = "\\paperfontsize default"
fsize = "fontsize=" + val
i = find_token(document.header, "\\options", 0)
if i == -1:
i = find_token(document.header, "\\textclass", 0)
if i == -1:
document.warning("Malformed LyX document! Missing \\textclass header.")
return
document.header.insert(i, "\\options " + fsize)
return
document.header[i] = document.header[i] + "," + fsize
## ##
@ -3234,7 +3266,7 @@ convert = [
[585, [convert_pagesizes]] [585, [convert_pagesizes]]
] ]
revert = [[584, [revert_pagesizes]], revert = [[584, [revert_pagesizes,revert_komafontsizes]],
[583, [revert_vcsinfo_rev_abbrev]], [583, [revert_vcsinfo_rev_abbrev]],
[582, [revert_ChivoFont,revert_CrimsonProFont]], [582, [revert_ChivoFont,revert_CrimsonProFont]],
[581, [revert_CantarellFont,revert_FiraFont]], [581, [revert_CantarellFont,revert_FiraFont]],