summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-04-26 21:34:47 +0000
committerKarl Berry <karl@freefriends.org>2020-04-26 21:34:47 +0000
commit1990374c1e9958b0ebbce5d2b170bf659c24abe3 (patch)
tree581d2a1456d052543e6f26cdc0bafe711aca38de /Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
parent4427294b9b94376955632103bc89a3691257ccc3 (diff)
optex (26apr20)
git-svn-id: svn://tug.org/texlive/trunk@54893 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm')
-rw-r--r--Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm29
1 files changed, 16 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm b/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
index e993e61a756..33701522fbd 100644
--- a/Master/texmf-dist/tex/luatex/optex/pdfuni-string.opm
+++ b/Master/texmf-dist/tex/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.