-- @titre Jeu de caractères en texte -- @title Character set as text -- @categorie exporter -- @resume Écrit tous les caractères dessinés de la fonte, rangés par code, prêts à coller dans l'Aperçu, une affiche ou la recherche de Fontista Control. Les caractères codés mais vides sont listés à part. -- @summary Prints every drawn character of the font, sorted by code point, ready to paste into the Preview, a poster or Fontista Control's search. Encoded but empty characters are listed separately. -- Fontista · bibliothèque de scripts · https://fontista.thinkspark.dev/scripts.html local PER_LINE = 48 local en = lang == "en" local m = font.masters[1].id local drawn, empty = {}, {} for _, g in ipairs(font.glyphs) do local info = glyph(g) local cp = info and info.unicode if cp and cp > 0x20 and not (cp >= 0x7F and cp <= 0xA0) and cp ~= 0xAD then local l = layer(g, m) if l and not l.empty then drawn[#drawn + 1] = cp else empty[#empty + 1] = cp end end end table.sort(drawn) table.sort(empty) local function lines(list) local row = {} for i, cp in ipairs(list) do row[#row + 1] = utf8.char(cp) if #row == PER_LINE or i == #list then print(table.concat(row)) row = {} end end end print(string.format(en and "%d drawn characters:" or "%d caractères dessinés :", #drawn)) lines(drawn) if #empty > 0 then print(string.format(en and "%d encoded but empty:" or "%d codés mais vides :", #empty)) lines(empty) end