margin_top and margin_bottom: new param in % of font_size

This commit is contained in:
Philipp Klaus 2017-01-04 14:14:56 +01:00
parent 06a9fee323
commit 808cc4aeba

View File

@ -64,9 +64,11 @@ def get_label_context(request):
'margin': int(d.get('margin', 10)), 'margin': int(d.get('margin', 10)),
'threshold': int(d.get('threshold', 70)), 'threshold': int(d.get('threshold', 70)),
'align': d.get('align', 'center'), 'align': d.get('align', 'center'),
'margin_top': float(d.get('margin_top', 0.24)),
'margin_bottom': float(d.get('margin_bottom', 0.45)),
} }
context['margin_top'] = int(context['font_size']*0.24) context['margin_top'] = int(context['font_size']*context['margin_top'])
context['margin_bottom'] = int(context['font_size']*0.45) context['margin_bottom'] = int(context['font_size']*context['margin_bottom'])
def get_font_path(font_family, font_style): def get_font_path(font_family, font_style):
try: try: