/usr/lib64/python2.6/site-packages/matplotlib
NameSizeModeActions
backends/-0755rm
delaunay/-0755rm
mpl-data/-0755rm
numerix/-0755rm
projections/-0755rm
sphinxext/-0755rm
afm.py150890644editdlrm
afm.pyc169590644editdlrm
afm.pyo169590644editdlrm
artist.py356230644editdlrm
artist.pyc403260644editdlrm
artist.pyo403260644editdlrm
axes.py2800890644editdlrm
axes.pyc2493960644editdlrm
axes.pyo2482840644editdlrm
axis.py573540644editdlrm
axis.pyc589730644editdlrm
axis.pyo586660644editdlrm
backend_bases.py723180644editdlrm
backend_bases.pyc779670644editdlrm
backend_bases.pyo778770644editdlrm
bezier.py149170644editdlrm
bezier.pyc135260644editdlrm
bezier.pyo135260644editdlrm
blocking_input.py136900644editdlrm
blocking_input.pyc143460644editdlrm
blocking_input.pyo140280644editdlrm
cbook.py427560644editdlrm
cbook.pyc567550644editdlrm
cbook.pyo565290644editdlrm
cm.py80980644editdlrm
cm.pyc97720644editdlrm
cm.pyo97720644editdlrm
collections.py407840644editdlrm
collections.pyc440060644editdlrm
collections.pyo440060644editdlrm
colorbar.py274560644editdlrm
colorbar.pyc254970644editdlrm
colorbar.pyo254970644editdlrm
colors.py391100644editdlrm
colors.pyc400790644editdlrm
colors.pyo400790644editdlrm
contour.py428950644editdlrm
contour.pyc360990644editdlrm
contour.pyo359370644editdlrm
dates.py360070755editdlrm
dates.pyc400170644editdlrm
dates.pyo399530644editdlrm
dviread.py320330644editdlrm
dviread.pyc346820644editdlrm
dviread.pyo345390644editdlrm
figure.py412640644editdlrm
figure.pyc429390644editdlrm
figure.pyo428080644editdlrm
finance.py205820644editdlrm
finance.pyc185190644editdlrm
finance.pyo183590644editdlrm
fontconfig_pattern.py64290644editdlrm
fontconfig_pattern.pyc65190644editdlrm
fontconfig_pattern.pyo65190644editdlrm
font_manager.py426530644editdlrm
font_manager.pyc404560644editdlrm
font_manager.pyo404560644editdlrm
ft2font.so3061680775editdlrm
hatch.py65640644editdlrm
hatch.pyc91200644editdlrm
hatch.pyo91200644editdlrm
image.py315400644editdlrm
image.pyc330420644editdlrm
image.pyo329960644editdlrm
legend.py323020644editdlrm
legend.pyc235510644editdlrm
legend.pyo233780644editdlrm
lines.py546850644editdlrm
lines.pyc564310644editdlrm
lines.pyo563260644editdlrm
mathtext.py1020090644editdlrm
mathtext.pyc1030670644editdlrm
mathtext.pyo1026790644editdlrm
mlab.py942940644editdlrm
mlab.pyc1000040644editdlrm
mlab.pyo998240644editdlrm
mpl.py7850644editdlrm
mpl.pyc11760644editdlrm
mpl.pyo11760644editdlrm
nxutils.so95120775editdlrm
offsetbox.py298070644editdlrm
offsetbox.pyc338890644editdlrm
offsetbox.pyo338340644editdlrm
patches.py1284850644editdlrm
patches.pyc1301480644editdlrm
patches.pyo1300100644editdlrm
path.py217650644editdlrm
path.pyc211740644editdlrm
path.pyo209540644editdlrm
pylab.py109810644editdlrm
pylab.pyc123990644editdlrm
pylab.pyo123990644editdlrm
pyparsing.py1439240644editdlrm
pyparsing.pyc1467370644editdlrm
pyparsing.pyo1467370644editdlrm
pyplot.py824680644editdlrm
pyplot.pyc802790644editdlrm
pyplot.pyo802790644editdlrm
quiver.py375400644editdlrm
quiver.pyc337880644editdlrm
quiver.pyo337880644editdlrm
rcsetup.py234340644editdlrm
rcsetup.pyc211190644editdlrm
rcsetup.pyo209490644editdlrm
scale.py142330644editdlrm
scale.pyc194740644editdlrm
scale.pyo194740644editdlrm
spines.py126840644editdlrm
spines.pyc116360644editdlrm
spines.pyo112090644editdlrm
table.py168280644editdlrm
table.pyc169310644editdlrm
table.pyo167800644editdlrm
texmanager.py224640644editdlrm
texmanager.pyc199620644editdlrm
texmanager.pyo199620644editdlrm
text.py598220644editdlrm
text.pyc592400644editdlrm
text.pyo592400644editdlrm
ticker.py404280644editdlrm
ticker.pyc504610644editdlrm
ticker.pyo503250644editdlrm
tight_bbox.py36550644editdlrm
tight_bbox.pyc40660644editdlrm
tight_bbox.pyo40660644editdlrm
transforms.py753870644editdlrm
transforms.pyc896110644editdlrm
transforms.pyo887020644editdlrm
ttconv.so653600775editdlrm
type1font.py115370644editdlrm
type1font.pyc112560644editdlrm
type1font.pyo112560644editdlrm
units.py49760644editdlrm
units.pyc57750644editdlrm
units.pyo57750644editdlrm
widgets.py408330644editdlrm
widgets.pyc425680644editdlrm
widgets.pyo423820644editdlrm
windowing.py4540644editdlrm
windowing.pyc12830644editdlrm
windowing.pyo12830644editdlrm
_cm.py3704140644editdlrm
_cm.pyc1030420644editdlrm
_cm.pyo1030420644editdlrm
_cntr.so211840775editdlrm
_delaunay.so611200775editdlrm
_image.so2822480775editdlrm
_mathtext_data.py579900644editdlrm
_mathtext_data.pyc637870644editdlrm
_mathtext_data.pyo637870644editdlrm
_path.so2799920775editdlrm
_png.so1564720775editdlrm
_pylab_helpers.py27150644editdlrm
_pylab_helpers.pyc37080644editdlrm
_pylab_helpers.pyo37080644editdlrm
__init__.py289720644editdlrm
__init__.pyc289800644editdlrm
__init__.pyo289260644editdlrm
Edit: /usr/lib64/python2.6/site-packages/matplotlib/afm.pyo (16959B)
6Jc @s*dZddkZddkZddkZddklZeZeZ e Z dZ dZ dZdZdZd Zd Zd Zd Zd ZdddYZedjo`dZxWeieD]BZeeiieeZeeZei d\Z!Z"qWndS(s This is a python interface to Adobe Font Metrics Files. Although a number of other python implementations exist (and may be more complete than mine) I decided not to go with them because either they were either 1) copyrighted or used a non-BSD compatible license 2) had too many dependencies and I wanted a free standing lib 3) Did more than I needed and it was easier to write my own than figure out how to just get what I needed from theirs It is pretty easy to use, and requires only built-in python libs:: >>> from afm import AFM >>> fh = file('ptmr8a.afm') >>> afm = AFM(fh) >>> afm.string_width_height('What the heck?') (6220.0, 683) >>> afm.get_fontname() 'Times-Roman' >>> afm.get_kern_dist('A', 'f') 0 >>> afm.get_kern_dist('A', 'y') -92.0 >>> afm.get_bbox_char('!') [130, -9, 238, 676] >>> afm.get_bbox_font() [-168, -218, 1000, 898] AUTHOR: John D. Hunter iN(t uni2type1cCs=|idd}g}|iD]}|t|q#~S(Nt,t (treplacetsplitt_to_int(tst_[1]tval((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt_to_list_of_ints-scCs+g}|iD]}|t|q~S(N(Rt _to_float(RRR((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt_to_list_of_floats1scCs&|iidjotStSdS(Ntfalset0tno(R R R(tlowertstriptFalsetTrue(R((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt_to_bool3scCsT|i}z|i}Wd|i|dX|idptdndS(s[ Check if the file at least looks like AFM. If not, raise :exc:`RuntimeError`. NitStartFontMetricssNot an AFM file(ttelltreadlinetseekt startswitht RuntimeError(tfhtpostline((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt _sanity_check8s  cCshtd6td6td6td6td6td6td6td6td 6td 6td 6td 6td 6td6td6td6td6td6td6td6td6td6td6}h}x|i}|pPn|i}|idoqn|idd}|d}t |djo|d}nd}y|||||False * '0'->0 * '-168 -218 1000 898'-> [-168, -218, 1000, 898] Dictionary keys are StartFontMetrics, FontName, FullName, FamilyName, Weight, ItalicAngle, IsFixedPitch, FontBBox, UnderlinePosition, UnderlineThickness, Version, Notice, EncodingScheme, CapHeight, XHeight, Ascender, Descender, StartCharMetrics RtFontNametFullNamet FamilyNametWeightt ItalicAnglet IsFixedPitchtFontBBoxtUnderlinePositiontUnderlineThicknesstVersiontNoticetEncodingSchemet CapHeightt CapheighttXHeighttAscendert DescendertStdHWtStdVWtStartCharMetricst CharacterSett CharacterstCommentRiiits"Value error parsing header in AFM:s/Found an unknown keyword in AFM header (was %s)s Bad parseN(R t_to_strRR RRtrstripRRtlent ValueErrortsyststderrtKeyErrorR(RtheaderConverterstdRtlsttkeyR((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt _parse_headerMs`     c CsQh}h}x2|i}|pPn|i}|ido ||fS|idd }t|djotd|nt|did}t|did}|did}t|dd}t t |}|d jo d }n|d jo|||f||RItc1tc2R((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt_parse_kern_pairss(     $&c Csh}x|i}|pPn|i}t|djoq n|ido|S|id}|di}|dt|d}}g}xc|dd!D]T}|i} | dt| dt| d}} } |i|| | fqW|||RRItccRLtnumPartstpccPartsRtpcctdxtdy((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt_parse_compositess*   , cCshtd6td6}hhd6hd6}xv|i}|pPn|i}t|djoq+n|id}||jo|||||RR@tl((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt_parse_optionals     cCsOt|t|}t|\}}t|}||||d|dfS(s Parse the Adobe Font Metics file in file handle *fh*. Return value is a (*dhead*, *dcmetrics*, *dkernpairs*, *dcomposite*) tuple where *dhead* is a :func:`_parse_header` dict, *dcmetrics* is a :func:`_parse_composites` dict, *dkernpairs* is a :func:`_parse_kern_pairs` dict (possibly {}), and *dcomposite* is a :func:`_parse_composites` dict (possibly {}) ii(RRARNRb(Rtdheadtdcmetrics_asciitdcmetrics_namet doptional((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt parse_afms   tAFMcBseZdZedZdZdZdZedZedZ dZ edZ d Z d Z d Zd Zd ZdZdZdZdZdZdZdZRS(cCsLt|\}}}}}||_||_||_||_||_dS(s8 Parse the AFM file in file object *fh* N(Rgt_headert_kernt_metricst_metrics_by_namet _composite(tselfRRcRdRet dkernpairst dcomposite((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt__init__"s     cCs1|pt|}n|i|\}}}|S(N(tordRk(RntctisordRKRLRM((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_bbox_char/scCs t|pdSd}d}d}d}x|D]}|djoq1n|it|\}}} | \} } } } y|i||f}Wntj o d}nX|||7}| | }||jo |}n| }||jo |}q1q1W|||fS(sn Return the string width (including kerning) and string height as a (*w*, *h*) tuple. igeAs (iiN(R8tNoneRkRrRjR<(RnRttotalwtnamelasttminytmaxyRsRKRLRMRatbtwthtkptthismaxtthismin((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytstring_width_height4s0      c Cst|pdSd}d}d}d}d}t|tp|i}nx(|D] }|djoqWntit|d}y|i|\} } Wn,t j o d}|i|\} } nX| \} } } }| |jo | }ny|i ||f}Wnt j o d}nX|| |7}| |}||jo |}n| }||jo |}qWqWW|||||| fS(s0 Return the string bounding box igeAs tquestion(iiiiN( R8Rvt isinstancetunicodetdecodeRtgetRrRlR<Rj(RnRRwRxRyRztleftRsRLRKRMRaR{R|R}R~RR((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_str_bbox_and_descentRsD       cCs|i|d S(s0 Return the string bounding box i(R(RnR((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_str_bboxxscCs1|pt|}n|i|\}}}|S(sG Get the name of the character, ie, ';' is 'semicolon' (RrRk(RnRsRtRKRLRM((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_name_char~scCs1|pt|}n|i|\}}}|S(s[ Get the width of the character from the character metric WX field (RrRk(RnRsRtRKRLRM((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_width_charscCs|i|\}}|S(sL Get the width of the character from a type1 character name (Rl(RnRLRKRM((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_width_from_char_namescCs5|pt|}n|i|\}}}|dS(su Get the height of character *c* from the bounding box. This is the ink height (space is 0) i(RrRk(RnRsRtRKRLRM((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_height_charscCs/|i||i|}}|i||S(s_ Return the kerning pair distance (possibly 0) for chars *c1* and *c2* (Rtget_kern_dist_from_name(RnRRRStname1tname2((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_kern_distscCs$y|i||fSWndSXdS(se Return the kerning pair distance (possibly 0) for chars *name1* and *name2* iN(Rj(RnRR((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyRscCs |idS(s'Return the font name, eg, 'Times-Roman'R(Ri(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_fontnamescCs4|iid}|djo|id}n|S(s,Return the font full name, eg, 'Times-Roman'RRN(RiRRv(RnRL((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_fullnames cCsI|iid}|dj o|S|i}d}ti|d|S(s(Return the font family name, eg, 'Times'R sY(?i)([ -](regular|plain|italic|oblique|bold|semibold|light|ultralight|extra|condensed))+$R5N(RiRRvRtretsub(RnRLtextras((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_familynames   cCs |idS(s-Return the font weight, eg, 'Bold' or 'Roman'R!(Ri(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_weightscCs |idS(sReturn the fontangle as floatR"(Ri(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_anglescCs |idS(sReturn the cap height as floatR*(Ri(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_capheightscCs |idS(sReturn the xheight as floatR,(Ri(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt get_xheightscCs |idS(s'Return the underline thickness as floatR&(Ri(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_underline_thicknessscCs|iiddS(su Return the standard horizontal stem width as float, or *None* if not specified in AFM file. R/N(RiRRv(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_horizontal_stem_widthscCs|iiddS(ss Return the standard vertical stem width as float, or *None* if not specified in AFM file. R0N(RiRRv(Rn((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pytget_vertical_stem_widths(t__name__t __module__RqRRuRRRRRRRRRRRRRRRRRRR(((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyRh s*   &             t__main__s!/usr/local/share/fonts/afms/adobesJohn Hunter is the Man!((#t__doc__R:tosRt_mathtext_dataRRFRtfloatR tstrR6R R RRRARNRTR]RbRgRhRtpathnametlistdirtfnametfiletpathtjoinRtafmRR|R}(((s4/usr/lib64/python2.6/site-packages/matplotlib/afm.pyt#s.$     D " "