2
0
mirror of https://github.com/koreader/koreader synced 2024-11-18 03:25:46 +00:00
koreader/spec/unit/font_spec.lua
Benoit Pierre 346d8eb83e
Decrease fonts memory use (#10618)
Instead of opening the same font multiple times for each different
size (multiple face instances), share one face instance and create
multiple size instances.
2023-07-04 09:13:16 +02:00

17 lines
463 B
Lua

describe("Font module", function()
local Font
setup(function()
require("commonrequire")
Font = require("ui/font")
end)
it("should get face", function()
local f
f = Font:getFace('cfont', 18)
assert.are_not.equals(f.ftsize, nil)
f = Font:getFace('tfont', 16)
assert.are_not.equals(f.ftsize, nil)
f = Font:getFace('hfont', 12)
assert.are_not.equals(f.ftsize, nil)
end)
end)