git.schokokeks.org
Repositories
Help
Report an Issue
invoice.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
d660273
Branches
Tags
factur-x_localdata
master
invoice.git
src
rechnung
Invoice
metrics.py
Trennung von Firmen-spezifischem Code und allgemeinem Code
Bernd Wurst
commited
d660273
at 2008-04-15 15:48:50
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 'Vera' not in pdfmetrics._fonts.keys(): pdfmetrics.registerFont(TTFont("Vera", "Vera.ttf")) pdfmetrics.registerFont(TTFont("Vera-Bold", "VeraBd.ttf")) pdfmetrics.registerFont(TTFont("Vera-Oblique", "VeraIt.ttf")) pdfmetrics.registerFont(TTFont("Vera-BoldOblique", "VeraBI.ttf")) return (cm, A4) (cm, A4) = setup() (page_width, page_height) = A4 font = 'Vera' # Set default font size default_font_size = 9 # 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