git.schokokeks.org
Repositories
Help
Report an Issue
invoice.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
25674c2
Branches
Tags
factur-x_localdata
master
invoice.git
Invoice
metrics.py
separated from keks-tools
Bernd Wurst
commited
25674c2
at 2024-02-14 08:20:12
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