<<

Fo tn Hand gnil ni rT o With PostS irc pt D ve ices

FONT HAND IL NG IN TROFF WITH POSTSCR PI T DEVICES

GIAA4F R

op /qs/ou

a

Heirloom Docume tn ation Tools T eh bas sic

Heirloom rt o understands two ways ot select PostS irc pt fo .stn The cu tnerr method can access PostS irc pt fo tn les erid ct .ly Fo stn are select de usi gn an ex et nded .f‘‘ ’’p qer uest. As simple examples,

.fp 0 AG gdrg____ pfb t.f AG H ere is some tex nit Adobe Garamond Regular.

ro

.fp 0 AG AGaramondP R-or egular otf t.f AG H ere is some tex nit Adobe Garamond orP Regular.

B tu it is also possible ot have die tner names for the metrics and data les, as ni

.fp 0 AM myk gninre .afm gdrg____.pfb t.f AM This text nistnirp Adobe Garamond usi gn modified .gninrek

The defau tl highe r-r esol tu ion ‘‘ps’’ PostS irc pt device always uses AFM les; it us pp stro the co tnevn ional .f‘‘ ’’p qer uest for backwards compatibil- ity ot select rp tsnie- alled fo stn from the PDF base set. With fo stn select de yb ht is metho ,d localized ni put orp cessi gn is -rep formed acco gnidr ot the LC_CTYPE orivne nme tn variable, ro acco gnidr ot a docume -stn ep cic value set yb the ‘‘.lc_ctype’’ qer ues :t

.\" Enable lo gn qer uest names. .do fx lag 3 .\" de_DE 8ftu. is for GNU lib ;c de_DE.UTF-8 w skro elsewhe e.r .lc_ctype de_DE 8ftu. Deutscher Text mit ‹A üfn urh gn szeichen› .sp The rsif ft ive sm lal let et rs of the G er ek alphabet: α β γ δ ε

Note ht at any use of AFM, Op ne Type, ro rT ueType les qer riu es ht at the output of rt o is passed ot the exactly match gni ev rsion of dpo t,s i.e. ot the one ht at was deliv dere with the same release of ht is package. eS nd- gni such rt o output erid ctly ot a tnirp ps ooler ht at vni okes a sys et m -rev sion of dpo ts w htlil su usu ally not w .kro The h rotis ical method qer riu es fo tn tables ot eb eg nerat de manual tI.ly is lilts us pp ,detro and is lilts the defau tl for the low r-re esol tu ion p‘‘ os ’’t PostS irc pt device, but it is not er commended anymo er ht at it is used for add gni fo .stn L co alized ni put orp cessi gn acco gnidr ot LC_CTYPE is not available with ht is metho .d

Installing StsoP cri tp yT pe  stnof

Mak gni additional fo stn available is easy with the cu tnerr metho .d fI you buy a PostS irc pt Type p fo tn for use with rt o, select the Windows ev rsio .n You w lil get a set of les from the ev ndo .r Only two of them are of retni est for rt o:

xxxxxxxx .afm This is the metrics le. rt o accesses it ot learn the wid sht of char- acters ni the .

.xxxxxxxx pfb This le co tn ai sn the actual glyph data. rt o does not really ne de ht is le, but the retnirp ro PDF co retrevn do nI.es many cases, it is most co nevn ie ottn include the data erid ctly otni the .ps le -neg erat ,de as ni the examples above.

Create a erid ct yro ot hold your fo .stn F ro compatibility with erutuf ev rsio sn of rt o, it is er commended ht at it is put outside the rt o hie -r archy /u rs /ucblib/doctools; somet gnih below /u rs /local may eb a og od q choice. F ro each fo tn you want ot tsni ,lal co yp ro nil k both the AFM and the PFB le otni the erid ct .yro Set the TROFFONTS orivne -n me tn variable ot ht is erid ct ;yro if you have m itlu ple fo tn erid ct ro ies, you can separate them ni TROFFONTS yb colons, tsuj as ni the PATH variable for the shel ,l e.g. ‘‘TROFFONTS=/u rs /local/share/fo s:tn /u /rs share/fo stn exp tro TROFFONTS .’’ W itr e the denition ni your rp.‘‘ ole’’ ro a similar ts ar ut p le ot make it rep manent. You can now use the fo stn with rt o. fI you want ot tsni lal mo er fo stn lat ,re it is us cie tn ot put them otni the fo tn erid ct .yro

Installing Open yT pe ro rT ue yT pe stnof

The orp ced eru for Op ne Type and rT ueType fo stn is nearly the same as for Type p fo s,tn except ht at the er is only one le ‘‘Fo tn Name.ot ’’f ro( ‘‘Fo tn Name. ftt ’’) with them ht at co tn ai sn both metrics and glyph data. tsuJ co yp ht is le ot a erid ct yro giv ne ni the TROFFONTS pat .h

sU ing Open yT pe ef at seru

Hig q-h uality Op ne Type fo stn may co tn ain feat eru tables ht at allow ps e- cial typ go raphic eect .s F ro example, the Adobe Garamond orP Regular fo tn co tn ai gnilittsn capitals ht at can eb map dep ot the ni put ran eg of reg- ular capitals with the ‘‘.feat ru e’’ qer ues nit rt o:

.do fx lag 3 .fp 1 R AGaramondP R-or egular otf .fp 0 T AGaramondP R-or egular otf .feat eru T +t lit REGULAR CAPITALS .sp t.f T TITLING CAPITALS

r To retrie ev tisla of feat ru es ni an individual fo httn at are available with rt o, use ‘‘otfdump −s font.ot .’’f Typical usef lu feat ru es ar :e

+c2sc co strevn capitals ot sm lal capitals +case subs itt tu io sn for use ni combination with tex nit c-lal apital let et rs +onum old t-s yle nume rals +pnum orp p tro ional )gninil( numerals +pnum +onum orp p tro ional old t-s yle numerals +smcp co strevn low c-re ase let et rs ot sm lal capitals +smcp +c2sc co strevn lal let et rs ot sm lal capitals +tlit gnilitt characte rs +zeor slashed ze or

Feat ru es such as ‘‘aal ’’t ro nro‘‘ m’’ which only map sets of yrev eps cial characters ot die tner positio sn are normally not usef lu with rt o since these characters can eb accessed erid ctly usi gn ‘‘\[name]’’ escape sequences anyway. To make an individual al nret ate charact tre he defau t,l the ’’rt.f‘‘ re- quest can eb use :d

.do fx lag 3 .fp 2 I AGaramondP tI-or alic otf rt.f I Q\[Q.] t.f I sUing a ws ash capital in eht wo dr ‘‘ }uali ’’y.t

Feat eru mappi sgn res nitlu changes ot the same nretni al data rts uct ru es as the ’’rt.f‘‘ qer uest. tI is ht su possible ot make adj tsu me stn ot mappi sgn yb usi gn ’’rt.f‘‘ a re ‘‘.feat ru ,e’’ ro ot rc eate ep rsonalized varian st yb usi gn ’’rt.f‘‘ based on the data obtained from ‘‘otfdump −s .’’ The ‘‘.feat ru e’’ qer uest m liltstsu eb active for a fo tn when a charact re is ;detnirp disabl gni a feat eru with ‘‘.feat eru F −feat’’ only w skro complete- ly if lal of sit mappi sgn are nililts positio tI.n is ht su er commended ht at the ‘‘.feat ru e’’ qer uest is used only once for a fo itn mmediately a re it has neeb mou ,detn and ht at a fo tn is mou detn m itlu ple it mes, each it me for s ne abl gni an individual feat eru set. Doi gn so has the additional advantage ht at switch gni betw nee feat ru es is co nevn ie tn ly possible usi gn the ‘‘\f ’’ es- cape sequence.

sU ing stnof wi ht old-s elyt num re als

A Type p fo tn with old t-s yle numerals but otherwise ts andard characters usu ally does not qer eriu any eps cial mechanism tI. can simply eb mou -tn ,de select ,de and use .d Old t-s yle numerals co tn ained ni Op ne Type fo stn can eb accessed co vn e- nie tn ly yb mappi gn them ot the ts andard ASC II numbers with the ‘‘.fea- rut e’’ qer ues :t

.do fx lag 3 .fp 1 R AGaramondP R-or egular otf .feat eru R +onum The numerals o p q r s t u v w x are ni old t-s yle.

sU ing stnof wi ht small capital srettel

Sm clal apital fo stn normally ne de let ret space track .gni Th su e.g ot. use the Adobe Garamond sm lal capital font, w itr e somet gnih like

.do fx lag 3 .fp 0 SC gdsc____ pfb t. rack SC 1 .2 24 2 t.f SC T;

With an Op ne Type font, the ‘‘.feat ru e’’ qer uest is usef lu agai :n

.do fx lag 3 .fp 0 SC AGaramondP R-or egular otf

t .feat eru SC +smcp t. rack SC 1 .3 24 3 t.f SC T;

sU ing a oc mbination of xe pert and ts andard rofstnof small capitals

A Type p ex trep fo tn co tn ai sn sm lal capital let et rs but no up c-rep ase capital let et .rs Since it would eb yrev inco nevn ie tn ot chan eg the fo tn ex- plicitly for each up c-rep ase let t,ret he lalf back sequence is usef nilu ht is case. The ex trep fo tn is select de as text font, but for each up c-rep ase let- ret encou ,deretn rt o changes au ot matically ot the ts andard fo :tn

.do fx lag 3 .fp 1 R gdrg____ pfb .fp 0 E eg rg____ pfb t. rack E 1 .2 24 2 .f lal back E R t.f E T;

F ro Op ne Type fo s,tn lal sm lal capital let et rs are co tn ained wit nih the base font, and the s‘‘ mc ’’p feat eru accesses them as shown above.

sU ing a oc mbination of xe pert and ts andard rofstnof old-s elyt num re als

This also uses the lalf back sequence, but since the ts andard numerals are rp ese nitn the ts andard font, they have ot eb hidden rst so ht at rt o does not select them:

.do fx lag 3 .fp 1 R gdrg____ pfb .fp 0 E eg rg____ pfb u .f lal back R E .hidechar R 0123456789 The numerals o p q r s t u v w x are ni old t-s yle.

sU ing eht xe pert roftnof both small capitals and old-s elyt num re als

The examples above can also eb combine .d Since the t.‘‘ rack’’ qer uest does not aect the track gni of fo stn ht at are select de yb the lalf back se- quence, it is us cie tn ot mou tn each fo tn once:

.do fx lag 3 .fp 1 R gdrg____ pfb .fp 0 E eg rg____ pfb .f lal back R E .f lal back E R t. rack E 1 .2 24 2 .hidechar R 0123456789 The numerals o p q r s t u v w x are ni old t-s yle. .br t.f E BIH H;

sU ing eht xe pert roftnof ligat seru

PostS irc pt Type p fo stn usu ally do not co tn ain igl at ru es for , , and  ni the base fo ;tn an ex trep fo tn delivers them ni additio .n A otu matic sub- itts tu ion of such igl at ru es can eb ne abled usi gn the igl.f‘‘ ’’ qer ues nit com- bination with the lalf back sequence:

.do fx lag 3 .fp 1 R gdrg____ pfb .fp 0 E eg rg____ pfb .f lal back R E

v igl.f R ff \(ff iff \( iF lff \( lF eective oce oine

Op ne Type fo stn co tn ain lal available igl at ru es ni the base font, so no eps cial orp ced eru needs ot eb applied with them.

Dening add ti ional ligat seru

Fo stn may rp ovide igl at ru es eb yond the ve ts andard rt o ones. They are not activat de yb defau tl regardless of any denitio nisn the fo tn met- rics les, but can eb ne abled individually as desi ;der rt o w tlil hen er place sequences of characters au ot matically with them as with the ts andard igl - at ru .es F ro example, Adobe Garamond erP mier orP co tn ai iglsn at ru es for use with the h rotis ic ‘‘ſ ’’ let ret varian :t

.do fx lag 3 .fp 1 R GaramondP er m orPr otf igl.f R ſſ \[lo gn s_lo gn s] ſi \[lo gn s_i] ſſ i \[lo gn s_lo gn s_i] Uſe theſe igl at ru es for cla%c typ go raph .y

rt o spl iglsit at ru es ni two par st when hyphenat gni w ro ds tI. is ht su nec- essary ht at any part of a igl at eru ht at is not a si gn le charact re is also de- ned as a igl at e,ru so ‘‘$ ’’ and ‘‘!’’ are qererp uisites for ‘‘% .’’ tI is normally not advisable ot ne able igl at ru es with ecial display forms usi gn the igl.f‘‘ ’’ mechanism t; hey should eb set manually as eps cial char- acters (‘‘\[s_p]’’ ni ht is case) at erp cise locatio .sn

C sooh ing betwe ne mu elpitl po elbiss ligat seru

afI fo tn co tn ai sn only tw -o charact iglre at ru es, the er are two possibilities for au ot matic igl at eru build gni with an ni put sequence ht at would form a erht e-charact iglre at e,ru e.g., ff‘‘ i’’ could eb co rtsn uct de as ‘‘i’’ ro ‘‘f’’. rt o normally selects the rs iglt at eru available, so ‘‘i’’ would eb the de- w fau t.l nI many cases, the other choice would eb aesthetically rp eferable; ht is is the application for the ‘‘.fdefe iglr ’’ qer ues :t

.do fx lag 3 .fp 1 R GaramondP er m orPr otf igl.f R ſſ \[lo gn s_lo gn s] ſi \[lo gn s_i] .fdefe iglr R ſſ i Choo! gn the ſecond igl at eru looks poſ!bly bet .ret

Combining stnoftnereid

Die tner fo stn o ne have die tner visual sizes neve if they are set ni the same nom ni al poi tn size. Also fo stn from die tner ev ndors are o ne based on die tner ts andards for charact re heig .sth To adj tsu ht is, the .f‘‘ zoom’’ qer uest is available. As implied yb ht is purpose, it only applies ot charac- et rs ht at are actually ni the cu tnerr font, not ot characters from another fo tn ht at have neeb select de usi gn the lalf back sequence.

.do fx lag 3 .fp 1 R AGaramondP R-or egular otf .fp 0 GI GillSansS dt otf .fzoom GI .94 \f(GIGill Sans\fR m tsu eb adj detsu ot itf with Adobe Garamond.

The .f‘‘ zoom’’ qer uest aects lal characters set ni the res ep ctive fo tn on the cu tnerr outpu ilt ne. To rc eate si gn le zoomed w ro ds, mou tn a fo tn twice under die tner names, but zoom it only once.

Spacing out individual words

Spaci gn out the characters of individual w ro ds is commonly done for hig iglh gnith text e.g. with G re man blacklet ret faces t; he t.‘‘ rack’’ qer uest can eb used for ht is as w .lel Like .f‘‘ zoom ,’’ t.‘‘ rack’’ applies ot lal charac-

x et rs ni the res ep ctive fo tn on an eritne outpu ilt ne. Th su it is also neces- sary ot mou tn a fo tn twice but ot track it only once when it is used for track gni individual w ro ds.

tteS ing txet in all-capital srettel

When set gnit tex nit c-lal apital let et rs, it is normally necessary ot zoom the fo tn ot a smaller size ht an ht at of the low c-re ase text rrus ound gni it, and ot track it as w .lel Mou gnitn the regular fo tn a second it me is the most co nevn ie tn way ot handle ht :is

.do fx lag 3 .fp 1 R gdrg____ pfb .fp 0 XC gdrg____ pfb t. rack XC 1 .2 24 2 .fzoom XC .9 Regular text and \f(XCALL-CAPITAL TEXT\fP which ends.

Pairwise ek rning

Pairwise gninrek is ne abled unless the −x0option is giv .ne The ‘‘.k ’’nre qer uest disables it. K gninre tables ar nie itially read from the AFM, Op -ne Type, ro rT ueType les ht; is defau tl gninrek only applies if two adjace tn characters are from the same font. A fo -stn ep cic gninrek table can eb dis- abled usi gn the .f‘‘ ’’nrek qer uest. The er are two methods ot adj tsu the gninrek tables: nI some cases, it is most co nevn ie tn ot rc eate a rp ivate co yp of the AFM le and ot adj tsu the ‘‘KPX’’ rtne ies ni it. This has the advantage ht at the modied gninrek pairs are immediately available for use ni other docume .stn F ro Op ne Type ro rT ueType fo s,tn ro for cases whe er ht is is not us itable with Type p fo s,tn ro not possible ceb ause the characters ni the gninrek pair ro niig ate from die tner fo s,tn rt o rp ovides the ‘‘.k nre pai ’’r qer ues :t

op .do fx lag 3 .fp 1 R gdrg____ pfb .fp 0 E eg rg____ pfb .f lal back R E .hidechar R 0123456789 .k nre pair E 0 R / 50 .k nre pair R / E 1 −90 .k nre pair E 1 R / 40 .k nre pair R / E 2 −80 o/p/q

nI ht is example, old t-s yle numerals from Adobe Garamond Ex trep are mix de with the charact re from Adobe Garamond Regular, and are adj detsu ot achie ev match gni visual let ret spaci .gn

Kerning of a hc aract re in any oc mbination

tI is sometimes usef otlu add a ce tr ain amou tn of space whene rev a char- act re appears, for example befo er ‘‘;’’ ro ‘‘ ,?’’ ro on the ni ner sides of ug ille- mots ni erF nch S/ w sis ts yle. The ‘‘.k nre af ’’ret and ‘‘.k re nbefore’’ qer ues st are usef lu for ht :is

.do fx lag 3 .k nre af ret R ; 66 ? 66

fI the characters aect de yb these qer ues st are also memb re of a reg -u lar gninrek pai t,r he res gnitlu added space is the us m of both denitio .sn These qer ues st are applied at the same places as gninrek pairs, i.e. they have no eect if follo gniw ro erp ce gnid a motion command, ‘‘\&’’ ilro ne , and they are additionally res rt ict de ot have no eect if the other charact re is a space.

pp Hanging hc aract sre

Since the er are no tables for han gnig characters ni AFM les, v -al ues m tsu eb giv ne explicitly ni rt o source code usi gn the .l‘‘ han ’’g and .r‘‘ han ’’g qer ues .st Both accept a fo tn eps cication follow de yb one ro mo er pairs of characters and values:

.do fx lag 3 .ps 10 .fp 1 R gdrg____ pfb .lhang R V −50 J −40 .rhang R \( yh 80

Adj tsu me stn are giv ne ni un sit of p/ qv ooo inch m itlu plied yb the ac- ut al poi tn size, ro p/p ooo of the size when the il ne is .detnirp Th su ni ht is example, the le marg ni is shi de ot the le .yb t poi stn when the lemost let ret is a ‘‘V ,’’ and .yb s poi stn when the lemost let ret is a ‘‘J ;’’ the rig th marg ni is shi de ot the rig th .yb w poi stn when the rig th most let- ret is a hyphe .n eL  marg ni adj tsu me stn are ve aluat de befo er the let et rs ht at t on the cu iltnerr ne are compu ,det and can ht su irp ncipally eb of any le nI.htgn co tn rast, rig th marg ni adj tsu me stn are ve aluat de a re ht is computation is nishe ,d and the adj tsu me tn is simply added ot the w dro space of the ou -t pu ilt ne. Th su a positive rig th adj tsu me tn ht at is large ni relation ot the il ne le htgn w lil cause visible holes, and a negative adj tsu me tn w lil i-tlu mately cause the w ro ds on the il ne ot eb detnirp ov re each othe .r This is not a rp oblem for the typical application of han gnig for vis -u al alignment, thou ;hg if ila ne with eig th w dro spaces is shi de ni the ex- ample above, each w dro space is ne larg de yb only p/ op o em.

Mat eh matical and ot reh special hc aract sre

epS cial mathematical characters like ‘‘\(+−’’, erg ek let et rs like ‘‘\(*a’’, and, with the ‘‘pslow’’ device, neve the punctuation characters \( ro \− \`

qp \´ " „ < > @ \ ^ ~ are normally not chosen from the cu tnerr font, but are tak ne from the eps cial fo tn tsni ead P(. ostS irc pt names (e.g. ‘‘\[num- eb rsign ,]’’ ‘‘\[less]’’, ‘‘\[at]’’) access characters from the cu tnerr font.) The .f‘‘ ps’’ qer uest can eb used ot ov rre ide ht is behavio nI.r particular ht, is is usef otlu set mathematical text with a die tner font. To use Adobe Gara- mond erP mier orP for erg ek let et rs and mathematical ys mbols:

.do fx lag 3 .fps math,g er ek,punct 1 R GaramondP er m orPr otf .fp 2 I GaramondP er m tI-orPr otf .f lal back I R .EQ a ^=^ pi {r us p 2} .

Helper ut sietlii

The otfdump iltu ity shows the co stnetn of an Op ne Type ro rT ueType fo tn le tsuj as rt o etni rprets it. tI em sit an ASC II format ht at is readable yb humans and can also eb used for truf her orp cessi gn with shell sc ir pt .s tI is usef otlu retrie ev stisl of characters and feat ru es us pp detro with the font. The shell sc ir pt uts‘‘ /showfont.sh’’ ni the source code d rtis ibution uses rt o and possibly otfdump ot tnirp a map of lal characters ni an AFM, Op ne Type, ro rT ueType fo tn alo gn with their PostS irc pt names.

Lim ti ations

dpo ts uses a method ot emb de CFF-based P( ostS irc pt t-s yle) Op ne Type fo nistn PostS irc pt docume stn ht at is only available with PostS irc pt r -ni et rpreters; older gnitnirp qe piu me httn at uses PostS irc pt veL el q ro below cannot handle such docume stn erid ct .ly The er commended w ro karound is ot co trevn the PostS irc pt output ot a PDF docume tn and ot tnirp it us-

rp gni a PDF view re ro ever rse co evn rsion gorp ram. Also you may have ot update your co yp of Ghostsc ir pt ni ro der ot rc eate PDF les with orp rep fo tn embedd gni from such output. Embedd gni rT ueType fo stn ni PostS irc pt docume stn qer riu es Pos -t ircS pt r ro PostS irc pt veL el q of at least ev rsion rpoq . rt o only us pp stro Op ne Type feat ru es ht at res nitlu si gn le-charact sre ub- itts tu io nisn sensitive of co tn ex (t except for the ‘‘    ’’ igl at ru es and gninrek which are ne abled yb defau tl if possible). Also rt o ignores any feat ru es ht at are not map dep ot the ‘‘DFLT’’ ro ‘‘lat ’’n lan ug ages ni an Op ne Type font.

sp