pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

Custom Font

Open venugopalangithub opened this issue 12 years ago • 1 comments

Hi bpampuch, I am new to pdfmake.I tried custom font in pdfmake like explained in issue 33,it is having 3 steps for custom font rendering in PDF, but i got blank space in that pdf for that particular word, i attached the PDF(converted to png document) document for your reference and my code.Please check and tell what i did wrong.Please guide how to use custom font in pdfmake.Thanks in advance.

This is my code,

pdfMake.font={ Roboto: { normal: 'examples/fonts/Roboto-Regular.ttf', bold: 'examples/fonts/Roboto-Medium.ttf', italics: 'examples/fonts/Roboto-Italic.ttf', bolditalics: 'examples/fonts/Roboto-Italic.ttf' }, lohit: { normal: 'examples/fonts/lohit-Regular.ttf', bold: 'examples/fonts/lohit-Medium.ttf', italics: 'examples/fonts/lohit-Italic.ttf', bolditalics: 'examples/fonts/lohit-Italic.ttf' } } var docDefinition = { content: ("Test Tamil கிருஷ்ணன் Word"), Style: { font: 'lohit' } }; pdfMake.createPdf(docDefinition).open();

Thanks, Venu

venugopalangithub avatar Sep 18 '14 05:09 venugopalangithub

if you want to change styles globally, you should use defaultStyle property instead of Style

bpampuch avatar Oct 11 '14 20:10 bpampuch