HOW to register a "bold italic" font

Posted by: rmoulin on 17 October 2019, 5:28 pm EST

  • Posted 17 October 2019, 5:28 pm EST

    When we export a PDF document, we use registerFont to provide the fonts.
    it works perfectly for "normal", "bold" and "italic" fonts but not for "bold italic" font.

    Do you know how we can do ?




    Tapez un message
  • Marked as Answer

    Replied 20 October 2019, 6:17 pm EST

    Hi,

    For bold italic font you need to register font with boldItalic property. Please refer to the following code snippet:
    var font = {
    normal: "base64 string of regular font",
    bold: "base64 string of bold font",
    italic: "base64 string of italic font",
    boldItalic: "base64 of bold italic font
    };
    GC.Spread.Sheets.PDF.PDFFontsManager.registerFont("fontName", font);


    Regards
    Sharad
  • Replied 21 October 2019, 1:29 am EST

    Thank you, it works.

    We have a problem with the Helvetica font, it does not register like other fonts.

    Do you have a solution ?

    best regard
  • Replied 21 October 2019, 4:36 pm EST

    We are glad to be able to help.

    Please let us know the exact issue you facing with the font? Also, could you share the font file with which you are facing the issue? If the font file is a private/paid font and you cannot share it on the public forum then you may create a case at our private support portal(https://supportone.componentone.com) and share the file.
  • Replied 22 October 2019, 7:49 pm EST

    Here the font.

    Best regards

  • Replied 22 October 2019, 7:50 pm EST

    Helvetica.ttc.zip
  • Replied 23 October 2019, 5:51 pm EST

    We are able to replicate the issue using the attached font file and hence we have forwarded it to the concerned team for further investigation of the issue. The internal tracking ID for the issue is SJS-2236. We will keep you posted with any updates regarding the same.
    Also, Helvetica is one of the standard/pre-defined fonts, so you don't need to register it again. Following is a list of all predefined fonts:
    'Courier'
    'Courier-Bold'
    'Courier-Oblique'
    'Courier-BoldOblique'
    'Helvetica'
    'Helvetica-Bold'
    'Helvetica-Oblique'
    'Helvetica-BoldOblique'
    'Symbol'
    'Times-Roman'
    'Times-Bold'
    'Times-Italic'
    'Times-BoldItalic'
    'ZapfDingbats'
  • Replied 29 October 2019, 7:27 pm EST

    Hi,

    The dev team has confirmed that the .ttc font file is currently not supported by SpreadJS.As a workaround, you would have to convert .ttc to .ttf, you could get the online converter from google. For example this one: https://transfonter.org/ttc-unpack

    Regards
  • Replied 25 November 2019, 6:16 pm EST

    Hi,

    Thanks for the answer, and the .otf font files are they supported ?

    Here is a font that does not work.

    Regards
  • Replied 25 November 2019, 6:16 pm EST

    otf font
  • Replied 25 November 2019, 6:17 pm EST

    vonique 92.otf
  • Replied 26 November 2019, 7:15 pm EST

    Hi,

    SpreadJS supports .ttf and .otf fonts. Could you please share the font file for us to test?

    Regards
  • Replied 26 November 2019, 9:41 pm EST

    Hi,

    vonique92.otf works now, we can close
  • Replied 27 November 2019, 3:36 pm EST

    Thank you for informing us about the same.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels