[pdftex] Han The Thanh's thesis on microtypography
Guy Worthington
guyw at multiline.com.au
Sun Jun 1 17:13:37 CEST 2003
Carsten Schurig wrote:
> As far as I read thanh's thesis, the protcodes given there are for
> palatino (at least some of the examples are; for font expansion
> also)! So you could use them right away...
Below are protruding codes adjusted mechanically by a method I
described a couple of days ago (see thread "character protruding
with palatino"). Compare them with Thanh's protcode.tex, on the
test file supplied.
%--pplprotcode.tex---------------------------------
\def\setprotcode#1{%
\rpcode#1`\!=199
\rpcode#1`\,=777
\rpcode#1`\=700
\rpcode#1`\.=777
\rpcode#1`\;=555
\rpcode#1`\:=555
\rpcode#1`\?=212
\lpcode#1`\`=699
\rpcode#1`\'=699
\lpcode#1 92=412 % ``
\rpcode#1 34=673 % ''
\rpcode#1 123=450 % --
\rpcode#1 124=330 % ---
\rpcode#1`\)=58
\rpcode#1`\A=48
\rpcode#1`\F=58
\rpcode#1`\K=53
\rpcode#1`\L=51
\rpcode#1`\T=58
\rpcode#1`\V=51
\rpcode#1`\W=51
\rpcode#1`\X=56
\rpcode#1`\Y=56
\rpcode#1`\k=47
\rpcode#1`\r=49
\rpcode#1`\t=59
\rpcode#1`\v=46
\rpcode#1`\w=43
\rpcode#1`\x=51
\rpcode#1`\y=47
\lpcode#1`\(=58
\lpcode#1`\A=48
\lpcode#1`\J=77
\lpcode#1`\T=58
\lpcode#1`\V=51
\lpcode#1`\W=51
\lpcode#1`\X=56
\lpcode#1`\Y=56
\lpcode#1`\v=46
\lpcode#1`\w=43
\lpcode#1`\x=51
\lpcode#1`\y=47
\adjustprotcode#1
}
\makeatletter
\newif\ifneedadjustprotcode
\def\adjustprotcode#1{%
\needadjustprotcodefalse
\ifnum\pdftexversion > 13
\ifnum \expandafter`\pdftexrevision > `g
\needadjustprotcodetrue
\fi
\else\ifnum\pdftexversion > 14
\needadjustprotcodetrue
\fi\fi
\ifneedadjustprotcode
\@tempcnta=0
\loop
\ifcase\lpcode#1\@tempcnta\else
\adjustcp\lpcode#1\@tempcnta
\fi
\ifcase\rpcode#1\@tempcnta\else
\adjustcp\rpcode#1\@tempcnta
\fi
\advance\@tempcnta 1
\ifnum\@tempcnta < 256 \repeat
\fi
}
\def\adjustcp#1#2#3{%
\setbox0=\hbox{%
\ifx#2\font\else#2\fi
\char#3}%
\@tempcntb=\wd0
\mul\@tempcntb #1#2#3%
\div\@tempcntb \fontdimen6 #2%
#1#2#3=\@tempcntb
}
\makeatother
%--------------------------------------------------
Test file:
%--------------------------------------------------
% This was compiled using pdfetex 1.00a pretest
%
\input pplprotcode% protcode available at CTAN
\font\bodyfont = pplr at 10pt
\font\italicfont = pplri at 10pt
\def\emph#1{{\italicfont#1}}
\hsize=333pt% This number is 2.5 times the width of one alphabet
% using pplr at 10pt
\parindent=24pt
\bodyfont
\setprotcode\font
\pdfprotrudechars=2
In Section 19, you learned how to use abstract classes to impose
method definition requirements on subclasses. In this section, you
learn how to use Java's \emph{interface mechanism} to establish
method definition requirements on a class without relying on
inheritance from an abstract class.
A principle of good programming practice is that you should think
about what your programs should do before you proceed to write
them. Establishing requirements forces you to think about what you want
your programs to do; thus liberal use of Java's interface mechanism is
good practice.
In this section, you also learn that Java's interface mechanism help
teams of programmers to work together effectively, and you learn that
interfaces offer splendid locations for program documentation.
Thus, Java's interface mechanism, reflectively used, can make you a
much better programmer.
\bye
%--------------------------------------------------
I probably stared at the test file too much, because I can see a
significant improvement when using pplprotcode.tex, and yet the
characters have been adjusted 50 thou of an em (or less). I am now
considering that what Hans and Thierry said is correct---the
protruding needs to be adjusted for every font, because characters
are certainly going to vary by more than 50 thou of an em.
At the moment, I'm trying to characterize the puctuation in palantino
font according to height, width, area of covered by the dark strokes,
and aspect ratio of the darkest stroke, if there are any other metrics
that I can easily calculate, please tell me, and I'll try to calculate
them as well.
More information about the pdftex
mailing list