|
Server : Apache System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64 User : equistyl ( 1341) PHP Version : 8.1.30 Disable Function : NONE Directory : /lib64/python2.7/site-packages/matplotlib/ |
Upload File : |
�
r`]c @ s� d Z d d l m 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 d l Z e j d d k r� d � Z
n 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����( t print_functionNi i c C s | S( N( ( t x( ( s: /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyt ord# s t 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 st t | t � r- t | � d k r- | | _ n9 t | d � � } | j | � } Wd QX| 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 _splitt _parse( t selft inputt filet data( ( s: /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyt __init__6 s !c C sI | j � } | j d � s | Sd } xt | � d k rD| j d � sf 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 | � j d
� ^ q� � 7} q( | d k r1Pq( t d | � � q( W| S( sH
Read the font from a file, decoding into usable parts.
s �t i s+ Broken pfb file (expected byte 128, got %d)i i s <ii s %02xt asciii s# Unknown segment type %d in pfb file( i i ( t readt
startswithR t RuntimeErrorR t structt unpackt joint encode( R R t rawdataR t typet lengtht segmentt char( ( s: /usr/lib64/python2.7/site-packages/matplotlib/type1font.pyR D s.
0c
C sK | j d � } | t d � 7} x | | d k r? | d 7} q"