mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
font: add default font size
This commit is contained in:
@@ -35,6 +35,18 @@ local Font = {
|
||||
-- font for info messages
|
||||
infofont = "noto/NotoSans-Regular.ttf",
|
||||
},
|
||||
sizemap = {
|
||||
cfont = 24,
|
||||
tfont = 26,
|
||||
ffont = 20,
|
||||
pgfont = 20,
|
||||
scfont = 20,
|
||||
rifont = 16,
|
||||
hpkfont = 20,
|
||||
hfont = 24,
|
||||
infont = 22,
|
||||
infofont = 24,
|
||||
},
|
||||
fallbacks = {
|
||||
[1] = "noto/NotoSansCJK-Regular.ttf",
|
||||
[2] = "noto/NotoSans-Regular.ttf",
|
||||
@@ -51,6 +63,7 @@ function Font:getFace(font, size)
|
||||
-- default to content font
|
||||
if not font then font = self.cfont end
|
||||
|
||||
if not size then size = self.sizemap[font] end
|
||||
-- original size before scaling by screen DPI
|
||||
local orig_size = size
|
||||
local size = Screen:scaleBySize(size)
|
||||
|
||||
Reference in New Issue
Block a user