c# open pdf file in adobe reader : Delete pages from a pdf reader software application dll windows winforms .net web forms tlgc2extra2-part1460

21.1 Fontformats:anoverview
21.1.4.2 OpenTypefeatures
FeaturesprovideinformationabouthowtousetheglyphsinanOpenTypeorTrueTypefonttorendera
scriptorlanguage.Forexample,anArabicfontmighthaveafeatureforsubstitutinginitialglyphforms,
andaKanjifontmighthaveafeatureforpositioningglyphsvertically.AllOpenTypeLayout features
definedataforglyphsubstitution,glyphpositioning,orboth.
EachOpenTypeLayoutfeaturehasafeaturetagthatidentifiesitstypographicfunctionandeffects.
Byexamininga feature’s tag, a text-processingclient can determine what a featuredoesand decide
whether toimplementit.Alltagsarefour-bytecharacterstringscomposed of alimitedsetof ASCII
characters(range
0x20-0x7E
).
Afeaturedefinitiondoesnot necessarilyprovidealltheinformationrequiredtoproperlyimple-
mentglyphsubstitutionorpositioningactions.Oen,atext-processingclientmayneedtosupplyad-
ditionaldata¹Inallcases,thetext-processingclient isresponsiblefor applying,combining,andarbi-
tratingamongfeaturesandrenderingtheresult.
elistoffeaturesregisteredbyMicrosotogetherwithashortdescriptionfollows.²
aalt
AccessAllAlternates
abvf
Above-baseForms
abvm
Above-baseMark
Positioning
abvs
Above-baseSubstitutions
afrc
AlternativeFractions
akhn
Akhands
blwf
Below-baseForms
blwm
Below-baseMark
Positioning
blws
Below-baseSubstitutions
calt
ContextualAlternates
case
Case-SensitiveForms
ccmp
GlyphCompositionand
Decomposition
clig
ContextualLigatures
cpsp
CapitalSpacing
cswh
ContextualSwash
curs
CursivePositioning
c2sc
SmallCapitalsFrom
Capitals
c2pc
PetiteCapitalsFrom
Capitals
dist
Distances
dlig
DiscretionaryLigatures
dnom
Denominators
expt
ExpertForms
falt
FinalGlyphonLine
Alternates
fin2
TerminalForms#2
fin3
TerminalForms#3
fina
TerminalForms
frac
Fractions
fwid
FullWidths
half
HalfForms
haln
HalantForms
halt
AlternateHalfWidths
hist
HistoricalForms
hkna
HorizontalKanaAlternates
hlig
HistoricalLigatures
hngl
Hangul
hojo
HojoKanjiForms(JISX
0212-1990KanjiForms)
hwid
HalfWidths
init
InitialForms
isol
IsolatedForms
ital
Italics
jalt
JustificationAlternates
jp78
JIS78Forms
jp83
JIS83Forms
jp90
JIS90Forms
jp04
JIS2004Forms
kern
Kerning
lfbd
LeBounds
liga
StandardLigatures
ljmo
LeadingJamoForms
lnum
LiningFigures
locl
LocalizedForms
mark
MarkPositioning
med2
MedialForms#2
medi
MedialForms
mgrk
MathematicalGreek
mkmk
MarktoMarkPositioning
mset
MarkPositioningvia
Substitution
nalt
AlternateAnnotation
Forms
nlck
NLCKanjiForms
nukt
NuktaForms
numr
Numerators
onum
OldstyleFigures
opbd
OpticalBounds
ordn
Ordinals
ornm
Ornaments
palt
ProportionalAlternate
Widths
pcap
PetiteCapitals
pnum
ProportionalFigures
pref
Pre-BaseForms
pres
Pre-baseSubstitutions
pstf
Post-baseForms
¹Asanexampleletusconsidertheinitfeaturewhosefunctionistoprovideinitialglyphforms.Nothinginthefeature’s
lookuptablesindicateswhenorwheretoapplythisfeatureduringtextprocessing.Hence,tocorrectlyusethisfeaturein
Arabictextwhereinitialglyphformsappearatthebeginningofwords,text-processingclientsmustbeabletoidentifythe
firstglyphpositionineachwordbeforemakingtheglyphsubstitution.
²More details about each feature are available at the Microso OpenType site http://www.microsoft.
com/typography/otspec/featuretags.htm, or Adobe e developers’ site http://partners.adobe.com/public/
developer/opentype/index_tag3.html
ch-psextra1.tex,v:2.24
2007/08/14
11
Delete pages from a pdf reader - remove PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Provides Users with Mature Document Manipulating Function for Deleting PDF Pages
delete page from pdf file online; delete pdf pages android
Delete pages from a pdf reader - VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Visual Basic Sample Codes to Delete PDF Document Page in .NET
delete pages from pdf reader; delete page from pdf preview
21
POSTSCRIPTFONTSANDBEYOND
psts
Post-baseSubstitutions
pwid
ProportionalWidths
qwid
QuarterWidths
rand
Randomize
rlig
RequiredLigatures
rphf
RephForms
rtbd
RightBounds
rtla
Right-to-lealternates
ruby
RubyNotationForms
salt
StylisticAlternates
sinf
ScientificInferiors
size
Opticalsize
smcp
SmallCapitals
smpl
SimplifiedForms
ss01
StylisticSet1
ss02
StylisticSet2
ss03
StylisticSet3
ss04
StylisticSet4
ss05
StylisticSet5
ss06
StylisticSet6
ss07
StylisticSet7
ss08
StylisticSet8
ss09
StylisticSet9
ss10
StylisticSet10
ss11
StylisticSet11
ss12
StylisticSet12
ss13
StylisticSet13
ss14
StylisticSet14
ss15
StylisticSet15
ss16
StylisticSet16
ss17
StylisticSet17
ss18
StylisticSet18
ss19
StylisticSet19
ss20
StylisticSet20
subs
Subscript
sups
Superscript
swsh
Swash
titl
Titling
tjmo
TrailingJamoForms
tnam
TraditionalNameForms
tnum
TabularFigures
trad
TraditionalForms
twid
irdWidths
unic
Unicase
valt
AlternateVerticalMetrics
vatu
VattuVariants
vert
VerticalWriting
vhal
AlternateVerticalHalf
Metrics
vjmo
VowelJamoForms
vkna
VerticalKanaAlternates
vkrn
VerticalKerning
vpal
ProportionalAlternate
VerticalMetrics
vrt2
VerticalAlternatesand
Rotation
zero
SlashedZero
21.1.4.3 OpenTypesupporttoday
As anexample of how publishingapplications canexploitOpenType’slayout featureswe canlook at
OpenTypesupportinAdobe’s
Illustrator
,
InDesign
and
Photoshop
¹programs.eseincludeautomatical
substitutionbyalternateglyphsinanOpenTypePro font(ligatures, smallcapitals, andproportional
old-style figures, verticalshi of punctuationinanall-caps setting). Moreover, anyalternate glyphs
inOpenTypefontsmaybeselectedmanuallyvia theInsertCharacter palette(seeFigure21.1). ese
OpenTypeProfontsofferafullrangeofaccentedcharacterstosupportallcentralandeasternEuropean
languages,andmanyofthemalsocontainsupportfortheCyrillicandGreekalphabets.
Figure 21.1: UsingOpenType’s advanced typographic features in Adobe
InDesign
.Le: selectionof
automaticsubstitutionofligaturesandold-stylefiguresonamenu.Right:selectandinsertanyalternate
glyphInsertCharacterpalette.
Featuresupport across Microso’s
Office
applications existsforthosefeatures that are necessary
for languagesupport, such as contextualsubstitutions for Arabic—and onlyinthe languages which
requirethem(e.g.,Word2003doescontextualsubstitutionsforArabic,butnotforEnglish).
Openoffice
onallsupportedplatformshasasomewhatsimilarapproachtoMicroso’s
Office
suite
¹Seehttp://www.adobe.com/products/XXX/main.htm,whereXXXstandsforillustrator,indesign,andpho-
toshop,respectively.
12
ch-psextra1.tex,v:2.24
2007/08/14
C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
VB.NET Page: Insert PDF pages; VB.NET Page: Delete PDF pages; VB.NET Annotate: PDF Markup & Drawing. XDoc.Word for XImage.OCR for C#; XImage.Barcode Reader for C#
delete a page from a pdf in preview; cut pages from pdf reader
C# PDF Page Insert Library: insert pages into PDF file in C#.net
how to merge PDF document files by C# code, how to rotate PDF document page, how to delete PDF page using C# .NET, how to reorganize PDF document pages and how
delete page in pdf; delete a page from a pdf reader
21.1 Fontformats:anoverview
Figure21.2:OpenTypeUnicodesupportin
OpenOffice
.etoppanelshowstextinvariousalphabets
andthebottompanelthecharactersavailableintheGreekpartoffontlayout.
inthatitallowsonetousethecharacterspresentinthefontbutdoesnotreallypresentaninterfaceto
theadvancedtypographicfeatures(seeFigure21.2).
atleavesuswiththeavailabilityofthefontsthemselves.Aroundtheyear2000therewereonlya
handfulofOpenTypefonts,andalmost allofthemwerefromAdobe.Nowadays,therearethousands
availablefromovertwodozenfontfoundries.Forinstance,theentireAdobeTypeLibraryofover2,200
fonts hasbeentranslated into theOpenType format, URW has released over 1,000OpenTypefonts,
andotherlargefoundries,suchasLinotypeandAgfaMonotype,aswellasmostsmallerfoundries,are
alsocreatingOpenTypefonts.MostofMicroso’ssystemfonts,andApple’sJapanesesystemfonts,are
OpenType.Similarly,OpenTypeisbeingembracedbymajortypefoundriesfornon-alphabeticscripts,
suchasChineseandJapanese.
However,itisnotenoughforafonttobeintheOpenTypeformattobesurethatithasextended
languagesupportorextratypographicfeatures.erefore,beforepurchasing,youshouldexaminethe
featurespresentinafont.¹ToinspectafontthatyoualreadyhaveonyourMicrosoWindowssystem,
you caninstalltheFontPropertiesExtensionfromMicroso.isadd-onallowsyoutoright-clickon
afont todisplayamuchexpandedsetofproperties, whichincludeslanguagesupportandOpenType
¹InthecaseofAdobe,wherecurrentlynotallfontsreleasedinOpenTypeformathavesignificantaddedfeaturesorex-
tendedlanguagesupport,youbrowseallfontsintheAdobeTypeLibraryfromtheURLhttp://store.adobe.com/type/
main.html,sothatyoucaninspectthefontyouareinterestedin.Otherfontvendorsoffersimilarpossibilities.
ch-psextra1.tex,v:2.24
2007/08/14
13
VB.NET PDF Page Insert Library: insert pages into PDF file in vb.
Page: Insert PDF Pages. |. Home ›› XDoc.PDF ›› VB.NET PDF: Insert PDF Page. Add and Insert Multiple PDF Pages to PDF Document Using VB.
add remove pages from pdf; delete a page from a pdf without acrobat
VB.NET PDF delete text library: delete, remove text from PDF file
Visual Studio .NET application. Delete text from PDF file in preview without adobe PDF reader component installed. Able to pull text
delete pages from a pdf; delete pages from pdf acrobat
21
POSTSCRIPTFONTSANDBEYOND
Figure21.3:Microso’sFontsExtensionutilitydisplaysOpenTypefeaturesforMinionPro-Regularand
thesupportedCharactersetsforMyriadPro-Boldwhenyouright-clickonthefont(isutility,
ttfext
,
addsseveralnewpropertytabstothestandardspropertiesdialogbox,suchasinformationrelatingto
fontoriginationandcopyright,thetypesizestowhichhintingandsmoothingareapplied,andthecode
pagessupportedbyextendedcharacter.Itcanbedownloadedfrom
http://www.microsoft.com/
typography/TrueTypeProperty21.mspx
.)
layoutfeatures(seeFigure21.3).
21.1.4.4 InterrogatingOpenTypefonts
EddieKohler’s
otfinfo
program¹printsinformationaboutanOpenTypefont.
> otfinfo --help
’Otfinfo’ reports information about an OpenType font to standard output.
Options specify what information to print.
Usage: otfinfo [-sfzpg] [OTFFILES...]
Query options:
-s, --scripts
Report font’s supported scripts.
-f, --features
Report font’s GSUB/GPOS features.
-z, --optical-size
Report font’s optical size information.
-p, --postscript-name
Report font’s PostScript name.
-a, --family
Report font’s family name.
-v, --font-version
Report font’s version information.
-i, --info
Report font’s names and designer/vendor info.
-g, --glyphs
Report font’s glyph names.
-t, --tables
Report font’s OpenType tables.
¹Partofhislcdftools,seewww.lcdf.org/type/.
14
ch-psextra1.tex,v:2.24
2007/08/14
C# PDF Page Rotate Library: rotate PDF page permanently in C#.net
batch changing PDF page orientation without other PDF reader control. NET, add new PDF page, delete certain PDF page, reorder existing PDF pages and split
cut pages from pdf preview; acrobat export pages from pdf
C# PDF delete text Library: delete, remove text from PDF file in
Delete text from PDF file in preview without adobe PDF reader component installed in ASP.NET. C#.NET PDF: Delete Text from Consecutive PDF Pages.
delete pdf pages acrobat; delete pages from pdf
21.1 Fontformats:anoverview
Other options:
--script=SCRIPT[.LANG]
Set script used for --features [latn].
-V, --verbose
Print progress information to standard error.
-h, --help
Print this message and exit.
-q, --quiet
Do not generate any error messages.
--version
Print version number and exit.
> otfinfo --info texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf
Family:
Minion Pro
Subfamily:
Regular
Full name:
Minion Pro
PostScript name:
MinionPro-Regular
Version:
Version 2.012;PS 002.000;Core 1.0.38;makeotf.lib1.6.6565
Unique ID:
2.012;ADBE;MinionPro-Regular
Designer:
Robert Slimbach
Vendor URL:
http://www.adobe.com/type/
Trademark:
Minion is either a ...
Copyright:
© 2000, 2002, 2004 ...
License URL:
http://www.adobe.com/type/legal.html
> otfinfo --script texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf
cyrl
Cyrillic
latn.DEU
Latin/German (Standard)
grek
Greek
latn.MOL
Latin/Moldavian
latn
Latin
latn.ROM
Latin/Romanian
latn.AZE
Latin/Azeri
latn.SRB
Latin/Serbian
latn.CRT
Latin/Crimean Tatar
latn.TRK
Latin/Turkish
> otfinfo --tables texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf
64 BASE
54 head
132417 CFF
36 hhea
5228 DSIG
6652 hmtx
40074 GPOS
6 maxp
13872 GSUB
1533 name
96 OS/2
32 post
4048 cmap
> otfinfo --features texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf
aalt
Access All Alternates
c2sc
Small Capitals From Capitals
case
Case-Sensitive Forms
cpsp
Capital Spacing
dlig
Discretionary Ligatures
dnom
Denominators
fina
Terminal Forms
frac
Fractions
hist
Historical Forms
kern
Kerning
liga
Standard Ligatures
lnum
Lining Figures
numr
Numerators
onum
Oldstyle Figures
ordn
Ordinals
ornm
Ornaments
pnum
Proportional Figures
salt
Stylistic Alternates
sinf
Scientific Inferiors
size
Optical Size
smcp
Small Capitals
ss01
Stylistic Set 1
ss02
Stylistic Set 2
sups
Superscript
tnum
Tabular Figures
zero
Slashed Zero
ch-psextra1.tex,v:2.24
2007/08/14
15
VB.NET PDF Page Extract Library: copy, paste, cut PDF pages in vb.
C:\test1.pdf") Dim pdf2 As PDFDocument = New PDFDocument("C:\test2.pdf") Dim pageindexes = New Integer() {1, 2, 4} Dim pages = pdf.DuplicatePage(pageindexes
delete pages out of a pdf file; delete pdf pages online
C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
C#.NET PDF Library - Copy and Paste PDF Pages in C#.NET. Easy to C#.NET Sample Code: Copy and Paste PDF Pages Using C#.NET. C# programming
delete blank page in pdf; delete pages pdf files
21
POSTSCRIPTFONTSANDBEYOND
Just vanRossum’s
ttx
utility¹ candecompile the contents of anOpenType font and output it in
XMLformat.iscomesinhandyifyouwanttostudythecontentsofagivenfont(e.g.,,itstables)or
(slighly)modifyit.
> ttx --help
usage: ttx [options] inputfile1 [... inputfileN]
TTX 2.0b1 -- From OpenType To XML And Back
If an input file is a TrueType or OpenType font file, it will be
dumped to an TTX file (an XML-based text format).
If an input file is a TTX file, it will be compiled to a TrueType
or OpenType font file.
Output files are created so they are unique: an existing file is
never overwrritten.
General options:
-h Help: print this message
-d <outputfolder> Specify a directory where the output files are
to be created.
-v Verbose: more messages will be written to stdout about what
is being done.
Dump options:
-l List table info: instead of dumping to a TTX file, list some
minimal info about each table.
-t <table> Specify a table to dump. Multiple -t options
are allowed. When no -t option is specified, all tables
will be dumped.
-x <table> Specify a table to exclude from the dump. Multiple
-x options are allowed. -t and -x are mutually exclusive.
-s Split tables: save the TTX data into separate TTX files per
table and write one small TTX file that contains references
to the individual table dumps. This file can be used as
input to ttx, as long as the table files are in the
same directory.
-i Do NOT disassemble TT instructions: when this option is given,
all TrueType programs (glyph programs, the font program and the
pre-program) will be written to the TTX file as hex data
instead of assembly. This saves some time and makes the TTX
file smaller.
Compile options:
-m Merge with TrueType-input-file: specify a TrueType or OpenType
font file to be merged with the TTX file. This option is only
valid when at most one TTX file is specified.
-b Don’t recalc glyph boundig boxes: use the values in the TTX
file as-is.
us,todecompileafont
myfont.otf
justspecify:
> ttx myfont.otf
¹WritteninPythonandpartofthe
FontTools
toolset(sourceforge.net/projects/fonttools).
16
ch-psextra1.tex,v:2.24
2007/08/14
21.1 Fontformats:anoverview
iswillwriteafile
myfon.ttx
inthedirectorywherethefont fileresides.Ifyouareonlyinterested
intwotables(e.g.,,
GSUB
and
GPOS
),specifythemonthecommandline:
> ttx -t GSUB -t GPOS myfont.otf
ToconvertanXMLfile
myfont.ttx
backintoanOpenTypeorTrueTypefileissimilarlyeasy:
> ttx myfont.ttx
Ityouwanttointroducemodifications(e.g.,,giveninXMLformatinthefile
myfontmods.ttx
)into
anOpenTypefile,usethe
-m
option,asfollows:
> ttx -m myfont.otf myfontmods.ttx
AnmoreexplicitexamplewiththefontMinionProfollows.
> ttx -l /texlive/2007/texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf
Listing table info for ”/texlive/2007/texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf”:
tag
checksum
length
offset
tag
checksum
length
offset
----
----------
-------
-------
----
----------
-------
-------
BASE
0x086729a7
64
199052
CFF
0x101232c2
132417
6032
DSIG
0x446dbd94
5228
199116
GPOS
0xx71552700
40074
158976
GSUB
0xx3bf7bcba
13872
145104
OS/2
0x40e57e9f
96
320
cmap
0x0cedc8f1
4048
1952
head
0xx2167aded
54
220
hhea
0x09140bb5
36
276
hmtx
0xx37425493
6652
138452
maxp
0x067f5000
6
312
name
0x3cf7b183
1533
416
post
0x0x47ffce
32
6000
ttx -d. -t head /texlive/2007/texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf
Dumping ”/texlive/2007/texmf-commercial/fonts/opentype/adobe/minionpro-regular.otf” to ”./minionpro-regular.ttx”...
Dumping ’head’ table...
> less ./minionpro-regular.ttx
<?xml version=”1.0” encoding=”ISO-8859-1”?>
<ttFont sfntVersion=”OTTO” ttLibVersion=”2.0b1”>
<head>
<!-- Most of this table will be recalculated by the compiler -->
<tableVersion value=”1.0”/>
<fontRevision value=”2.0119934082”/>
<checkSumAdjustment value=”-0x107d913c”/>
<magicNumber value=”0x5f0f3cf5”/>
<flags value=”00000000 00000011”/>
<unitsPerEm value=”1000”/>
<created value=”Tue Jun 29 11:41:10 2004”/>
<modified value=”Tue Jun 29 11:41:10 2004”/>
<xMin value=”-290”/>
<yMin value=”-360”/>
<xMax value=”1684”/>
<yMax value=”989”/>
<macStyle value=”00000000 00000000”/>
<lowestRecPPEM value=”3”/>
<fontDirectionHint value=”2”/>
<indexToLocFormat value=”0”/>
<glyphDataFormat value=”0”/>
</head>
</ttFont>
ch-psextra1.tex,v:2.24
2007/08/14
17
21
POSTSCRIPTFONTSANDBEYOND
ForreasonsofefficiencyTrueTypeandOpenTypefontinstancescanbegroupesinto“collection”
(
.ttc
), so that different fonts cansharecommontablesto describeglyphs. Someprograms arenot
abletoextractthevariousfont componentsfromsuchacollection.Tohelpwiththisproblemasmall
utility,
ttc2ttf
,existstoextractthefontinstancesfromacollection.
21.2 Typography:combiningcharactersfor optimalreadability
Atypesettingsystemhasthetasktocombinethecharactersthatareinputtothesystemintolinesand
paragraphs.etypesetresultshouldlookpleasingandreadable. Variousapproacheshavebeenused
toaddressthistask.Mostofthemareheuristical,whereassomearemoremathematical, inparticular
T
E
X.ItisnotourpurposetodescribeinanydetailthecomplextypesettingalgorithmsofT
E
X[11].¹We
merelywanttogivesomebasicinformationonhowcharactersareputtogetheronaline.
21.2.1 efontmetricfiles
TointroducethemainaspectsoffontmetricsweusetheAdobeFontMetric(
.afm
)fileforPostScript
fonts as anexample. T
E
X’s font metricfiles (
.tfm
)and the tables of TrueType and OpenType fonts
containsimilarinformation.
21.2.1.1 estructureofanAFMfile
AFMfiles,² used as a standard means of interchanging font metricinformationbetweenprograms,
aremachine-independent and extensibleASCII-encodedfilesthatarecharacterized bythe
.afm
file
extension.An
.afm
fileprovidesbothglobalmetricsforafontprogramandinformationforindividual
characters.
Letushaveacloserlookatthe
.afm
fileofthefontTimes-Bold. Ingeneral,an
.afm
filehasfour
parts.erstparthasgeneralinformationaboutthefont,withitsname,weight,capheight,x-height,
anddefaultencoding:
StartFontMetrics 2.0
Comment Creation Date: Fri Sep
6 17:58:27 1991
Comment UniqueID 28417
Comment VMusage 30458 37350
FontName Times-Bold
FullName Times Bold
FamilyName Times
Weight Bold
ItalicAngle 0
IsFixedPitch false
FontBBox -168 -218 1000 935
UnderlinePosition -100
UnderlineThickness 50
Version 001.007
Notice Copyright (c) 1991 Adobe Systems Incorporated.
EncodingScheme AdobeStandardEncoding
CapHeight 676
¹ewebpagehttp://www.leverkruid.nl/GKPLinebreaking/elements-xhtml.xmldescribesrecentresearch
bySimonPeppingtogeneralizeT
E
X’sKnuth–Plasslinebreakingalgorithm.
²See http://partners.adobe.com/public/developer/en/font/5004.AFM_Spec.pdf,theAdobeFontMetric
FormatSpecification.
18
ch-psextra1.tex,v:2.24
2007/08/14
21.2 Typography:combiningcharactersforoptimalreadability
XHeight 461
Ascender 676
Descender -205
edimensionsof thecharactersaregivenonanotionalgridof 1000unitssquareto whichallfields
relate. Inparticular, the
FontBBox
entryintheheaderinformationtells usthatallcharacters of the
fontstaywithinarangeof[−168,1000]unitsinxand[−218,935]unitsiny,thex-height(
XHeight
,
theheightoflowercaseletters,e.g.,“x”)is461units,theheightofcapitals(
CapHeight
,e.g.,“M”)and
largelowercaseletters(
Ascender
,e.g.,“h”)is676units,etc.
eglobalheader informationis followedbythesecond part,a set of metricfields, one foreach
characterinthefont.Afieldcontains:
C
anumericcode; this isthepositioninthedefault Adobeencoding(characterswithacodeof
-1
,
sucha
egrave
inthefollowingexample,arenotavailablewithoutre-encoding);
W
thewidthofthecharacter;
N
thenameofthecharacter;
B
thecharacterboundingbox;
L
possibleligaturecombinations(optional).
Afewlinesofthecharactermetricspartofthe
.afm
filefollow.
1
StartCharMetrics 228
2
C 32
; WX 250 ; N space
; B
0
0
0
0 ;
3
C 39
; WX 333 ; N quoteright ; B 79
356 263 691 ;
4
C 44
; WX 250 ; N comma
; B 39 -180 223 155 ;
5
C 46
; WX 250 ; N period
; B 41
-13 210 156 ;
6
C 65
; WX 722 ; N A
; B
9
0 689 690 ;
7
C 70
; WX 611 ; N F
; B 16
0 583 676 ;
8
C 77
; WX 944 ; N M
; B 14
0 921 676 ;
9
C 86
; WX 722 ; N V
; B 16
-18 701 676 ;
10
C 102 ; WX 333 ; N f
; B 14
0 389 691 ; L i fi ; L l fl ;
11
C 103 ; WX 500 ; N g
; B 28 -206 483 473 ;
12
C 105 ; WX 278 ; N i
; B 16
0 255 691 ;
13
C 108 ; WX 278 ; N l
; B 16
0 255 676 ;
14
...
15
C -1
; WX 444 ; N egrave
; B 25
-14 426 713 ;
16
EndCharMetrics
Let us now see how we canuse this information for combining individual characters into “words”.
Figure21.4onthenextpageshowsafewcharactersofthePostScriptfontsTimes-Bold(top)andTimes-
BoldItalic(bottom)drawnat350points.Forreference,thegridshowsunitsinPostScriptpoints.e
baselineisthelineuponwhichmostletters“sit”andunderwhichdescendersextend.Inourcasethe
baselineofthetoplineisatayvalueof500andthatofthebottomlineat100.
Each character is surrounded byits “bounding box,” i.e., thelargest imaginaryboxthat canbe
drawnaround theglyph which just touches onallsides (the coordinatesofthe lower le andupper
right cornersofeach character’sboundingboxstartswith the
B
keyonthelinesabove).Takethefirst
character,the“period,”whichweplacedatavalueof(50,500)onthegrid.Wehavemarkeditsorigin
with across. e next character willthenbe placed, ignoringkerning, seebelow, one “width” (
WX
)
tothe right. For the “period”character(line5)thisis250units. isvalue shouldbe multiplied by
350/1000(theratioofthefontsizetotheinternalunit,whichis1000),i.e.,yielding 87.5,sothatthe
“M”character startsat137.5(secondcrossontop lineoffigure). Weproceed likethisto placeeach
characterontheline.Characters donotpreciselystart at their reference point,butsomewhatto the
right. Forinstance, the“g”onthetoplinehasalesidebearing (thefirst valuefollowingthe
B
keyon
ch-psextra1.tex,v:2.24
2007/08/14
19
21
POSTSCRIPTFONTSANDBEYOND
x
y
50
100
150
200
250
300
350
400
450
500
550
600
650
700
750
50
100
150
200
250
300
350
400
450
500
550
600
650
700
Times-BoldItalic at 350 pt
Times-Bold at 350 pt
Glyph
origin
Next
glyph
origin
Glyph width
Left sidebearing
Glyph
bounding
box
Figure21.4:Fontboundingboxesatwork
line11)of28units(9.8onthegrid,asindicated inthefigure).Similarlythe“period”(line5), which
startstheline,isoffsetby48units(16.8onthegrid)fromitsreferencepoint.
Characterboundingboxescanoverlap,whichismoreeasilyseeninthecaseofanitalicfont,e.g.,
Times-BoldItalicinthebottomlineofFigure21.4.Wereproduceherethe.afmentriescorresponding
tothefourcharactersinthatfigure.
C 44
; WX 250 ; N comma
; B
-60 -182 144 134 ;
C 46
; WX 250 ; N period ; B
-9
-13 139 135 ;
C 77
; WX 889 ; N M
; B
-29
-12 917 669 ;
C 103 ; WX 500 ; N g
; B
-52 -203 478 462 ;
elebearings(thefirstvaluefollowingthe
B
keyabove)ofallcharactersarenegativeandthewidths
ofthelettersissmallerthanthehorizontaldimensionoftheirboundingbox,sothattheboundingbox
ofthenextcharacterstarts totheleoftherightmostpartof thecurrentletter.isisespeciallytrue
forthe“Mg”combination,wherethedescenderofthe“g”liesfirmlytotheleoftherighttop ofthe
M.”
eeffect of boundingbox positioningand how itdependsontheseries and shape of the font
familyis also clearlyobserved inFigure21.5on the next page, where for variants ofTimesRoman
(from top to bottom wehaveTimes-Roman,Times-Italic,Times-Bold,andTimes-BoldItalic)weshowa
20
ch-psextra1.tex,v:2.24
2007/08/14
Documents you may be interested
Documents you may be interested