Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def textGenerator(data, fn, fs):
i = 1
for word in re.split('\s+', data):
if word:
yield Word(
text="[%d|%s]" % (i, word),
fontName=fn,
fontSize=fs
)
yield Space(
fontName=fn,
fontSize=fs
)
i += 1
def makeSpecial(fn="Times-Roman", fs=10):
return [
Space(
fontName=fn,
fontSize=fs),
Word(
text="TrennbarTrennbar",
pairs=[("Trenn-", "barTrennbar")],
fontName=fn,
fontSize=fs),
Space(
fontName=fn,
fontSize=fs),
Word(
text="Normal",
color=Color(1, 0, 0),
fontName=fn,
fontSize=fs),
Space(
fontName=fn,
fontSize=fs),
BoxBegin(
fontName=fn,
fontSize=fs,
underline=True,
strike=True),
Word(
text="gGrößer",
fontName=fn,
fontSize=fs * 1.5),
def makeSpecial(fn="Times-Roman", fs=10):
return [
Space(
fontName=fn,
fontSize=fs),
Word(
text="TrennbarTrennbar",
pairs=[("Trenn-", "barTrennbar")],
fontName=fn,
fontSize=fs),
Space(
fontName=fn,
fontSize=fs),
Word(
text="Normal",
color=Color(1, 0, 0),
fontName=fn,
fontSize=fs),
Space(
fontName=fn,
fontSize=fs),
BoxBegin(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName="Times-Bold",
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
Word(
text="jItalic",
fontName="Times-Italic",
fontSize=fs),
Space(
fontName=fn,
fontSize=fs),
# <span style="border: 1px solid red;">ipsum <span style="border: 1px solid green; padding: 4px; padding-left: 20px; background: yellow; margin-bottom: 8px; margin-left: 10px;">
# Lo<font size="12pt">re</font>m</span> <span style="background:blue; height: 30px;">ipsum</span> Lorem</span>
BoxBegin(
fontName=fn,
fontSize=fs,
**makeBorder(0.5, "solid", Color(0, 1, 0))),
Word(
text="Lorem",
fontName="Times-Bold",
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
Word(