setasign\SetaPDF2\Core\Font

Descriptor Class representing a font descriptor

File: /SetaPDF v2/Core/Font/Descriptor.php
Old class name (alias): \SetaPDF_Core_Font_Descriptor

Class hierarchy

Summary

Properties

$_dictionary


Methods

__construct()

_get()

private Descriptor::_get (
string $key,
?mixed $default = null
): ?mixed

Helper method to get values from a font descriptor.

Parameters
$key : string
 
$default : ?mixed
 
Exceptions

Throws Exception

_getFontFile()

private Descriptor::_getFontFile (
string $key
): false|\SetaPDF_Core_Type_Stream

Helper method to get font file entries.

Parameters
$key : string
 

getAscent()

public Descriptor::getAscent (
void
): int|float|false

Get the maximum height above the baseline reached by glyphs in this font.

Exceptions

Throws Exception

getAvgWidth()

public Descriptor::getAvgWidth (
void
): int|float

Get the average width of glyphs in the font.

Exceptions

Throws Exception

getCapHeight()

public Descriptor::getCapHeight (
void
): int|float|false

Get the vertical coordinate of the top of flat capital letters, measured from the baseline.

Exceptions

Throws Exception

getDescent()

public Descriptor::getDescent (
void
): int|float|false

Get the maximum depth below the baseline reached by glyphs in this font.

Exceptions

Throws Exception

getDictionary()

Get the font descriptor dictionary.

getFlags()

public Descriptor::getFlags (
void
): int

Get a collection of flags defining various characteristics of the font.

Exceptions

Throws Exception

getFontBBox()

public Descriptor::getFontBBox (
void
): array|false

Get a rectangle, expressed in the glyph coordinate system, that shall specify the font bounding box.

getFontFamily()

public Descriptor::getFontFamily (
void
): string|false

Get the preferred font family name.

Exceptions

Throws Exception

getFontFile()

Get a stream containing a Type 1 font program.

getFontFile2()

Get a stream containing a TrueType font program.

getFontFile3()

Get a stream containing a font program whose format is specified by the Subtype entry in the stream dictionary.

getFontName()

public Descriptor::getFontName (
void
): string

Get the PostScript name of the font.

Exceptions

Throws Exception

getFontStretch()

public Descriptor::getFontStretch (
void
): string|false

Get the font stretch value.

Exceptions

Throws Exception

getFontWeight()

public Descriptor::getFontWeight (
void
): int|float|false

Get the weight (thickness) component of the fully-qualified font name or font specifier.

Exceptions

Throws Exception

getItalicAngle()

public Descriptor::getItalicAngle (
void
): int|float

Get the angle, expressed in degrees counterclockwise from the vertical, of the dominant vertical strokes of the font.

Exceptions

Throws Exception

getLeading()

public Descriptor::getLeading (
void
): int|float

Get the spacing between baselines of consecutive lines of text.

Exceptions

Throws Exception

getMaxWidth()

public Descriptor::getMaxWidth (
void
): int|float

Get the maximum width of glyphs in the font.

Exceptions

Throws Exception

getMissingWidth()

public Descriptor::getMissingWidth (
void
): int|float

Get the width to use for character codes whose widths are not specified in a font dictionary's Widths array.

Exceptions

Throws Exception

getStemH()

public Descriptor::getStemH (
void
): int|float

Get the thickness, measured vertically, of the dominant horizontal stems of glyphs in the font.

Exceptions

Throws Exception

getStemV()

public Descriptor::getStemV (
void
): int|float|false

Get the thickness, measured horizontally, of the dominant vertical stems of glyphs in the font.

Exceptions

Throws Exception

getXHeight()

public Descriptor::getXHeight (
void
): int|float

Get the font’s x height.

The vertical coordinate of the top of flat nonascending lowercase letters (like the letter x), measured from the baseline, in fonts that have Latin characters.

Exceptions

Throws Exception