tests/font: comments: specs only
This commit is contained in:
1 parent
7672980c65
commit
9d80ee11b9
12 files changed
+15
-69
No files matched your search
+1
-6
@@ -1,7 +1,4 @@
|
||||
-- font/psf tests: kbd / Spleen / Tamzen / Terminus / Cozette console fonts (PSF 1 and 2, with and without Unicode
|
||||
-- tables) against an independent parser (sizes, glyph bitmaps) and kbd's psfgettable (every code point -> glyph
|
||||
-- pair); our PSF 2 / PSF 1 output read back by psfgettable and the parser (fixture step) and round-tripping; an
|
||||
-- outline font written as PSF; .psfu.gz through the api; errors; the fuzz pass. Fixtures: tools/fixtures/psf.py.
|
||||
-- font/psf tests against an independent parser and kbd's psfgettable (tools/fixtures/psf.py).
|
||||
local T = require("@tests/T")
|
||||
local F = require("@rosetta")
|
||||
local Psf = require("@rosetta/font/psf")
|
||||
@@ -58,14 +55,12 @@ for _, c in Fx.fonts do
|
||||
end
|
||||
end
|
||||
|
||||
-- an outline font as PSF 2
|
||||
local ttf = Ttf.decode(Bytes.reader(buffer.fromstring(Fonts.fonts[1].data)))
|
||||
local out, err = Psf.encode(ttf, { px = 16, chars = "AB" })
|
||||
t:check(out, "ttf -> psf: " .. tostring(err))
|
||||
local back = Psf.decode(Bytes.reader(out :: buffer)) :: any
|
||||
t:check(back and back:glyphIndex(66) == 2 and back.meta.source.version == 2, "ttf -> psf glyphs")
|
||||
|
||||
-- errors
|
||||
local function code(s: string): string?
|
||||
local _, e = Psf.decode(Bytes.reader(buffer.fromstring(s)))
|
||||
return e and e.code
|
||||
|
||||
Reference in new issue
Block a user