File: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/type1font.pyo
�
�)�Uc @ sk d Z d d l j Z d d l Z d d l Z d d l Z d d l Z d d l Z d e f d � � YZ
d S( s�
This module contains a class representing a Type 1 font.
This version reads pfa and pfb files and splits them for embedding in
pdf files. It also supports SlantFont and ExtendFont transformations,
similarly to pdfTeX and friends. There is no support yet for
subsetting.
Usage::
>>> font = Type1Font(filename)
>>> clear_part, encrypted_part, finale = font.parts
>>> slanted_font = font.transform({'slant': 0.167})
>>> extended_font = font.transform({'extend': 1.2})
Sources:
* Adobe Technical Note #5040, Supporting Downloadable PostScript
Language Fonts.
* Adobe Type 1 Font Format, Adobe Systems Incorporated, third printing,
v1.1, 1993. ISBN 0-201-57044-0.
i����Nt Type1Fontc B s� e Z d Z d Z d � Z d � Z d � Z e j d � Z e j d � Z
e j d � Z e j d � Z e
d
� � Z d � Z e
d � � Z d
� Z RS( s�
A class representing a Type-1 font, for use by backends.
.. attribute:: parts
A 3-tuple of the cleartext part, the encrypted part, and the
finale of zeros.
.. attribute:: prop
A dictionary of font properties.
t partst propc C s} t | t � r- t | � d k r- | | _ nB t | d � } z | j | � } Wd | j � X| j | � | _ | j � d S( s�
Initialize a Type-1 font. *input* can be either the file name of
a pfb file or a 3-tuple of already-decoded Type-1 font parts.
i t rbN( t
isinstancet tuplet lenR t opent _readt closet _splitt _parse( t selft inputt filet data( ( sG /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/type1font.pyt __init__/ s !c C sF | j � } | j t d � � s% | Sd } xt | � d k rA| j t d � � so t d t | d � � n t | d � } | d k r� t j d | d d !� \ } | d d | !} | d | } n | d k r� | | 7} q. | d k r!| d j g | D] } d t | � ^ q� � 7} q. | d
k r1Pq. t d | � q. W| S(
sH
Read the font from a file, decoding into usable parts.
i� t i s+ Broken pfb file (expected byte 128, got %d)i i s <ii s %02xi s# Unknown segment type %d in pfb file( i i ( t readt
startswitht chrR t RuntimeErrort ordt structt unpackt join( R R t rawdataR t typet lengtht segmentt char( ( sG /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/type1font.pyR @ s0
'c
C s | j d � } | t d � 7} x | | d k r? | d 7} q"