summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/pdfuni-string.opm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/optex/pdfuni-string.opm')
-rw-r--r--macros/luatex/optex/pdfuni-string.opm29
1 files changed, 16 insertions, 13 deletions
diff --git a/macros/luatex/optex/pdfuni-string.opm b/macros/luatex/optex/pdfuni-string.opm
index e993e61a75..33701522fb 100644
--- a/macros/luatex/optex/pdfuni-string.opm
+++ b/macros/luatex/optex/pdfuni-string.opm
@@ -14,10 +14,11 @@
\_begingroup
\_catcode`\\=12 \_let\\=\_bslash
\_the\_regoul \_relax % \_regmacro alternatives of logos etc.
- \_edef#1{#2}%
+ \_escapechar=-1
+ \_edef#1{#2\empty}%
+ \_escapechar=`\\
\_ea\_edef \_ea#1\_ea{\_ea\_removeoutmath #1$\_end$}% $x$ -> x
\_ea\_edef \_ea#1\_ea{\_ea\_removeoutbraces #1{\_end}}% {x} -> x
- \_escapechar=-1
\_edef#1{\_detokenize\_ea{#1}}%
\_replstring#1{ }{{ }}% text text -> text{ }text
\_edef\_out{\\376\\377}%
@@ -42,7 +43,6 @@
\_let\it=\_empty \_let\bi=\_empty \_let\tt=\_empty \_let\/=\_empty
\_let~=\_space
}
-
\public \pdfunidef ;
\_endcode % --------------------------------
@@ -52,24 +52,27 @@ etc.). First one is PDFDocEncoding which is one-byte encoding, but most
Czech or Slovak characters are missing here.
The second encoding is PDFunicode encoding wich is implemented in this file.
-This encoding is TeX-dicomfortable, because it looks like
+This encoding is \TeX/-discomfortable, because it looks like
+\begtt
\376\377\000C\000v\000i\001\015\000e\000n\000\355\000\040\000j\000e\000\040
\000z\000\341\000t\001\033\001\176
+\endtt
This example is real encoding of the string "Cvičení je zátěž". You can see
that this is UTF-16 encoding (two bytes per character) with two starting
bytes FEFF. Moreover, each byte is encoded by three octal digits preceded by
backslash. The only exception is the visible ASCII character encoding: such
-a character is encoded by its real byte preceded by \000.
+a character is encoded by its real byte preceded by `\000`.
-The pdfuni.tex macro implements the command
-
-\pdfunidef\macro{string}
-
-We implemented the octal string printing of one character using \directlua.
+The command \`\pdfunidef``\macro{string}` is implemented here
+using `\directlua`.
The input string is preprocessed: detokenized, converted `\word /` to
-`\word/` (used in logos) preprocessed spaces using \replstring and then the
-\_pdfunidefB is repeated on each character. It calls the `\directlua` chunk
-to print octal numbers.
+`\word/` (used in logos) preprocessed spaces using \^`\replstring` and then the
+\`\_pdfunidefB` is repeated on each character. It calls the `\directlua` chunk
+to print octal numbers in the macro `\_octalprint`.
+
+The \^`\regmacro` is used in order to sed the values of macros
+`\em`, `\rm`, `\bf`, `\it`, `\bi`, `\tt`, `\/` and `~` to values usable in
+PDF outlines.