pdftex[921] branches/stable/doc/manual: document \pdfglyphtounicode

commits+karl at tug.org commits+karl at tug.org
Fri Feb 2 03:14:32 CET 2024


Revision: 921
          https://tug.org/svn/pdftex?view=revision&revision=921
Author:   karl
Date:     2024-02-02 03:14:32 +0100 (Fri, 02 Feb 2024)
Log Message:
-----------
document \pdfglyphtounicode stripping .suffixes; and \pdfpxdimen arithmetic niceties

Modified Paths:
--------------
    branches/stable/doc/manual/ChangeLog
    branches/stable/doc/manual/pdftex.tex

Modified: branches/stable/doc/manual/ChangeLog
===================================================================
--- branches/stable/doc/manual/ChangeLog	2024-01-16 17:16:01 UTC (rev 920)
+++ branches/stable/doc/manual/ChangeLog	2024-02-02 02:14:32 UTC (rev 921)
@@ -1,3 +1,12 @@
+2024-02-01  Karl Berry  <karl at freefriends.org>
+
+	* pdftex.tex (\pdfglyphtounicode): mention that a dot and anything
+	after is stripped from glyph names before looking for mappings.
+	(\pdfpxdimen): note that the pdftex default is a few sp different
+	from luatex, and both luatex and pdftex are a few sp different
+	from 72dpi. From jfbu,
+	https://tug.org/pipermail/pdftex/2023-March/009325.html.
+
 2024-01-16  Karl Berry  <karl at freefriends.org>
 
 	* pdftex.tex: simplify PDF inclusion for tagging,

Modified: branches/stable/doc/manual/pdftex.tex
===================================================================
--- branches/stable/doc/manual/pdftex.tex	2024-01-16 17:16:01 UTC (rev 920)
+++ branches/stable/doc/manual/pdftex.tex	2024-02-02 02:14:32 UTC (rev 921)
@@ -1542,6 +1542,12 @@
 \noindent means that for the font \type{foo.tfm}, only, the glyph
 \type{abc} is mapped to \type{U+5678}.
 
+Glyph names sometimes contain a dot, as in \type{somechar.sc}. \PDFTEX\
+simply strips the dot and everything after it before looking up the
+name, so in this case it would look for \type{somechar} (even if
+\type{somechar.sc} exists in the mappings, it will not be used). This
+behavior could be made smarter if there is a demand for it.
+
 \subsection{\cs{pdfincludechars}}
 \pdftexprimitive{\Syntax{\cs{pdfincludechars} \Something{font}
   \Something{general text} \Whatever{expandable}}}
@@ -2454,23 +2460,29 @@
 While working with bitmap graphics or typesetting electronic documents,
 it might be convenient to base dimensions on pixels rather than \TeX's
 standard units like \type{pt} or \type{em}. For this purpose, \PDFTEX\
-provides an extra unit called \type{px} that takes the dimension given to
-the \cs{pdfpxdimen} primitive. In example, to make the unit \type{px}
+provides an extra unit named \type{px} that takes the dimension given to
+the \cs{pdfpxdimen} primitive. For example, to make the unit \type{px}
 corresponding to 96dpi pixel density (then $\mbox{1px}=72/96$bp), one
 can do the following calculation:
 
 \begin{verbatim}
-\pdfpxdimen=1in % 1 dpi
+\pdfpxdimen=1in          % 1 dpi
 \divide\pdfpxdimen by 96 % 96 dpi
 \hsize=1200px
 \end{verbatim}
 
 Then \cs{hsize} amounts to 1200~pixels in 96dpi, which is exactly
-903.375pt (but \TeX\ rounds it to 903.36914pt). The default value of
-\cs{pdfpxdimen} is 1bp, corresponding to a pixel density of 72dpi. This
-primitive is completely independent from the \cs{pdfimageresolution} and
-\cs{pdfpkresolution} parameters.
+903.375pt, which \TeX\ rounds to 903.36914pt.
 
+The default value of \cs{pdfpxdimen} is 1.00001bp (for historical
+reasons), corresponding to a pixel density of (a few sp off from) 72dpi.
+The \LUATEX\ default is 1bp (also a few sp off from 72dpi), so to get
+precisely the same behavior in \PDFTEX\ and \LUATEX, set
+\cs{pdfpxdimen}\texttt{=1bp}.
+
+This primitive is completely independent of the
+\cs{pdfimageresolution} and \cs{pdfpkresolution} parameters.
+
 \introduced{1.30.0} It used to be an integer register that gave the
 dimension 1px as number of scaled points, defaulting to 65536 (1px equal
 to $\mbox{65536sp}=1$pt). Starting with \PDFTEX\ 1.40.0, \cs{pdfpxdimen}



More information about the pdftex-commits mailing list.