ListStyle

Resolves list marker types and generates the counter text for list items.

Namespace: Com\Tecnick\Pdf\CSS

class ListStyle

Source: src/CSS/ListStyle.php:38

Resolves list marker types and generates the counter text for list items.

The HTML “type” attribute values 1/a/A/i/I are case-sensitive and are mapped to the equivalent CSS list-style-type keyword; CSS keywords are case-insensitive. Counters outside the range of their counter style fall back to the decimal counter.

Constants

ROMAN_LIMIT

Maximum number representable with the Roman notation, using two vinculum layers.

public const ROMAN_LIMIT = 3999999999

Source: src/CSS/ListStyle.php:43

Methods

counterText()

Returns the counter text for a list item, without the marker suffix.

Numbers outside the range of the counter style use the decimal counter.

public static counterText(string $type, int $count): string

Parameters:

  • $type (string): List marker type.
  • $count (int): List entry position, starting from 1.

Returns: string

Source: src/CSS/ListStyle.php:741

isKnownType()

Returns true when the list marker type is a supported bullet or counter style.

public static isKnownType(string $type): bool

Parameters:

  • $type (string): List marker type.

Returns: bool

Source: src/CSS/ListStyle.php:701

isUnordered()

Returns true when the list marker type has no counter.

public static isUnordered(string $type): bool

Parameters:

  • $type (string): List marker type.

Returns: bool

Source: src/CSS/ListStyle.php:691

pdfUaNumbering()

Returns the PDF ListNumbering value for a list marker type.

public static pdfUaNumbering(string $type, string $tag): string

Parameters:

  • $type (string): List marker type.
  • $tag (string): HTML tag name of the list element.

Returns: string

Source: src/CSS/ListStyle.php:779

resolveKnownType()

Returns the canonical keyword of a supported bullet or counter style, or an empty string for any other value.

public static resolveKnownType(string $type): string

Parameters:

  • $type (string): List marker type.

Returns: string

Source: src/CSS/ListStyle.php:712

resolveType()

Returns the canonical list-style-type keyword for a list marker type.

Internal sentinels and image markers are returned unchanged.

public static resolveType(string $type): string

Parameters:

  • $type (string): List marker type.

Returns: string

Source: src/CSS/ListStyle.php:670

roman()

Returns the Roman representation of an integer number.

Roman standard notation can represent numbers up to 3,999. For bigger numbers, up to two layers of the “vinculum” notation are used for a max value of 3,999,999,999.

public static roman(int $num): string

Parameters:

  • $num (int): Number to convert.

Returns: string

Source: src/CSS/ListStyle.php:801