File: //usr/share/inkscape/extensions/replace_font.pyo
�
��Yc @ s� d Z d d l Z d d l Z d d l Z d d l Z d d d d d g Z d d g Z d d
� Z d � Z d � Z
d
� Z d � Z d � Z
d � Z d d � Z d � Z d � Z d e j f d � � YZ e d k r� e � Z e j � n d S( s�
replace_font.py
Copyright (C) 2010 Craig Marshall, craig9 [at] gmail.com
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-----------------------
This script finds all fonts in the current drawing that match the
specified find font, and replaces them with the specified replacement
font.
It can also replace all fonts indiscriminately, and list all fonts
currently being used.
i����Ns! {http://www.w3.org/2000/svg}tspans {http://www.w3.org/2000/svg}texts$ {http://www.w3.org/2000/svg}flowRoots$ {http://www.w3.org/2000/svg}flowParas$ {http://www.w3.org/2000/svg}flowSpans font-familys -inkscape-font-specificationc C se t } | s t | � } n | ra x= t D]2 } | | k r( | | | <t | | � t } q( q( Wn | S( s�
Sets the font attribute in the style attribute of node, using the
font name stored in new_font. If the style dict is open already,
it can be passed in, otherwise it will be optned anyway.
Returns a dirty boolean flag
( t Falset get_stylet font_attributest set_stylet True( t nodet new_fontt stylet dirtyt att( ( s. /usr/share/inkscape/extensions/replace_font.pyt set_font, s
c C sq t } t | � } | rm xR t D]G } | | k r | | j � j � | k r t | | | � t } q q Wn | S( s�
Searches the relevant font attributes/styles of node for find, and
replaces them with replace.
Returns a dirty boolean flag
( R R R t stript lowerR
R ( R t findt replaceR R R ( ( s. /usr/share/inkscape/extensions/replace_font.pyt find_replace_font? s
(c C s | j t k o d | j k S( s[
Returns true if the tag in question is a "styled" element that
can hold text.
R ( t tagt text_tagst attrib( R ( ( s. /usr/share/inkscape/extensions/replace_font.pyt is_styled_textO s c C s
| j t k S( sS
Returns true if the tag in question is an element that
can hold text.
( R R ( R ( ( s. /usr/share/inkscape/extensions/replace_font.pyt is_textV s c C s'