[texhax] pdftex and Unicode

D. R. Evans doc.evans at gmail.com
Sun Aug 26 01:36:11 CEST 2018


I have a document that uses just one font, \tt, and contains the string "1/2".
The document renders perfectly under pdftex.

I would like to change the document so that instead of "1/2", it uses the
single Unicode character ½ (VULGAR FRACTION ONE HALF, Unicode character 555,
0x22b).

https://texfaq.org/FAQ-unicode says:

> “Modern” TeX-alike applications, XeTeX and LuaTeX read their input using 
> UTF-8 representations of Unicode as standard. They also use TrueType or 
> OpenType fonts for output; each such font has tables that tell the
> application which part(s) of the Unicode space it covers; the tables enable
> the engines to decide which font to use for which character (assuming there
> is any choice at all).

which left me with the impression that nowadays I don't have to struggle with
the old 255-glyph limit or any of the concomitant pain of handling Unicode,
and all I needed to do was to change the string "1/2" in the TeX source file
to "½". But that seems not to be the case: nothing at all displayed at the
point where I expected to see the "½" in the resultant PDF file.

Here is a stripped-down trivial test.tex source file that shows what I mean:

----

\tt

Line 1: 1/2

Line 2: ½

\end

----

No errors are raised by pdftex, but the "½" character is absent in the output.

What is the correct way to have pdftex produce the "½" glyph?

  Doc

PS This is on an up-to-date 64-bit debian stable system.

-- 
Web:  http://enginehousebooks.com/drevans

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://tug.org/pipermail/texhax/attachments/20180825/b8d9f0cb/attachment.sig>


More information about the texhax mailing list