1
0
Fork 0
mirror of https://gitlab.com/oloturia/fumcaso.git synced 2024-11-01 01:38:16 +01:00

Separated 1 character text from 2 character text

The first two elements, or four elements, after the index are the coords of where the text is written
Added multiple lines
This commit is contained in:
oloturia 2019-09-13 02:01:21 +02:00
parent 86d3f0794f
commit 2cf8315c58
3 changed files with 53 additions and 38 deletions

19
r2text.csv Normal file
View file

@ -0,0 +1,19 @@
B00.0.png;
B00.1.png;
B00.2.png;
B01.png;
B02.png;
B03.png;
B04.png;
B05.png;
B06.png;
B07.png;
B08.png;
B09.png;
B10.png;
B11.png;
B12.png;
B13.png;
B14.png;
B15.png;
B16.png;
1 B00.0.png
2 B00.1.png
3 B00.2.png
4 B01.png
5 B02.png
6 B03.png
7 B04.png
8 B05.png
9 B06.png
10 B07.png
11 B08.png
12 B09.png
13 B10.png
14 B11.png
15 B12.png
16 B13.png
17 B14.png
18 B15.png
19 B16.png

View file

@ -7,11 +7,22 @@ import random
def fetchText(indText): def fetchText(indText):
with open("rtext.csv") as rtext: with open("rtext.csv") as rtext:
csvReader = csv.reader(rtext) csvReader = csv.reader(rtext,delimiter=';')
for row in csvReader: for row in csvReader:
if (row[0]==indText): if row[0]==indText:
return row[random.randint(1,len(row)-1)] return row[1],row[2],row[random.randint(3,len(row)-1)].replace('@','\n')
def fetch2Text(indText):
with open("r2text.csv") as rtext:
csvReader = csv.reader(rtext,delimiter=';')
for row in csvReader:
if row[0]==indText:
rand1 = random.randint(5,len(row)-1)
if rand1 %2 == 0:
rand1 +=1
rand2 = rand1+1
return row[1],row[2],row[3],row[4],row[rand1].replace('@','\n'),row[rand2].replace('@','\n')
def fetchVign(): def fetchVign():
starts = [] starts = []
startdest = [] startdest = []
@ -38,9 +49,13 @@ def writeStrip(story):
vign = Image.open(indVign) vign = Image.open(indVign)
addtext = ImageDraw.Draw(vign) addtext = ImageDraw.Draw(vign)
fnt = ImageFont.truetype("ubuntu.ttf",16) fnt = ImageFont.truetype("ubuntu.ttf",16)
textVign = fetchText(indVign) if indVign[0] == 'A':
print(textVign) textVign = fetchText(indVign)
addtext.text((268,77),textVign,fill="#000000",font=fnt) addtext.multiline_text((int(textVign[0]),int(textVign[1])),textVign[2],fill="#000000",font=fnt,align="center")
else:
textVign = fetch2Text(indVign)
addtext.multiline_text((int(textVign[0]),int(textVign[1])),textVign[4],fill="#000000",font=fnt,align="center")
addtext.multiline_text((int(textVign[2]),int(textVign[3])),textVign[5],fill="#000000",font=fnt,align="center")
vign.show() vign.show()
if __name__ == "__main__": if __name__ == "__main__":

View file

@ -1,32 +1,13 @@
A00.png,Che giornata \ndel cacchio\n oggi,C'è nessuno?,Come vorrei\nundolciume,Il telefono non prende,Hey!,Bobby; dove sei?,Ciccioli di mare A00.png;268;77;Che giornata@del cacchio@oggi;C'è nessuno?;Come vorrei@undolciume;Il telefono non prende;Hey!;Bobby, dove sei?;Ciccioli di mare
A01.png, A01.png;
A02.png, A02.png;
A03.png, A03.png;
A04.png, A04.png;
A05.png, A05.png;
A06.png, A06.png;
A07.png, A07.png;
A08.png, A08.png;
A09.png, A09.png;
A10.png, A10.png;
A11.png, A11.png;
A12.png, A12.png;
B00.0.png,
B00.1.png,
B00.2.png,
B01.png,
B02.png,
B03.png,
B04.png,
B05.png,
B06.png,
B07.png,
B08.png,
B09.png,
B10.png,
B11.png,
B12.png,
B13.png,
B14.png,
B15.png,
B16.png,

1 A00.png,Che giornata \ndel cacchio\n oggi,C'è nessuno?,Come vorrei\nundolciume,Il telefono non prende,Hey!,Bobby; dove sei?,Ciccioli di mare A00.png;268;77;Che giornata@del cacchio@oggi;C'è nessuno?;Come vorrei@undolciume;Il telefono non prende;Hey!;Bobby, dove sei?;Ciccioli di mare
2 A01.png, A01.png;
3 A02.png, A02.png;
4 A03.png, A03.png;
5 A04.png, A04.png;
6 A05.png, A05.png;
7 A06.png, A06.png;
8 A07.png, A07.png;
9 A08.png, A08.png;
10 A09.png, A09.png;
11 A10.png, A10.png;
12 A11.png, A11.png;
13 A12.png, A12.png;
B00.0.png,
B00.1.png,
B00.2.png,
B01.png,
B02.png,
B03.png,
B04.png,
B05.png,
B06.png,
B07.png,
B08.png,
B09.png,
B10.png,
B11.png,
B12.png,
B13.png,
B14.png,
B15.png,
B16.png,