split.py revision 20e9b1f7cd4a3104e934c17ed5536a259054ad84
'''
Copyright (C) 2009 Karlisson Bezerra, contato@nerdson.com
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
'''
import inkex
help="type of split")
help="Preserve original")
"""Returns a list of lines"""
lines = []
count = 1
for n in node:
break
else:
continue
#handling flowed text nodes
try:
from simplestyle import parseStyle
except:
fontsize = "12px"
#selects the flowRegion's child (svg:rect) to get @X and @Y
count += 1
else:
break
#now let's convert flowPara into tspan
else:
return lines
"""Returns a list of words"""
words = []
#Function to recursively extract text
words = []
for n in elem:
if n.tail:
return words
#if text has more than one line, iterates through elements
if not lines:
return words
#gets the position of text node
#gets the font size. if element doesn't have a style attribute, it assumes font-size = 12px
try:
from simplestyle import parseStyle
except:
fontsize = "12px"
#extract and returns a list of words
prev_len = 0
#creates new text nodes for each string in words_list
for word in words_list:
#positioning new text elements
return words
"""Returns a list of letters"""
letters = []
if not words:
return letters
#gets the font size. If element doesn't have a style attribute, it assumes font-size = 12px
try:
import simplestyle
except:
fontsize = "12px"
#for each letter in element string
x += fs
return letters
"""Applies the effect"""
#checks if the selected elements are text nodes
break
else:
if split_type == "line":
elif split_type == "word":
elif split_type == "letter":
for n in nodes:
#preserve original element
b = Split()
b.affect()