Add bold version of a font

2 posts, 0 answers
  1. Ahmad
    Ahmad avatar
    13 posts
    Member since:
    Jul 2010

    Posted 04 Oct 2015 Link to this post

    Hi

    I'm having trouble adding bold version of Calibri font to client export manager pdf setting. Here's what I'm using :

     

    RadClientExportManager1.PdfSettings.Fonts.Add("Calibri", "Styles/Fonts/Calibri.ttf");
    RadClientExportManager1.PdfSettings.Fonts.Add("Calibri Bold", "Styles/Fonts/CalibriBold.ttf");

     

    When I export my element to pdf, parts of text that are not bold look fine, but bold parts fonts is changed to something else. What can I do to add Calibri Bold to pdf setting?

    Thanks

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 07 Oct 2015 Link to this post

    Hello,

    Our export test, using the Calibri Bold font, showed that when the exported text is not bold it will be exported bold and vice versa. To achieve a consistent look where all of the exported text is bold you can use the k-pdf-export class, which is related to the ClientExportManager's Change the Exported Content before Export functionality. For example, if you want to export the content of the "textExport" div in the following sample:
    <div class="textExport">  Normal text <b>bold text</b> normal text <strong>strong text</strong> </div>

    You can add the CSS rules posted below, which set a normal font-weight to the <b> and <strong> elements just before the export occurs (using the k-pdf-export class) and the exported content will look like this in the .PDF file:
    <style type="text/css">
        .textExport {
            font-family: 'Calibri Bold';
        }
     
        .k-pdf-export .textExport, .k-pdf-export .textExport b, .k-pdf-export .textExport strong {
            font-weight: normal;
        }
    </style>

    Regards,
    Ivan Danchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top