Skip to content

OpenType feature query for a given font #9

@ponte-vecchio

Description

@ponte-vecchio

Now that fonts on LuaTeXit's device can be queried, we can now move onto


~ Looking up OpenType features for a given font ~


Ideation

Name: fontfeatures / ff
Usage: <prefix>ff <font name>
General workflow:

  1. Look up <font name>
  2. Identify path to <font name>; prioritise Regular variants
  3. Fetch feature tables GDEF/GSUB/GPOS
  4. Prettify for embed, perhaps following fontspec's? like:
feature_groups = {
    "Character Width": {"pwid", "fwid", "hwid", "twid", "qwid", "palt", "halt"},
    "CJK Shape": {"trad", "smpl", "jp78", "jp83", "jp90", "expt", "nlck"},
    "Contextuals": {"cswh", "cvXX", "calt", "init", "fina", "falt", "medi"},
    "Diacritics": {"mark", "mkmk", "abvm", "blwm"},
    "Fractions": {"frac", "afrc"},
    "Kerning": {"kern", "cpsp"},
    "Letters": {"smcp", "pcap", "c2sc", "c2pc", "unic"},
    "Ligatures": {"rlig", "liga", "clig", "dlig", "hlig", "tlig"},
    "Local Forms": {"locl"},
    "Numbers": {"lnum", "onum", "pnum", "tnum", "zero", "anum"},
    "Style": {"ssXX", "salt", "curs", "hist", "ital", "ruby", "swsh", "titl", "case", "hkna", "vkna"},
    "Vertical Positions": {"sups", "subs", "numr", "dnom", "sinf", "ordn"},
    "Vertical": {"vrt2", "vrtr", "vert", "vkna", "vkrn", "valt", "vhal", "vpal"},
}

Libraries of interest

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions