CTS logo
hazy blue Catskill Mountains in distance

News:

PDF::Builder v3.028 Released, 31 December 2025
   Please also see the CPAN listing, the GitHub entry, and the latest changes list.


A Thought…

I think they just got through marinating the greens.

   — Yogi Berra

NAME

PDF::Builder::Resource::CIDFont - Base class for CID fonts

Inherits from PDF::Builder::Resource::BaseFont

METHODS

new

    $font = PDF::Builder::Resource::CIDFont->new($pdf, $name)

Returns a cid-font object, base class for all CID-based fonts.

glyphByCId

    $n = $font->glyphByCId($gid)

Returns a character's glyph name (string), given its glyph ID.

uniByCId

    $u = $font->uniByCId($gid)

Returns a character's Unicode point, given its glyph ID. If no match, return U+0000.

cidByUni

    $c = $font->cidByUni($uid)

Returns a glyph ID, given its Unicode point.

cidByEnc

    $c = $font->cidByEnc($char)

Returns a character's glyph ID, given its encoding (single byte value 0 to 255).

wxByCId

    $w = $font->wxByCId($gid)

Returns a character's width, given its glyph ID. Typically this is based on a 1000 unit wide grid.

wxByUni

    $w = $font->wxByUni($uid)

Returns a character's width, given its Unicode point. Typically this is based on a 1000 unit wide grid.

wxByEnc

    $w = $font->wxByEnc($enc)

Returns a character's width, given its encoding (a single byte character in the range 0 to 255). Typically this is based on a 1000 unit wide grid.

width

    $w = $font->width($string)

Returns a string's width. This is typically based on a 1000 wide grid for each glyph.

width_cid

    $w = $font->width_cid($gid)

Returns a character's width, given its glyph ID. This is typically based on a 1000 wide grid for a glyph.

cidsByStr

    $cidstring = $font->cidsByStr($string)

Returns the cid-string (as a single text string, not an array) from string, based on the font's encoding map.

cidsByUtf

    $cidstring = $font->cidsByUtf($utf8string)

Returns the CID-encoded string (a text string, not an array) from utf8-string.

textByStr

    $cid_string = $font->textByStr($text)

Returns a cid text string, given a text string.

textByStrKern

    $cid_string = $font->textByStrKern($text, $size, $indent)

Returns a cid string, given character text, size, and indentation.

text

    $stream_str = $font->text($text, $size, $indent)

Returns a PDF text stream-ready code block to output the given text.

text_cid

    $stream_str = $font->text_cid($text, $size)

Returns a PDF text stream-ready output using glyph IDs, given input text and size.

text_cid_kern

    $font->text_cid_kern($text, $size, $indent)

Returns a PDF output-ready stream command using glyph IDs, given text, size, and indentation.

encodeByName

    $font = $font->encodeByName($enc)

Returns updated $font object, given an input encoding.

glyphNum

    $g_or_w = $font->glyphNum()

If 'glyphs' table is defined for a font, return its size; otherwise, return the 'wx' widths table size.

NAVIGATION LINKS

Up (Parents)

Master Index
PDF::Builder -- Facilitates the creation and modification of PDF files
PDF::Builder::Resource -- Base class for PDF resources

Siblings

PDF::Builder::Resource::BaseFont -- Base class for font resources
PDF::Builder::Resource::ColorSpace -- Base class for PDF color spaces
PDF::Builder::Resource::Colors -- Translate color names into RGB settings
PDF::Builder::Resource::ExtGState -- Graphics state dictionary support
PDF::Builder::Resource::Font -- Some common support routines for font files
PDF::Builder::Resource::Glyphs -- Preparsed uniglyph.txt file information
PDF::Builder::Resource::PaperSizes -- List of standard paper sizes and their dimensions
PDF::Builder::Resource::Pattern -- Support stub for fill patterns
PDF::Builder::Resource::Shading -- Support stub for fill shading patterns
PDF::Builder::Resource::UniFont -- Unicode Font Support
PDF::Builder::Resource::XObject -- Base class for external objects

Down (Children)

PDF::Builder::Resource::CIDFont::CJKFont -- Base class for CJK fonts
PDF::Builder::Resource::CIDFont::TrueType -- TrueType (ttfont) font support

 

All content © copyright 2005 – 2026 by Catskill Technology Services, LLC.
All rights reserved.
Note that Third Party software (whether Open Source or proprietary) on this site remains under the copyright and license of its owners. Catskill Technology Services, LLC does not claim copyright over such software.

 

This page is https://www.catskilltech.com/Documentation/PDF/Builder/Resource/CIDFont.html

Search Quotations database.

Last updated Thu, 01 Jan 2026 at 7:49 PM

Valid HTML 5

Sun, 14 Jun 2026 at 8:52 AM EDT