Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

How to support and add multiple font files? #26

Open
ashakoshti1988 opened this issue Nov 6, 2017 · 6 comments
Open

How to support and add multiple font files? #26

ashakoshti1988 opened this issue Nov 6, 2017 · 6 comments

Comments

@ashakoshti1988
Copy link

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

@sphilee
Copy link
Owner

sphilee commented Nov 6, 2017

@ashakoshti1988

  1. Download this project.
  2. Copy your fonts into the ./fonts subdirectory.
  3. Run node makeFonts.js to create a new ./dist/default_vfs.js.
  4. Include your new ./dist/default_vfs.js file in your code.

If not, please ask me again.

@ashakoshti1988
Copy link
Author

@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

@sphilee
Copy link
Owner

sphilee commented Nov 7, 2017

Could you download version rc.6?
@ashakoshti1988

@ashakoshti1988
Copy link
Author

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

@sphilee
Copy link
Owner

sphilee commented Nov 8, 2017

@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

@ankitcts
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants