The Unicode text to encode
True if the font uses Type0/Identity-H encoding (2-byte CID per character)
OptionalreverseEncodingMap: Map<string, number>Optional map from Unicode character to byte code, derived by inverting the font's Differences-based encoding map
A PDF string token ready to use before Tj, e.g. <0050> Tj or (text) Tj
Encodes a text string for use in a PDF content stream text operator (
Tj).PDF literal strings
(...)in content streams are raw bytes interpreted by the font's encoding — NOT UTF-8. This function produces the correct PDF string token:<XXXX...>with 2 bytes per character (CID = Unicode codepoint)(...)with octal escapes\ooofor byte values ≥ 0x80, using the reverse encoding map when available for characters outside the Latin-1 range.