PDF: Add missing 'fontName'.
And set 'registerFontFamily(...)' to use bold/italic in regular paragraphs.
This commit is contained in:
parent
77c168f337
commit
5f202c22a7
@ -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,
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user