Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom font reverting to Roboto #591

Closed
JohnWemmick opened this issue May 24, 2016 · 1 comment
Closed

Custom font reverting to Roboto #591

JohnWemmick opened this issue May 24, 2016 · 1 comment

Comments

@JohnWemmick
Copy link

JohnWemmick commented May 24, 2016

Hey, I'm an intern working for a company this summer, and we're trying to use pdfmake to generate a completion certificate on their Articulate Storyline 2 course. I am very new to coding, but I've managed to stumble through this far. I'm trying to use my own fonts and I was able to make a vfs_fonts.js, put the .ttf files into the fonts folder, and I used the following code to set the font in my javascript:

pdfMake.fonts = {
  certificateFont: {
    normal: 'Abbeyline.ttf',
    bold: 'Abbeyline.ttf',
    italics: 'Abbeyline.ttf',
    bolditalics: 'Abbeyline.ttf'
  },
  signatureFont: {
    normal: 'DSCaslonGotisch.ttf',
    bold: 'DSCaslonGotisch.ttf',
    italics: 'DSCaslonGotisch.ttf',
    bolditalics: 'DSCaslonGotisch.ttf'
  },
  textFont: {
    normal: 'CrimsonText-Roman.ttf',
    bold: 'CrimsonText-Bold.ttf',
    italics: 'CrimsonText-Italic.ttf',
    bolditalics: 'CrimsonText-BoldItalic.ttf'
  }
};

and I set the default style to 'textFont' before calling the generatePDF function

My certificate loads just fine, but the text is still Roboto. I have tried moving the pdfMake.fonts around, checked for syntax errors, peruised message boards, but haven't found a solution thus far. On #33 user @Chaitanya2207 seemed to be having a similar issue as me, but his question was never answered. Any help would be appreciated.

Thank you!

@JohnWemmick
Copy link
Author

Found the problem. It was a problem with Articulate, not the pdfMake

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

No branches or pull requests

1 participant