WinAnsiEncoder
in package
implements
TextEncoder
FinalYes
Encodes UTF-8 strings to WinAnsi (single-byte, ISO 8859-1 + Microsoft additions in 0x80–0x9F) for use with Type1 standard fonts and any other font whose /Encoding is WinAnsiEncoding.
Table of Contents
Interfaces
- TextEncoder
- Converts a UTF-8 string into the byte sequence expected by a PDF font's encoding (e.g. WinAnsi).
Methods
- encode() : string
- Encode UTF-8 input to the target encoding. Unmappable codepoints are substituted with 0x3F ('?') and recorded for later inspection.
- getMissingCodepoints() : array<int, int>
- Codepoints encountered since construction that could not be mapped.
Methods
encode()
Encode UTF-8 input to the target encoding. Unmappable codepoints are substituted with 0x3F ('?') and recorded for later inspection.
public
encode(string $utf8) : string
Parameters
- $utf8 : string
Return values
stringgetMissingCodepoints()
Codepoints encountered since construction that could not be mapped.
public
getMissingCodepoints() : array<int, int>
Returned in encounter order, with duplicates preserved so callers can see how often a missing glyph was requested.