diff options
Diffstat (limited to 'doc/context/sources/general/manuals/luatex/luatex-modifications.tex')
-rw-r--r-- | doc/context/sources/general/manuals/luatex/luatex-modifications.tex | 259 |
1 files changed, 254 insertions, 5 deletions
diff --git a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex index 28431fe29..5b35f3ec1 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex @@ -217,6 +217,12 @@ which in turn triggered renaming primitives. \stopitem \startitem + When \type {\adjustspacing} has value~2, hz optimization will be applied to + glyphs and kerns. When the valus is~3, only glyphs will be treated. A value + smaller than~2 disables this feature. +\stopitem + +\startitem The \type {\tagcode} primitive is promoted to core primitive. \stopitem @@ -230,6 +236,10 @@ which in turn triggered renaming primitives. \stopitem \startitem + The \type {\pdfcopyfont} primitive is now \type {\copyfont}. +\stopitem + +\startitem The \type {\pdffontexpand} primitive is now \type {\expandglyphsinfont}. \stopitem @@ -255,6 +265,21 @@ which in turn triggered renaming primitives. determine these properties or use the built|-|in \type {img} library. \stopitem +\startitem + The initializers \type {\pdfoutput} has been replaced by \type {\outputmode} and + \type {\pdfdraftmode} is now \type {\draftmode}. +\stopitem + +\startitem + The pixel multiplier dimension \type {\pdfpxdimen} lots its prefix and is now calles + \type {\pxdimen}. +\stopitem + +\startitem + An extra \type {\pdfimageaddfilename} option has been added that can be used to block + writing the filename to the \PDF\ file. +\stopitem + \stopitemize One change involves the so called xforms and ximages. In \PDFTEX\ these are @@ -332,7 +357,7 @@ we say next applies to both these programs. \stopitem \startitem - Several bugs hav ebeen fixed. The \type {\hoffset} bug when \type {\pagedir TRT} + Several bugs have been fixed. The \type {\hoffset} bug when \type {\pagedir TRT} is gone, removing the need for an explicit fix to \type {\hoffset}. Also bug causing \type {\fam} to fail for family numbers above 15 is fixed. A fair amount of other minor bugs are fixed as well, most of these related to \type @@ -360,13 +385,14 @@ we say next applies to both these programs. \stopitem \startitem - The page dimension related primitives \type {\pagewidth} and \type {\pageheight} have - been promoted to core primitives. + The page dimension related primitives \type {\pagewidth} and \type + {\pageheight} have been promoted to core primitives. \stopitem \startitem - The primitives \type {\charwd}, \type {\charht}, \type {\chardp} and \type {\charit} - have been removes as we have the \ETEX\ variants \type {\fontchar*}. + The primitives \type {\charwd}, \type {\charht}, \type {\chardp} and \type + {\charit} have been removes as we have the \ETEX\ variants \type + {\fontchar*}. \stopitem \startitem @@ -381,6 +407,15 @@ we say next applies to both these programs. \stopitem \startitem + The primitive \type {\pdftracingfonts} is now \type {\tracingfonts} as it + doesn't relate to the backend. +\stopitem + +\startitem + The experimental primitive \type {\pdfinsertht} is kept as \type {\insertht}. +\stopitem + +\startitem The promotion of primitives to core primitives as well as the removed of all others mean that the initialization namespace \type {aleph} is gone. \stopitem @@ -432,6 +467,220 @@ different: \stopsubsection +\startsubsection[title=The backend primitives \type {\pdf*}] + +In a previous section we mentioned that some \PDFTEX\ primitives were removed and +others promoted to core \LUATEX\ primitives. That is only part of the story. In +order to separate the backend specific primitives in de code these commands are +now replaced by only a few. In traditional \TEX\ we only had the \DVI\ backend +but now we have two: \DVI\ and \PDF. Additional functionality is implemented as +\quote {extensions} in \TEX speak. By seperating more strickly we are able to +keep the core (fontend) clean and stable. If for some reason an extra backend +option is needed, it can be implemented without touching the core. The three +\PDF\ backend related primitives are + +\starttyping +\pdfextension command [specification] +\pdfvariable name +\pdffeedback name +\stoptyping + +An extension triggers further parsing, depending on the command given. A variable is +a (kind of) register and can be read and written, while a feedback is reporting +something (as it comes from the backend it's normally a sequence of tokens). + +In order for \LUATEX\ to be more than just \TEX\ you need to enable primitives. That +has already be the case right from the start. If you want the traditional \PDFTEX\ +primitives (for as far their functionality is still around) you now can do this: + +\starttyping +\protected\def\pdfliteral {\pdfextension literal} +\protected\def\pdfcolorstack {\pdfextension colorstack} +\protected\def\pdfsetmatrix {\pdfextension setmatrix} +\protected\def\pdfsave {\pdfextension save\relax} +\protected\def\pdfrestore {\pdfextension restore\relax} +\protected\def\pdfobj {\pdfextension obj } +\protected\def\pdfrefobj {\pdfextension refobj } +\protected\def\pdfannot {\pdfextension annot } +\protected\def\pdfstartlink {\pdfextension startlink } +\protected\def\pdfendlink {\pdfextension endlink\relax} +\protected\def\pdfoutline {\pdfextension outline } +\protected\def\pdfdest {\pdfextension dest } +\protected\def\pdfthread {\pdfextension thread } +\protected\def\pdfstartthread {\pdfextension startthread } +\protected\def\pdfendthread {\pdfextension endthread\relax} +\protected\def\pdfinfo {\pdfextension info } +\protected\def\pdfcatalog {\pdfextension catalog } +\protected\def\pdfnames {\pdfextension names } +\protected\def\pdfincludechars {\pdfextension includechars } +\protected\def\pdffontattr {\pdfextension fontattr } +\protected\def\pdfmapfile {\pdfextension mapfile } +\protected\def\pdfmapline {\pdfextension mapline } +\protected\def\pdftrailer {\pdfextension trailer } +\protected\def\pdfglyphtounicode{\pdfextension glyphtounicode } +\stoptyping + +The introspective primitives can bve defines as: + +\starttyping +\def\pdftexversion {\numexpr\pdffeedback version} +\def\pdftexrevision {\pdffeedback revision} +\def\pdflastlink {\numexpr\pdffeedback lastlink} +\def\pdfretval {\numexpr\pdffeedback retval} +\def\pdflastobj {\numexpr\pdffeedback lastobj} +\def\pdflastannot {\numexpr\pdffeedback lastannot} +\def\pdfxformname {\numexpr\pdffeedback xformname} +\def\pdfcreationdate {\pdffeedback creationdate} +\def\pdffontname {\numexpr\pdffeedback fontname} +\def\pdffontobjnum {\numexpr\pdffeedback fontobjnum} +\def\pdffontsize {\dimexpr\pdffeedback fontsize} +\def\pdfpageref {\numexpr\pdffeedback pageref} +\def\pdfcolorstackinit {\pdffeedback colorstackinit} +\stoptyping + +The configuration related registers have become: + +\starttyping +\edef\pdfcompresslevel {\pdfvariable compresslevel} +\edef\pdfobjcompresslevel {\pdfvariable objcompresslevel} +\edef\pdfdecimaldigits {\pdfvariable decimaldigits} +\edef\pdfgamma {\pdfvariable gamma} +\edef\pdfimageresolution {\pdfvariable imageresolution} +\edef\pdfimageapplygamma {\pdfvariable imageapplygamma} +\edef\pdfimagegamma {\pdfvariable imagegamma} +\edef\pdfimagehicolor {\pdfvariable imagehicolor} +\edef\pdfimageaddfilename {\pdfvariable imageaddfilename} +\edef\pdfpkresolution {\pdfvariable pkresolution} +\edef\pdfinclusioncopyfonts {\pdfvariable inclusioncopyfonts} +\edef\pdfinclusionerrorlevel {\pdfvariable inclusionerrorlevel} +\edef\pdfreplacefont {\pdfvariable replacefont} +\edef\pdfgentounicode {\pdfvariable gentounicode} +\edef\pdfpagebox {\pdfvariable pagebox} +\edef\pdfminorversion {\pdfvariable minorversion} +\edef\pdfuniqueresname {\pdfvariable uniqueresname} + +\edef\pdfhorigin {\pdfvariable horigin} +\edef\pdfvorigin {\pdfvariable vorigin} +\edef\pdflinkmargin {\pdfvariable linkmargin} +\edef\pdfdestmargin {\pdfvariable destmargin} +\edef\pdfthreadmargin {\pdfvariable threadmargin} + +\edef\pdfpagesattr {\pdfvariable pagesattr} +\edef\pdfpageattr {\pdfvariable pageattr} +\edef\pdfpageresources {\pdfvariable pageresources} +\edef\pdfxformattr {\pdfvariable xformattr} +\edef\pdfxformresources {\pdfvariable xformresources} +\edef\pdfpkmode {\pdfvariable pkmode} +\stoptyping + +The variables are internal ones, so they are anonymous. When you ask for the +meaning of a few previously defined ones: + +\starttyping +\meaning\pdfhorigin +\meaning\pdfcompresslevel +\meaning\pdfpageattr +\stoptyping + +you will get: + +\starttyping +macro:->[internal backend dimension] +macro:->[internal backend integer] +macro:->[internal backend tokenlist] +\stoptyping + +The \type {\edef} can also be an \type {\def} but it's a bit more efficient +to expand the lookup related register beforehand. After that you can adapt +the defaults; these are: + +\starttyping +\pdfcompresslevel 9 +\pdfobjcompresslevel 1 +\pdfdecimaldigits 3 +\pdfgamma 1000 +\pdfimageresolution 71 +\pdfimageapplygamma 0 +\pdfimagegamma 2200 +\pdfimagehicolor 1 +\pdfimageaddfilename 1 +\pdfpkresolution 72 +\pdfinclusioncopyfonts 0 +\pdfinclusionerrorlevel 0 +\pdfreplacefont 0 +\pdfgentounicode 0 +\pdfpagebox 0 +\pdfminorversion 4 +\pdfuniqueresname 0 + +\pdfhorigin 1in +\pdfvorigin 1in +\pdflinkmargin 0pt +\pdfdestmargin 0pt +\pdfthreadmargin 0pt +\stoptyping + +If you also want some backward compatibility, you can add: + +\starttyping +\let\pdfpagewidth \pagewidth +\let\pdfpageheight \pageheight + +\let\pdfadjustspacing \adjustspacing +\let\pdfprotrudechars \protrudechars +\let\pdfnoligatures \ignoreligaturesinfont +\let\pdffontexpand \expandglyphsinfont +\let\pdfcopyfont \copyfont + +\let\pdfxform \saveboxresource +\let\pdflastxform \lastsavedboxresourceindex +\let\pdfrefxform \useboxresource + +\let\pdfximage \saveimageresource +\let\pdflastximage \lastsavedimageresourceindex +\let\pdflastximagepages\lastsavedimageresourcepages +\let\pdfrefximage \useimageresource + +\let\pdfsavepos \savepos +\let\pdflastxpos \lastxpos +\let\pdflastypos \lastypos + +\let\pdfoutput \outputmode +\let\pdfdraftmode \draftmode + +\let\pdfpxdimen \pxdimen + +\let\pdfinsertht \insertht + +\let\pdfnormaldeviate \normaldeviate +\let\pdfuniformdeviate \uniformdeviate +\let\pdfsetrandomseed \setrandomseed +\let\pdfrandomseed \randomseed + +\let\pdfprimitive \primitive +\let\ifpdfprimitive \ifprimitive + +\let\ifpdfabsnum \ifabsnum +\let\ifpdfabsdim \ifabsdim +\stoptyping + +And even: + +\starttyping +\newdimen\pdfeachlineheight +\newdimen\pdfeachlinedepth +\newdimen\pdflastlinedepth +\newdimen\pdffirstlineheight +\newdimen\pdfignoreddimen +\stoptyping + +The backend is derived from \PDFTEX\ so the same syntax applies. However, the +\type {outline} command accepts a \type {objnum} followed by a number. No +checking takes place so when this is used it had better be a valid (flushed) +object. + +\stopsubsection + \stopsection \startsection[title=Implementation notes] |