{
    "content": [
        {
            "type": "text",
            "text": "# Font::TTF::Cmap (perldoc)\n\n## NAME\n\nFont::TTF::Cmap - Character map table\n\n## DESCRIPTION\n\nLooks after the character map. For ease of use, the actual cmap is held in a hash against\ncodepoint. Thus for a given table:\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION**\n- **INSTANCE VARIABLES**\n- **METHODS**\n- **BUGS**\n- **AUTHOR**\n- **LICENSING**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Font::TTF::Cmap",
        "section": "",
        "mode": "perldoc",
        "summary": "Font::TTF::Cmap - Character map table",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "INSTANCE VARIABLES",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 50,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSING",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Font::TTF::Cmap - Character map table\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Looks after the character map. For ease of use, the actual cmap is held in a hash against\ncodepoint. Thus for a given table:\n\n$gid = $font->{'cmap'}{'Tables'}[0]{'val'}{$code};\n\nNote that $code should be a true value (0x1234) rather than a string representation.\n",
                "subsections": []
            },
            "INSTANCE VARIABLES": {
                "content": "The instance variables listed here are not preceded by a space due to their emulating structural\ninformation in the font.\n\nNum Number of subtables in this table\n\nTables\nAn array of subtables ([0..Num-1])\n\nEach subtable also has its own instance variables which are, again, not preceded by a space.\n\nPlatform\nThe platform number for this subtable\n\nEncoding\nThe encoding number for this subtable\n\nFormat\nGives the stored format of this subtable\n\nVer Gives the version (or language) information for this subtable\n\nval A hash keyed by the codepoint value (not a string) storing the glyph id\n\nThe following cmap options are controlled by instance variables that start with a space:\n\nallowholes\nBy default, when generating format 4 cmap subtables character codes that point to glyph zero\n(normally called .notdef) are not included in the subtable. In some cases including some of\nthese character codes can result in a smaller format 4 subtable. To enable this behavior,\nset allowholes to non-zero.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "$t->read\nReads the cmap into memory. Format 4 subtables read the whole subtable and fill in the segmented\narray accordingly.\n\n$t->mslookup($uni)\nFinds a Unicode table, giving preference to the MS one, and looks up the given Unicode codepoint\nin it to find the glyph id.\n\n$t->findms\nFinds the a Unicode table, giving preference to the Microsoft one, and sets the \"mstable\"\ninstance variable to it if found. Returns the table it finds.\n\n$t->msenc\nReturns the encoding of the microsoft table (0 => symbol, etc.). Returns undef if there is no\nMicrosoft cmap.\n\n$t->out($fh)\nWrites out a cmap table to a filehandle. If it has not been read, then just copies from input\nfile to output\n\n$t->XMLelement($context, $depth, $name, $val)\nOutputs the elements of the cmap in XML. We only need to process val here\n\n$t->minsize()\nReturns the minimum size this table can be in bytes. If it is smaller than this, then the table\nmust be bad and should be deleted or whatever.\n\n$t->update\nTidies the cmap table.\n\nRemoves MS Fmt12 cmap if it is no longer needed.\n\nRemoves from all cmaps any codepoint that map to GID=0. Note that such entries will be\nre-introduced as necessary depending on the cmap format.\n\n@map = $t->reverse(%opt)\nReturns a reverse map of the Unicode cmap. I.e. given a glyph gives the Unicode value for it.\nOptions are:\n\ntnum\nTable number to use rather than the default Unicode table\n\narray\nReturns each element of reverse as an array since a glyph may be mapped by more than one\nUnicode value. The arrays are unsorted. Otherwise store any one unicode value for a glyph.\n\nisunicode($index)\nReturns whether the table of a given index is known to be a unicode table (as specified in the\nspecifications)\n",
                "subsections": []
            },
            "BUGS": {
                "content": "*   Format 14 (Unicode Variation Sequences) cmaps are not supported.\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": []
            }
        }
    }
}