A Lua module to provide access to the system font catalog.
- Mac OS X 10.5 and later supported via CoreText
- Linux supported via fontconfig
- (TODO) Windows 7 and later supported via DirectWrite
luarocks install luafontmanager
local fm = require("fontmanager")
local spt = require("serpent") -- luarocks install serpent
print(spt.block(fm.get_installed_fonts(), {comment = false}))
-- This will print a list which looks like:
--
-- {
-- …<snip>…
-- {
-- name = "IowanOldStyle-BlackItalic",
-- path = "/Library/Fonts/Iowan Old Style.ttc"
-- },
-- {
-- name = "ChalkboardSE-Bold",
-- path = "/Library/Fonts/ChalkboardSE.ttc"
-- },
-- {
-- name = "DiwanMishafi",
-- path = "/Library/Fonts/Mishafi.ttf"
-- },
-- …<snip>…
-- }