{
    "mode": "perldoc",
    "parameter": "PDF::API2::Resource::BaseFont",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/PDF%3A%3AAPI2%3A%3AResource%3A%3ABaseFont/json",
    "generated": "2026-06-13T14:02:34Z",
    "sections": {
        "NAME": {
            "content": "PDF::API2::Resource::BaseFont - Base class for font resources\n",
            "subsections": []
        },
        "METHODS": {
            "content": "$font = PDF::API2::Resource::BaseFont->new($pdf, $name)\nReturn a font resource object.\n\n$descriptor = $font->descrByData()\nReturn the font's FontDescriptor key structure based on the font's data.\n",
            "subsections": []
        },
        "FONT-MANAGEMENT RELATED METHODS": {
            "content": "$name = $font->fontname()\nReturn the font's name (a.k.a. display name).\n\n$name = $font->altname()\nReturn the font's alternative name (a.k.a. Windows name for a postscript font).\n\n$name = $font->subname()\nReturn the font's subname (a.k.a. font variant, schriftschnitt).\n\n$name = $font->apiname()\nReturn the font's name to be used internally (should be equal to $font->name()).\n\n$issymbol = $font->issymbol()\nReturn the font's symbol flag.\n\n$iscff = $font->iscff()\nReturn the font's Compact Font Format flag.\n",
            "subsections": []
        },
        "TYPOGRAPHY RELATED METHODS": {
            "content": "($llx, $lly, $urx, $ury) = $font->fontbbox()\nReturn the font's bounding box.\n\n$capheight = $font->capheight()\nReturn the font's capheight value.\n\n$xheight = $font->xheight()\nReturn the font's xheight value.\n\n$missingwidth = $font->missingwidth()\nReturn the font's missingwidth value.\n\n$maxwidth = $font->maxwidth()\nReturn the font's maxwidth value.\n\n$avgwidth = $font->avgwidth()\nReturn the font's avgwidth value.\n\n$flags = $font->flags()\nReturn the font's flags value.\n\n$stemv = $font->stemv()\nReturn the font's stemv value.\n\n$stemh = $font->stemh()\nReturn the font's stemh value.\n\n$italicangle = $font->italicangle()\nReturn the font's italicangle value.\n\n$isfixedpitch = $font->isfixedpitch()\nReturn the font's isfixedpitch flag.\n\n$underlineposition = $font->underlineposition()\nReturn the font's underlineposition value.\n\n$underlinethickness = $font->underlinethickness()\nReturn the font's underlinethickness value.\n\n$ascender = $font->ascender()\nReturn the font's ascender value.\n\n$descender = $font->descender()\nReturn the font's descender value.\n",
            "subsections": []
        },
        "GLYPH RELATED METHODS": {
            "content": "@names = $font->glyphNames()\nReturn the defined glyph names of the font.\n\n$glNum = $font->glyphNum()\nReturn the number of defined glyph names of the font.\n\n$uni = $font->uniByGlyph($char)\nReturn the unicode by glyph name.\n\n$uni = $font->uniByEnc($char)\nReturn the unicode by the fonts encoding map.\n\n$uni = $font->uniByMap($char)\nReturn the unicode by the font's default map.\n\n$char = $font->encByGlyph($glyph)\nReturn the character by the given glyph name of the font's encoding map.\n\n$char = $font->encByUni($uni)\nReturn the character by the given unicode of the font's encoding map.\n\n$char = $font->mapByGlyph($glyph)\nReturn the character by the given glyph name of the font's default map.\n\n$char = $font->mapByUni($uni)\nReturn the character by the given unicode of the fonts default map.\n\n$name = $font->glyphByUni($uni)\nReturn the glyph's name by the font's unicode map. BEWARE: non-standard glyph-names are\nmapped onto the ms-symbol area (0xF000).\n\n$name = $font->glyphByEnc($char)\nReturn the glyph's name by the font's encoding map.\n\n$name = $font->glyphByMap($char)\nReturn the glyph's name by the font's default map.\n\n$width = $font->wxByGlyph($glyph)\nReturn the glyph's width.\n\n$width = $font->wxByUni($uni)\nReturn the unicode's width.\n\n$width = $font->wxByEnc($char)\nReturn the character's width based on the current encoding.\n\n$width = $font->wxByMap($char)\nReturn the character's width based on the font's default encoding.\n\n$wd = $font->width($text)\nReturn the width of $text as if it were at size 1.\n\n@widths = $font->widtharray($text)\nReturn the widths of the words in $text as if they were at size 1.\n",
            "subsections": []
        },
        "STRING METHODS": {
            "content": "$utf8string = $font->utfByStr($string)\nReturn the utf8-string from string based on the font's encoding map.\n\n$string = $font->strByUtf($utf8string)\nReturn the encoded string from utf8-string based on the font's encoding map.\n\n$pdfstring = $font->textByStr($text)\nReturn a properly formatted representation of $text for use in the PDF.\n",
            "subsections": []
        }
    },
    "summary": "PDF::API2::Resource::BaseFont - Base class for font resources",
    "flags": [],
    "examples": [],
    "see_also": []
}