PDF export, fonts squished together

3 posts, 1 answers
  1. Jussi
    Jussi avatar
    2 posts
    Member since:
    May 2016

    Posted 24 Nov 2016 Link to this post

    We are generating a PDF form in Finnish language. We are having problems with scandic letters (åäö) not rendering correctly in the PDF. They are on top of each other. Is this a problem with Telerik PDF export or the font? Are there workarounds? I tried another font (Fira Sans) and the results are the same.

    The attached files show how it looks in the DOM and in the generated PDF.

     

  2. Answer
    Rumen
    Admin
    Rumen avatar
    13197 posts

    Posted 28 Nov 2016 Link to this post

    Hi Jussi,

    I tried to reproduce the reported letter squishing problem, but to no avail. I've made a test page http://dojo.telerik.com/@RumenJ/eKoJo (based on this demo) where I placed the word läkäärin on three different places and it was exported without problem with the DejaVu Sans font. Here is a screenshot of the result: http://screencast.com/t/BbPj6LxdpZp.

    Best regards,
    Rumen
    Telerik by Progress
    Kendo UI is ready for Visual Studio 2017 RC! Learn more.
  3. Jussi
    Jussi avatar
    2 posts
    Member since:
    May 2016

    Posted 28 Nov 2016 in reply to Rumen Link to this post

    Thanks for your test! I found the difference between my code and your example. You can see the overlapping characters behavior by commenting out these lines from your example:

    kendo.pdf.defineFont({
        "DejaVu Sans"             : "//kendo.cdn.telerik.com/2016.2.607/styles/fonts/DejaVu/DejaVuSans.ttf",
        "DejaVu Sans|Bold"        : "//kendo.cdn.telerik.com/2016.2.607/styles/fonts/DejaVu/DejaVuSans-Bold.ttf",
        "DejaVu Sans|Bold|Italic" : "//kendo.cdn.telerik.com/2016.2.607/styles/fonts/DejaVu/DejaVuSans-Oblique.ttf",
        "DejaVu Sans|Italic"      : "//kendo.cdn.telerik.com/2016.2.607/styles/fonts/DejaVu/DejaVuSans-Oblique.ttf"
    });

     

    There was a mistake with how I embedded fonts in our code. Using these exact lines fixes the problem for us. Ultimately, we will want to use "Fira Sans" font for our reports, so I just have to figure out how to use those fonts instead of "DejaVu Sans".

Back to Top