o
    _h                     @   s:   d dl mZ d dlmZ ddlmZ G dd dejZdS )    )BytesIO)cffLib   )DefaultTablec                   @   sR   e Zd ZdZdddZdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd ZdS )table_C_F_F_a  Compact Font Format table (version 1)

    The ``CFF`` table embeds a CFF-formatted font. The CFF font format
    predates OpenType and could be used as a standalone font file, but the
    ``CFF`` table is also used to package CFF fonts into an OpenType
    container.

    .. note::
       ``CFF`` has been succeeded by ``CFF2``, which eliminates much of
       the redundancy incurred by embedding CFF version 1 in an OpenType
       font.

    See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff
    Nc                 C   s"   t j | | t | _d| _d S )NF)r   __init__r   
CFFFontSetcff_gaveGlyphOrder)selftag r   Q/var/www/html/myenv/lib/python3.10/site-packages/fontTools/ttLib/tables/C_F_F_.pyr      s   

ztable_C_F_F_.__init__c                 C   s0   | j jt||dd t| j dksJ dd S )NFisCFF2r   z&can't deal with multi-font CFF tables.)r	   	decompiler   len)r   dataotFontr   r   r   r      s   ztable_C_F_F_.decompilec                 C   s    t  }| jj||dd | S )NFr   )r   r	   compilegetvalue)r   r   fr   r   r   r      s   ztable_C_F_F_.compilec                 C   s    t | j| jjd  drdS dS )Nr   ROSFT)hasattrr	   	fontNames)r   r   r   r   haveGlyphNames$   s   ztable_C_F_F_.haveGlyphNamesc                 C   s8   | j rddlm} |dd| _ | j| jjd   S )Nr   )ttLibzillegal use of getGlyphOrder()T)r
   	fontToolsr   
TTLibErrorr	   r   getGlyphOrder)r   r   r   r   r   r   *   s
   
ztable_C_F_F_.getGlyphOrderc                 C   s   d S Nr   )r   
glyphOrderr   r   r   setGlyphOrder2   s   ztable_C_F_F_.setGlyphOrderc                 C   s   | j | d S r    )r	   toXML)r   writerr   r   r   r   r#   7   s   ztable_C_F_F_.toXMLc                 C   s*   t | ds
t | _| j|||| d S )Nr	   )r   r   r   r	   fromXML)r   nameattrscontentr   r   r   r   r%   :   s   

ztable_C_F_F_.fromXMLr    )__name__
__module____qualname____doc__r   r   r   r   r   r"   r#   r%   r   r   r   r   r      s    
r   N)ior   r   r    r   r   r   r   r   r   <module>   s    