File: //usr/share/inkscape/extensions/svgfont2layers.pyo
�
��Yc @ si d Z d d l Z d d l Z d d l Z d e j f d � � YZ e d k re e � Z e j � n d S( s�
Copyright (C) 2011 Felipe Correa da Silva Sanches <juca@members.fsf.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
i����Nt SVGFont2Layersc B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c C sK d | _ t j j | � | j j d d d d d d d d t d
d �d S( Ni s
--limitglyphst actiont storet typet inkboolt destt limitglyphst defaultt helpsh Load only the first 30 glyphs from the SVGFont (otherwise the loading process may take a very long time)( t countt inkext Effectt __init__t OptionParsert
add_optiont True( t self( ( s0 /usr/share/inkscape/extensions/svgfont2layers.pyR s c C s� | j j t j d d � � } t j j | t j d d � � } | j t j d d � | � | j d d � | j d d t | � � d S(
Nt namedviewt sodipodit guidet labelt inkscapet orientations 0,1t positions 0,( t svgt findR
t addNSt etreet
SubElementt sett str( R R t yR R ( ( s0 /usr/share/inkscape/extensions/svgfont2layers.pyt create_horiz_guideline! s
!c C s7 | j | � } | d k r3 t j j | | � } n | S( N( R t NoneR
R R ( R t
parentnodet nodetypet node( ( s0 /usr/share/inkscape/extensions/svgfont2layers.pyt
get_or_create( s c C sR t j | � } t j | d d � t j | d t | � t | � � t j | � S( Ni i����i ( t
simplepatht parsePatht scalePatht
translatePatht intt
formatPath( R t dt emsizet baselinet pathdata( ( s0 /usr/share/inkscape/extensions/svgfont2layers.pyt flip_cordinate_system. s #c C s� | j j � | _ | j j t j d d � � | _ | j j t j d d � � } | j d � } | j d � } | d k r� d } n | j t j d d � � } | j d � } | j d � } | j d
� } | j d � } | j d � } | j j d
| � | j
d t | � � | j
d t | � t | � � | j
d t | � t | � � | j
d t | � t | � � | j
d t | � t | � � | j t j d d � � }
t
} x�|
D]�} | j d � }
|
d k r�q�n t j j | j t j d d � � } | j t j d d � d |
� | j t j d d � d � | s[| j d d � n t } | j t j d d � � } xu | D]m } | j d � } | d k r�q�n | j | | | � } t j j | t j d d � � } | j d | � q�W| j d � } | d k rq�n | j | | | � } t j j | t j d d � � } | j d | � | j d 7_ | j j r�| j d k r�Pq�q�Wd S(! Nt defsR t fonts horiz-adv-xs horiz-origin-yi s font-faces units-per-ems
cap-heights x-heightt ascentt descentt widthR. t ascendert capst xheightt descendert glypht unicodet gR R s GlyphLayer-t groupmodet layert styles display:nonet pathR, i i ( t documentt getrootR R R
R R1 t getR! R R R* t findallR R R t FalseR0 R t optionsR ( R R2 t setwidthR. t fontfaceR- R7 R8 R6 R9 t glyphst first_glyphR: t unicode_charR>