File: //home/arjun/projects/env/lib/python3.10/site-packages/fontTools/__pycache__/tfmLib.cpython-310.pyc
o
we�7 � @ s� d Z ddlmZ ddlmZmZmZ dZee�ZdZ de � d�Z
de
� d �Zde� d
�Zde� d�Z
ee
�Zee�Zee�Zee
�ZdZg d
�Zg d�Zg d�ZdZdZdZdZdZdZdZdZdZdZdZ dZ!G dd� de"�Z#G dd� d�Z$e%dkr�ddl&Z&e$e&j'd �Z(e)d�*dd� de(j+� �de(j,� �de(j-� �de(j.� �d e(j/� �d!e(j0� �d"e(j1� �d#e(j2� �d$e(j3� �d%e(j4� �d&e(j5� �d'e(j6� �d(e(j7� �d)e(j8� �fD ��� e)e(� dS dS )*u1 Module for reading TFM (TeX Font Metrics) files.
The TFM format is described in the TFtoPL WEB source code, whose typeset form
can be found on `CTAN <http://mirrors.ctan.org/info/knuth-pdf/texware/tftopl.pdf>`_.
>>> from fontTools.tfmLib import TFM
>>> tfm = TFM("Tests/tfmLib/data/cmr10.tfm")
>>>
>>> # Accessing an attribute gets you metadata.
>>> tfm.checksum
1274110073
>>> tfm.designsize
10.0
>>> tfm.codingscheme
'TeX text'
>>> tfm.family
'CMR'
>>> tfm.seven_bit_safe_flag
False
>>> tfm.face
234
>>> tfm.extraheader
{}
>>> tfm.fontdimens
{'SLANT': 0.0, 'SPACE': 0.33333396911621094, 'STRETCH': 0.16666698455810547, 'SHRINK': 0.11111164093017578, 'XHEIGHT': 0.4305553436279297, 'QUAD': 1.0000028610229492, 'EXTRASPACE': 0.11111164093017578}
>>> # Accessing a character gets you its metrics.
>>> # “width” is always available, other metrics are available only when
>>> # applicable. All values are relative to “designsize”.
>>> tfm.chars[ord("g")]
{'width': 0.5000019073486328, 'height': 0.4305553436279297, 'depth': 0.1944446563720703, 'italic': 0.013888359069824219}
>>> # Kerning and ligature can be accessed as well.
>>> tfm.kerning[ord("c")]
{104: -0.02777862548828125, 107: -0.02777862548828125}
>>> tfm.ligatures[ord("f")]
{105: ('LIG', 12), 102: ('LIG', 11), 108: ('LIG', 13)}
� )�SimpleNamespace)�calcsize�unpack�unpack2a�
>
lf: h # length of the entire file, in words
lh: h # length of the header data, in words
bc: h # smallest character code in the font
ec: h # largest character code in the font
nw: h # number of words in the width table
nh: h # number of words in the height table
nd: h # number of words in the depth table
ni: h # number of words in the italic correction table
nl: h # number of words in the ligature/kern table
nk: h # number of words in the kern table
ne: h # number of words in the extensible character table
np: h # number of font parameter words
z12.20Fz;
>
checksum: L
designsize: �
z
z
codingscheme: 40p
z
family: 20p
zm
seven_bit_safe_flag: ?
ignored: x
ignored: x
face: B
zI
>
skip_byte: B
next_char: B
op_byte: B
remainder: B
)�SLANT�SPACE�STRETCH�SHRINK�XHEIGHT�QUAD�
EXTRASPACE)�NUM1�NUM2�NUM3�DENOM1�DENOM2�SUP1�SUP2�SUP3�SUB1�SUB2�SUPDROP�SUBDROP�DELIM1�DELIM2�
AXISHEIGHT)�DEFAULTRULETHICKNESS�
BIGOPSPACING1�
BIGOPSPACING2�
BIGOPSPACING3�
BIGOPSPACING4�
BIGOPSPACING5� � � � c s e Zd Z� fdd�Z� ZS )�TFMExceptionc s t � �|� d S �N)�super�__init__)�self�message�� __class__� �I/home/arjun/projects/env/lib/python3.10/site-packages/fontTools/tfmLib.pyr* � � zTFMException.__init__)�__name__�
__module__�__qualname__r* �
__classcell__r/ r/ r- r0 r'