Commit a48cf4f5 authored by Amélie Dumont's avatar Amélie Dumont

footnotes added

parent b0455485
from flat import font, text, strike, document, view, image, group
def layout(title, *paragraphs):
# Vollkorn by Friedrich Althausen
# http://friedrichalthausen.de/vollkorn/
regular = font.open('Anaktoria_hint.ttf')
bold = font.open('Anaktoria_hint.ttf')
body = strike(regular).size(12, 16)
headline = strike(bold).size(30, 20)
headline = strike(bold).size(14, 16)
fol = strike(bold).size(10, 20)
notes = strike(bold).size(8, 10)
illustration = image.open("en-tete.jpg")
pieces1 = [
headline.paragraph(title.center(30))
headline.paragraph(title.center(20))
]
pieces2 = [
body.paragraph('')
]
pieces2.extend(body.paragraph(p) for p in paragraphs)
doc = document(148, 200, 'mm')
page_titre = doc.addpage()
page = doc.addpage()
block = page_titre.place(text(pieces1))
foliotage = page.place(fol.text(""))
block = page.place(text(pieces1))
block2 = page.place(text(pieces2))
block_image = page.place(illustration)
block_image.frame(10,10,170,30)
block_image.fitwidth(85)
block.frame(0,7,200,140)
n_column = 0
note = ""
nbp = page.place(notes.text(" "))
folio = 1
while block.frame(30, 45, 110, 190).overflow():
n_column = 0
gravure = image.open("gravure.jpg")
while block.frame(15, 45, 50, 190).overflow():
block.lines()
while block2.frame(80, 70, 55, 115).overflow():
if n_column == 1:
block2.frame(73,70,55,115)
foliotage = page.place(fol.text("%s" % folio))
foliotage.frame(138, 187, 20, 20)
page = doc.addpage()
n_column = 0
folio += 1
if folio % 2 == 0:
foliotage.frame(138, 7, 20, 20)
block2.frame(83,30,55,115)
else:
foliotage.frame(7, 190, 20, 20)
pass
if folio == 2:
note = "Cynthie et Cynthien, surnoms de Diane et d’Apollon, que Latone enfanta sur le mont Cynthus, dans l’île de Délos."
nbp = page.place(notes.text("%s" % note))
nbp.frame(100, 17, 30, 20)
if folio == 3:
note = "Monts que les anciens plaçaient dans la Scythie hyperboréenne."
nbp = page.place(notes.text("%s" % note))
nbp.frame(10, 17, 30, 20)
if folio == 5:
block_gravure = page.place(gravure)
block_gravure.frame(10,10,170,30)
block_gravure.fitwidth(60)
elif n_column == 0:
block2.frame(20,70,55,115)
if folio % 2 == 0:
if folio % 2 == 0: # page impaire
block2.frame(10,30,55,115)
foliotage.frame(138, 7, 20, 20)
else:
foliotage.frame(10, 7, 20, 20)
n_column = 1
block2 = page.chain(block2)
else:
page_gravure = doc.addpage()
gravure = image.open("gravure.jpg")
block_gravure = page_gravure.place(gravure)
block_gravure.frame(35,109,170,30)
block_gravure.fitwidth(100)
block2.frame(83,30,55,115)
foliotage = page.place(fol.text("%s" % folio))
foliotage.frame(183, 10, 20, 20)
if folio % 2 == 0:
block2.frame(83,30,55,115)
foliotage.frame(138, 7, 20, 20)
return doc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment