Abstract class which manages PDF fonts.
Defines the public interface and creates shared storage for concrete subclasses which are responsible for generating the font's information dictionaries, mapping characters to glyphs, and providing both overall font and glyph-specific metric data.
Font objects should be normally be obtained from the factory methods Zend_Pdf_Font::fontWithName and Zend_Pdf_Font::fontWithPath.
Located in /Zend/Pdf/Resource/Font.php (line 50)
Zend_Pdf_Resource | --Zend_Pdf_Resource_Font
Class | Description |
---|---|
![]() |
OpenType fonts implementation |
![]() |
Abstract class definition for the standard 14 Type 1 PDF fonts. |
Object representing the font's cmap (character to glyph map).
Typographical ascent. See getAscent().
Typographical descent. See getDescent().
Array containing descriptive names for the font. See fontName().
The type of font. Use TYPE_ constants defined in Zend_Pdf_Font.
The highest integer index in the glyph widths array.
Array containing the widths of each of the glyphs contained in the font.
Flag indicating whether or not this font is bold.
Flag indicating whether or not this font is italic.
Flag indicating whether or not this font is monospaced.
Typographical line gap. See getLineGap().
The position above the text baseline of the strikethrough (in glyph units).
The thickness of the strikethrough (in glyph units).
The position below the text baseline of the underline (in glyph units).
The thickness of the underline (in glyph units).
Number of glyph units per em. See getUnitsPerEm().
Inherited from Zend_Pdf_Resource
Zend_Pdf_Resource::$_objectFactory
Zend_Pdf_Resource::$_resource
Object constructor.
The $embeddingOptions parameter allows you to set certain flags related to font embedding. You may combine options by OR-ing them together. See the EMBED_ constants defined in Zend_Pdf_Font for the list of available options and their descriptions.
Convert string from Windows ANSI encoding to local encoding.
NOTE: This method may disappear in a future revision of the framework once the font subsetting and Unicode support code is complete. At that point, there may be multiple ways of encoding strings depending on intended usage. You should treat this method as framework internal use only.
Convert string from local encoding to Windows ANSI encoding.
NOTE: This method may disappear in a future revision of the framework once the font subsetting and Unicode support code is complete. At that point, there may be multiple ways of encoding strings depending on intended usage. You should treat this method as framework internal use only.
Returns the typographic ascent in font glyph units.
The typographic ascent is the distance from the font's baseline to the top of the text frame. It is frequently used to locate the initial baseline for a paragraph of text inside a given rectangle.
Returns a number between 0 and 1 inclusive that indicates the percentage of characters in the string which are covered by glyphs in this font.
Since no one font will contain glyphs for the entire Unicode character range, this method can be used to help locate a suitable font when the actual contents of the string are not known.
Note that some fonts lie about the characters they support. Additionally, fonts don't usually contain glyphs for control characters such as tabs and line breaks, so it is rare that you will get back a full 1.0 score. The resulting value should be considered informational only.
Returns the typographic descent in font glyph units.
The typographic descent is the distance below the font's baseline to the bottom of the text frame. It is always negative.
Returns the specified descriptive name for the font.
The font name type is usually one of the following:
Note that not all names are available for all fonts. In addition, some fonts may contain additional names, whose indicies are in the range 256 to 32767 inclusive, which are used for certain font layout features.
If the preferred language translation is not available, uses the first available translation for the name, which is usually English.
If the requested name does not exist, returns null.
All names are stored internally as Unicode strings, using UTF-16BE encoding. You may optionally supply a different resulting character set.
Returns the type of font.
Returns the typographic line gap in font glyph units.
The typographic line gap is the distance between the bottom of the text frame of one line to the top of the text frame of the next. It is typically combined with the typographical ascent and descent to determine the font's total line height (or leading).
Returns the suggested line height (or leading) in font glyph units.
This value is determined by adding together the values of the typographic ascent, descent, and line gap. This value yields the suggested line spacing as determined by the font developer.
It should be noted that this is only a guideline; layout engines will frequently modify this value to achieve special effects such as double- spacing.
Returns the suggested position above the text baseline of the strikethrough in glyph units.
Returns the suggested line thickness of the strikethrough in glyph units.
Returns the suggested position below the text baseline of the underline in glyph units.
This value is usually negative.
Returns the suggested line thickness of the underline in glyph units.
Returns the number of glyph units per em.
Used to convert glyph space to user space. Frequently used in conjunction with widthsForGlyphs() to calculate the with of a run of text.
Returns the width of the glyph.
Like widthsForGlyphs() but used for one glyph at a time.
Returns the widths of the glyphs.
The widths are expressed in the font's glyph space. You are responsible for converting to user space as necessary. See {$link unitsPerEm()}.
Throws an exception if the glyph number is out of range.
See also widthForGlyph().
Returns true if the embedding option has been set for this font.
The embedding options are stored as a bitfield. Multiple options may be set at the same time.
This is only used by certain subclasses.
If the font's glyph space is not 1000 units per em, converts the value.
Returns the full name of the font in the encoding method of the current locale. Transliterates any characters that cannot be naturally represented in that character set.
Inherited From Zend_Pdf_Resource
Zend_Pdf_Resource::__construct()
Zend_Pdf_Resource::getResource()
Documentation generated on Thu, 18 Jan 2007 09:53:53 -0800 by phpDocumentor 1.3.1