jsPDF-CustomFonts-support
jsPDF-CustomFonts-support copied to clipboard
How to support and add multiple font files?
Hi,
As i want to use google Noto and Google CJK fonts for PDF generation.but all have different ttf files.so how i can i convert and give single ttf base 64 encoded files to jspdf custom font support? please help,as this is urgent. @sphilee
@ashakoshti1988
- Download this project.
- Copy your fonts into the ./fonts subdirectory.
- Run
node makeFonts.js
to create a new ./dist/default_vfs.js. - Include your new ./dist/default_vfs.js file in your code.
If not, please ask me again.
@sphilee i have downloaded project from release which is rc.5 .now i am not able to find ./fonts directory in that.even not able to find makeFonts.js in any subfolders..please specify which project are you talking about.or provide me the link to download?
@sphilee
Could you download version rc.6? @ashakoshti1988
yes got it..but my question is different.like first i used arial unicode fonts,which was having all characters of unicode.so only once i have to set
doc.setFont('Arial Unicode');
doc.text(15, 15, '안녕하세요 만나서 반갑습니다.');
now,Arial unicode is commercial one.so for my application redistribution i can't use that.for that i need single ttf file to supply for pdf generation.because in my application there will be mixture of characters of different languages and everytime i can't check each character and set the font accordingly.as it will be huge characeter set to export in pdf.so tell me how can i support and merge multiple font files in vfs_fonts.js? @sphilee
@ashakoshti1988 Um ... you want to create one font file that supports all languages, right? But Arial Unicode is not commercially available. So how about using this package to merge multiple fonts into a single ttf file? https://www.npmjs.com/package/fonteditor-core
Tried adding the Chinese font files. After incorporation the custom Chinese font files. The characters which the PDF gives as output has lot of characters missing.
All the chinese characters are not getting processed and printed in PDF.