Merge pull request #1295 from emanuelschuetze/pdf-fix

PDF: Added missing 'fontName'.
This commit is contained in:
Norman Jäckel 2014-05-19 09:57:50 +02:00
commit 38a4cf1bc3

View File

@ -20,9 +20,12 @@ pdfmetrics.registerFont(TTFont(
'Ubuntu', path_join(settings.SITE_ROOT, 'core/static/fonts/Ubuntu-R.ttf'))) 'Ubuntu', path_join(settings.SITE_ROOT, 'core/static/fonts/Ubuntu-R.ttf')))
pdfmetrics.registerFont(TTFont( pdfmetrics.registerFont(TTFont(
'Ubuntu-Bold', path_join(settings.SITE_ROOT, 'core/static/fonts/Ubuntu-B.ttf'))) 'Ubuntu-Bold', path_join(settings.SITE_ROOT, 'core/static/fonts/Ubuntu-B.ttf')))
pdfmetrics.registerFont(TTFont(
'Ubuntu-Italic', path_join(settings.SITE_ROOT, 'core/static/fonts/Ubuntu-RI.ttf')))
pdfmetrics.registerFont(TTFont( pdfmetrics.registerFont(TTFont(
'circlefont', path_join(settings.SITE_ROOT, 'core/static/fonts/circle.ttf'))) 'circlefont', path_join(settings.SITE_ROOT, 'core/static/fonts/circle.ttf')))
pdfmetrics.registerFontFamily('Ubuntu', normal='Ubuntu', bold='Ubuntu-Bold', italic='Ubuntu-Italic')
# set style information # set style information
PAGE_HEIGHT = defaultPageSize[1] PAGE_HEIGHT = defaultPageSize[1]
@ -33,6 +36,7 @@ PAGE_WIDTH = defaultPageSize[0]
stylesheet = StyleSheet1() stylesheet = StyleSheet1()
stylesheet.add(ParagraphStyle( stylesheet.add(ParagraphStyle(
name='Normal', name='Normal',
fontName='Ubuntu',
fontSize=10, fontSize=10,
leading=12, leading=12,
)) ))