10.07.2015 Views

The microtype package

The microtype package

The microtype package

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IMPLEMENTATION: Font setup 61\MT@scale@to@em\MT@get@charwd1170 \MT@ifempty\@tempb\relax{%1171 \MT@scale@to@em1172 \lpcode\MT@font\MT@char=\MT@the@pr@code1173 \MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char\space: [#1]}%1174 }%1175 \def\@tempb{#2}%1176 \MT@ifempty\@tempb\relax{%1177 \MT@scale@to@em1178 \rpcode\MT@font\MT@char=\MT@the@pr@code1179 \MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char\space: [#2]}%1180 }%Now we can set the values for the inheriting characters. <strong>The</strong>ir slot numbers aresaved in the macro \MT@inh@〈list name〉@〈slot number〉@.1181 \MT@ifdefined@c@T\MT@pr@inh@name{%1182 \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@char @}{%1183 \MT@exp@cs\MT@map@tlist@c1184 {MT@inh@\MT@pr@inh@name @\MT@char @}%1185 \MT@set@pr@heirs1186 }%1187 }%1188 }Since pdfTEX version 0.14h, we have to adjust the protrusion factors (i.e., convertnumbers from thousandths of character width to thousandths of an em of the font).We have to do this before setting the inheriting characters, so that the latter inheritthe absolute value, not the relative one if they have a differing width (e.g., the ‘ff’ligature). Unlike protcode.tex and pdfcprot, we do not calculate with \lpcoderesp. \rpcode, since this would disallow protrusion factors larger than the characterwidth (since \[lr]pcode’s limit is 1000). Now, the maximum protrusion is 1em ofthe font.<strong>The</strong> unit is in \MT@count, the desired factor in \@tempb, and the result will bereturned in \@tempcntb.1189 \MT@requires@pdftex3{1190 \def\MT@scale@to@em{%1191 \@tempcntb=\MT@count\relaxFor really huge fonts (100 pt or so), an arithmetic overflow could occur with vanillaTEX. Using e-TEX, this can’t happen, since the intermediate value is 64 bit, whichcould only be reached with a character width larger than \maxdimen.1192 \MT@scale\@tempcntb \@tempb \MT@dimen@six1193 \ifnum\@tempcntb=\z@ \else1194 \MT@scale@factor1195 \fi1196 }Get the width of the character. When using e-TEX, we can employ \fontcharwdinstead of building scratch boxes.1197 \def\MT@get@charwd{%1198 1199 ^^X \MT@count=\fontcharwd\MT@font\MT@char\relax1200 ^^Q \setbox\z@=\hbox{\MT@font \char\MT@char}%1201 ^^Q \MT@count=\wd\z@1202 1203 \MT@count=\fontcharwd\MT@font\MT@char\relax\MT@char contains a slot number (legacy fonts), a Unicode number, or a glyph name(if \MT@char@ is negative).1204 1205 \ifnum\MT@char@

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!