git.schokokeks.org
Repositories
Help
Report an Issue
invoice.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
8f583de
Branches
Tags
factur-x_localdata
master
invoice.git
src
rechnung
Invoice
metrics.py
automatische code-style-fixes
Bernd Wurst
commited
8f583de
at 2018-07-05 14:34:21
metrics.py
Blame
History
Raw
def setup(): from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from reportlab.pdfbase.ttfonts import TTFont from reportlab.pdfbase import pdfmetrics if 'DejaVuSans' not in pdfmetrics._fonts: pdfmetrics.registerFont(TTFont("DejaVuSans", "DejaVuSans.ttf")) pdfmetrics.registerFont(TTFont("DejaVuSans-Bold", "DejaVuSans-Bold.ttf")) pdfmetrics.registerFont(TTFont("DejaVuSans-Oblique", "DejaVuSans-Oblique.ttf")) pdfmetrics.registerFont(TTFont("DejaVuSans-BoldOblique", "DejaVuSans-BoldOblique.ttf")) return (cm, A4) (cm, A4) = setup() (page_width, page_height) = A4 font = 'DejaVuSans' # Set default font size default_font_size = 8 # set margins topmargin = 2 * cm bottommargin = 2.5 * cm leftmargin = 2 * cm rightmargin = 2 * cm topcontent = page_height - topmargin leftcontent = leftmargin rightcontent = page_width - rightmargin bottomcontent = bottommargin rightcolumn = 13 * cm address_width = 8.5 * cm address_height = 5.0 * cm