
    ͏kh                     R    d dl mZ d dlmZ ddlmZ  G d dej
                        Zy)    )BytesIO)cffLib   )DefaultTablec                   B    e Zd ZdZddZd Zd Zd Zd Zd Z	d	 Z
d
 Zy)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                     t         j                   j                  | |       t        j                         | _        d| _        y )NF)r   __init__r   
CFFFontSetcff_gaveGlyphOrder)selftags     Y/var/www/teggl/fontify/venv/lib/python3.12/site-packages/fontTools/ttLib/tables/C_F_F_.pyr
   ztable_C_F_F_.__init__   s0    !!**45$$&$    c                     | j                   j                  t        |      |d       t        | j                         dk(  sJ d       y )NFisCFF2r   z&can't deal with multi-font CFF tables.)r   	decompiler   len)r   dataotFonts      r   r   ztable_C_F_F_.decompile   s;    74=&?488}!K#KK!r   c                 r    t               }| j                  j                  ||d       |j                         S )NFr   )r   r   compilegetvalue)r   r   fs      r   r   ztable_C_F_F_.compile   s.    IF51zz|r   c                 f    t        | j                  | j                  j                  d      d      ryy)Nr   ROSFT)hasattrr   	fontNames)r   s    r   haveGlyphNamesztable_C_F_F_.haveGlyphNames$   s*    488DHH..q12E:r   c                     | j                   rddlm} |j                  d      d| _         | j                  | j                  j
                  d      j                         S )Nr   )ttLibzillegal use of getGlyphOrder()T)r   	fontToolsr#   
TTLibErrorr   r    getGlyphOrder)r   r#   s     r   r&   ztable_C_F_F_.getGlyphOrder*   sO    '""#CDD#xx**1-.<<>>r   c                      y N )r   
glyphOrders     r   setGlyphOrderztable_C_F_F_.setGlyphOrder2   s    r   c                 :    | j                   j                  |       y r(   )r   toXML)r   writerr   s      r   r-   ztable_C_F_F_.toXML7   s    vr   c                     t        | d      st        j                         | _        | j                  j	                  ||||       y )Nr   )r   r   r   r   fromXML)r   nameattrscontentr   s        r   r0   ztable_C_F_F_.fromXML:   s4    tU#((*DHugv6r   r(   )__name__
__module____qualname____doc__r
   r   r   r!   r&   r+   r-   r0   r)   r   r   r   r      s0    %
L
?
7r   r   N)ior   r$   r    r   r   r)   r   r   <module>r:      s       77<,, 77r   