SetaPDF_Core_Font_TrueType_Subset Class that represents a PDF TrueType font subset.
File: /SetaPDF v2/Core/Font/TrueType/Subset.php
This class will embedded a subset of the original TrueType font programm with only glyphs, that were requested by calling the getCharCodes() method.
The subset can represent up to 255 glyphs.
Class hierarchy
Implements
- SetaPDF_Core_Font_FontInterface
- SetaPDF_Core_Font_Glyph_Collection_CollectionInterface
- SetaPDF_Core_Resource
Summary
Methods
- __construct()
- _createSubset()
- _getSubsetFile()
- _getToUnicode()
- _registerChar()
- cleanUp()
- getAscent()
- getCharCodes()
- getDescent()
- getDocument()
- getFontBBox()
- getFontDescriptorFlags()
- getFontFile()
- getFontName()
- getGlyphWidth()
- getGlyphWidthByCharCode()
- getGlyphsWidth()
- getIndirectObject()
- getRegisteredChars()
- getResourceType()
- getUnderlinePosition()
- getUnderlineThickness()
- splitCharCodes()
Constants
TYPE_COLOR_SPACE
Type constant
TYPE_EXT_G_STATE
Type constant
TYPE_FONT
Type constant
TYPE_PATTERN
Type constant
TYPE_PROC_SET
Type constant
TYPE_PROPERTIES
Type constant
TYPE_SHADING
Type constant
TYPE_X_OBJECT
Type constant
Properties
$_ascent
The ascent value.
$_descent
The descent value.
$_factor
The scaling factor from TrueType units to glyph coordinate system.
$_fontBBox
The font bounding box.
$_fontName
The font name.
$_subsetFile
The instance of the subset class.
$_throwExceptionWhenMissingGlyphIsUsed
Flag saying whether an exception should be thrown if a character is not available or not.
Methods
__construct()
The constructor.
Parameters
- $document : SetaPDF_Core_Document
- $fontFile : SetaPDF_Core_Font_TrueType_File|string|SetaPDF_Core_Reader_Binary
- $throwExceptionWhenMissingGlyphIsUsed : bool
Whether an exception should be thrown if the registered character cannot be found or not.
- $ignoreLicenseRestrictions : bool
Can be used to disable the font license check
Exceptions
Throws SetaPDF_Core_Exception
Throws SetaPDF_Core_Font_Exception
_createSubset()
Create the final subset file and embed it into the PDF document.
Exceptions
Throws SetaPDF_Core_Font_Exception
_getSubsetFile()
Gets the subset file instance.
Exceptions
Throws SetaPDF_Core_Font_Exception
_registerChar()
Registers a glyph that got registered in the font subsetter.
Parameters
- $char : string
- $charCode : string
getCharCodes()
Get the final character codes of a character string.
Parameters
- $chars : string
The character string
- $encoding : string
The output encoding
Exceptions
Throws SetaPDF_Core_Font_Exception
getDescent()
Returns the distance from baseline of lowest descender (Typographic descent).
Exceptions
getFontBBox()
getFontDescriptorFlags()
Get flags defining various characteristics of the font.
Exceptions
Throws SetaPDF_Exception_NotImplemented
See
- PDF 32000-1:2008 - 9.8.2 Font Descriptor Flags
getFontName()
getGlyphWidth()
Get the glyph width of a single character.
Parameters
- $char : string
The character
- $encoding : string
The encoding of the character
Exceptions
Throws SetaPDF_Core_Font_Exception
getGlyphWidthByCharCode()
Get the glyph width by a char code.
Parameters
- $charCode : string
Exceptions
Throws SetaPDF_Core_Font_Exception
getGlyphsWidth()
Get the glyphs width of a string.
Parameters
- $chars : string
The string
- $encoding : string
The encoding of the characters
Exceptions
Throws SetaPDF_Core_Font_Exception
getIndirectObject()
Get the indirect object of this resource.
Parameters
- $document : SetaPDF_Core_Document|null