Created
July 10, 2014 19:03
-
-
Save RemyPorter/5f8ab636c2cadb34119d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xindent = str(11.553572) | |
ystart = 894.94238 | |
incr = 907.44238 - 894.94238 | |
def lines(text): | |
words = text.split() | |
result = "" | |
currentLeg = "" | |
count = 0 | |
for w in words: | |
if (len(currentLeg) + len(w) > 42): | |
count += 1 | |
ystep = ystart + (incr * count) | |
result += '<tspan x="' + xindent + '" y="' + str(ystep) + '">' + currentLeg + '</tspan>' | |
currentLeg = "" | |
currentLeg += w + " " | |
count += 1 | |
ystep = ystart + (incr * count) | |
result += '<tspan x="' + xindent + '" y="' + str(ystep) + '">' + currentLeg + '</tspan>' | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment