setasign\SetaPDF2\Core\Font\TrueType\Table

Header A class representing the Font Header Table (head) in a TrueType file. https://www.microsoft.com/typography/otspec/head.htm

File: /SetaPDF v2/Core/Font/TrueType/Table/Header.php
Old class name (alias): \SetaPDF_Core_Font_TrueType_Table_Header

Class hierarchy

Summary

Constants

MAC_STYLE_BOLD

public const Header::MAC_STYLE_BOLD = 1

Mac style ids.

MAC_STYLE_CONDENSED

public const Header::MAC_STYLE_CONDENSED = 32

MAC_STYLE_EXTENDED

public const Header::MAC_STYLE_EXTENDED = 64

MAC_STYLE_ITALIC

public const Header::MAC_STYLE_ITALIC = 2

MAC_STYLE_OUTLINE

public const Header::MAC_STYLE_OUTLINE = 8

MAC_STYLE_SHADOW

public const Header::MAC_STYLE_SHADOW = 16

MAC_STYLE_UNDERLINE

public const Header::MAC_STYLE_UNDERLINE = 4

TAG

public const string Header::TAG = 'head'

The tag name of this class


Properties

$_data

protected array AbstractTable::$_data = array()

Data of the table

$_entries

protected array Header::$_entries = array(...)

The entries of this table.

$_rawData

protected array AbstractTable::$_rawData = array()

Raw binary data read from the file

$_record


Static Methods

getClassName()

public static AbstractTable::getClassName (
string $tag
): string

Get a class name for a specific table by its tag name.

Parameters
$tag : string
 

Methods

__construct()

_get()

protected AbstractTable::_get (
string $name
): mixed

Get a value from the table.

The properties are defined in the $_entries property of an implemented table.

Parameters
$name : string
 

_getRaw()

protected AbstractTable::_getRaw (
string $name
): mixed

Get raw data from a specific table.

The properties are defined in the $_entries property of an implemented table.

Parameters
$name : string
 

cleanUp()

public AbstractTable::cleanUp (
void
): void

Release memory.

getBoundingBox()

public Header::getBoundingBox (
bool $recalc = false
): array

Get the bounding box.

Parameters
$recalc : bool
 
Exceptions

Throws \setasign\SetaPDF2\Core\Font\Exception

getCheckSumAdjustment()

public Header::getCheckSumAdjustment (
void
): int

Get the check sum adjustment.

getCreated()

public Header::getCreated (
void
): string

Get the number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone when the font was created.

Return Values

The raw data representing the LONGDATETIME data type.

getEntry()

public AbstractTable::getEntry (
$name
): void
Parameters
$name
 

getFlags()

public Header::getFlags (
void
): int

Get the font flags.

getFontDirectionHint()

public Header::getFontDirectionHint (
void
): int

Get the font direction hint (deprecated).

getGlyphDataFormat()

public Header::getGlyphDataFormat (
void
): int

Get glyph data format.

getIndexToLocFormat()

public Header::getIndexToLocFormat (
void
): int

Get index to location format.

Return Values

0 for short offsets, 1 for long.

getLowestRecPPEM()

public Header::getLowestRecPPEM (
void
): int

Get the smallest readable size in pixels.

getMacStyle()

public Header::getMacStyle (
void
): int

Get the MacStyle

Bit 0: Bold (if set to 1); Bit 1: Italic (if set to 1) Bit 2: Underline (if set to 1) Bit 3: Outline (if set to 1) Bit 4: Shadow (if set to 1) Bit 5: Condensed (if set to 1) Bit 6: Extended (if set to 1) Bits 7-15: Reserved (set to 0).

getMagicNumber()

public Header::getMagicNumber (
void
): int

Get the magic number.

getModified()

public Header::getModified (
void
): string

Get the number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone when the font was modifed.

Return Values

The raw data representing the LONGDATETIME data type.

getRecord()

Get the record object.

getRevision()

public Header::getRevision (
bool $round = true
): float

Get the font revision.

Parameters
$round : bool
 

getUnitsPerEm()

public Header::getUnitsPerEm (
void
): int

Get the units per em value.

getVersion()

public Header::getVersion (
void
): float

Get the version (major.minor)

getXMax()

public Header::getXMax (
void
): int

Get the x-max value for all glyph bounding boxes.

getXMin()

public Header::getXMin (
void
): int

Get the x-min value for all glyph bounding boxes.

getYMax()

public Header::getYMax (
void
): int

Get the y-max value for all glyph bounding boxes.

getYMin()

public Header::getYMin (
void
): int

Get the y-min value for all glyph bounding boxes.

hasMacStyle()

public Header::hasMacStyle (
int $style
): bool

Checks whether a mac style is set or not.

Parameters
$style : int