{
    "mode": "perldoc",
    "parameter": "Font::TTF::Name",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Font%3A%3ATTF%3A%3AName/json",
    "generated": "2026-06-16T10:21:08Z",
    "sections": {
        "NAME": {
            "content": "Font::TTF::Name - String table for a TTF font\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Strings are held by number, platform, encoding and language. Strings are accessed as:\n\n$f->{'name'}{'strings'}[$number][$platformid][$encodingid]{$languageid}\n\nNotice that the language is held in an associative array due to its sparse nature on some\nplatforms such as Microsoft ($pid = 3). Notice also that the array order is different from the\nstored array order (platform, encoding, language, number) to allow for easy manipulation of\nstrings by number (which is what I guess most people will want to do).\n\nBy default, $Font::TTF::Name::utf8 is set to 1, and strings will be stored as UTF8 wherever\npossible. The method \"isutf8\" can be used to find out if a string in a particular platform and\nencoding will be returned as UTF8. Unicode strings are always converted if utf8 is requested.\nOtherwise, strings are stored according to platform:\n\nYou now have to set <$Font::TTF::Name::utf8> to 0 to get the old behaviour.\n\nApple Unicode (platform id = 0)\nData is stored as network ordered UCS2. There is no encoding id for this platform but there\nare language ids as per Mac language ids.\n\nMac (platform id = 1)\nData is stored as 8-bit binary data, leaving the interpretation to the user according to\nencoding id.\n\nUnicode (platform id = 2)\nCurrently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this will change\nto utf8 assuming current UCS2 semantics for all encoding ids.\n\nWindows (platform id = 3)\nAs per Unicode, the data is currently stored as 16-bit network ordered UCS2. Upon release of\nPerl 5.005 this will change to utf8 assuming current UCS2 semantics for all encoding ids.\n",
            "subsections": []
        },
        "INSTANCE VARIABLES": {
            "content": "strings\nAn array of arrays, etc.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "$t->read\nReads all the names into memory\n\n$t->out($fh)\nWrites out all the strings\n\n$t->XMLelement($context, $depth, $key, $value)\nOutputs the string element in nice XML (which is all the table really!)\n\n$t->XMLend($context, $tag, %attrs)\nStore strings in the right place\n\n$t->minsize()\nReturns the minimum size this table can be. If it is smaller than this, then the table must be\nbad and should be deleted or whatever.\n\nisutf8($pid, $eid)\nReturns whether a string of a given platform and encoding is going to be in UTF8\n\nfindname($nid)\nHunts down a name in all the standard places and returns the string and for an array context the\npid, eid & lid as well\n\nremovename($nid)\nRemoves all strings with the given name id from the table.\n\nsetname($nid, $str[, $lang[, @cover]])\nSets the given name id string to $str for all platforms and encodings that this module can\nhandle. If $lang is set, it is interpretted as a language tag and if the particular language of\na string is found to match, then that string is changed, otherwise no change occurs.\n\nIf supplied, @cover should be a list of references to two-element arrays containing pid,eid\npairs that should be added to the name table if not already present.\n\nThis function does not add any names to the table unless @cover is supplied.\n\nFont::TTF::Name->matchlang($pid, $lid, $lang)\nCompares the language associated to the string of given platform and language with the given\nlanguage tag. If the language matches the tag (i.e. is equal or more defined than the given\nlanguage tag) returns true. This is calculated by finding whether the associated language tag\nstarts with the given language tag.\n\nFont::TTF::Name->getlang($pid, $lid)\nReturns the language tag associated with a particular platform and language id\n\nFont::TTF::Name->findlang($pid, $lang)\nLooks up the language name and returns a lang id if one exists\n\nFont::TTF::Name->pelist()\nReturns an array of references to two-element arrays containing pid,eid pairs that already exist\nin this name table. Useful for creating @cover parameter to setname().\n",
            "subsections": []
        },
        "BUGS": {
            "content": "*   Unicode type strings will be stored in utf8 for all known platforms, once Perl 5.6 has been\nreleased and I can find all the mapping tables, etc.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Martin Hosken <http://scripts.sil.org/FontUtils>.\n",
            "subsections": []
        },
        "LICENSING": {
            "content": "Copyright (c) 1998-2016, SIL International (http://www.sil.org)\n\nThis module is released under the terms of the Artistic License 2.0. For details, see the full\ntext of the license in the file LICENSE.\n",
            "subsections": []
        }
    },
    "summary": "Font::TTF::Name - String table for a TTF font",
    "flags": [],
    "examples": [],
    "see_also": []
}