git.schokokeks.org
Repositories
Help
Report an Issue
invoice.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
c589d73
Branches
Tags
factur-x_localdata
master
invoice.git
src
rechnung
Invoice
metrics.py
Umstellung von Bitstream Vera auf DejaVu
Bernd Wurst
commited
c589d73
at 2017-06-20 16:08:02
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.keys(): 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