This is a migrated thread and some comments may be shown as answers.

Accent in exported PDF

5 Answers 763 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 21 Apr 2015, 07:05 PM

Hello,

The PDF generated by kendo chart seems to have  a problem dealing with accents.  I attached an image showing 3 export made from the same chart.  Please note that Montréal is displayed correctly in the PNG and the SVG but not in the PDF.

This issue is not only the the categories, it also occurs in the title and legend.

Can you confirm if this is a bug and if it could get fixed? 

Best regards,

Simon

 

 

5 Answers, 1 is accepted

Sort by
0
Accepted
Mihai
Telerik team
answered on 22 Apr 2015, 12:07 PM
Hello,

You need to use a TrueType font for Unicode support.  Kendo UI ships with the DejaVu fonts, but when the CSS resides on another domain than the main page it will not be able to detect the font file locations, so you need to declare it manually using kendo.pdf.defineFont like for example in this sample (note the ş characters in the title, they would not show up properly without declaring the TTF files).

As well, for proper display you should declare the font in your chart widget.  The sample above declares title.font option "bold 16px 'DejaVu Sans'", and later at the end of the file you can see the kendo.pdf.defineFont call (see docs) which is necessary because the CSS is loaded from the CDN.

In your case you should set option categoryAxis.labels.font to use the DejaVu font.

Hope this helps.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Simon
Top achievements
Rank 1
answered on 22 Apr 2015, 03:41 PM

Great answer!

Thank you Mihai

0
Pisith
Top achievements
Rank 1
answered on 30 Oct 2018, 09:58 AM

Hello Mihai,

how to set option categoryAxis.labels.font to use the DejaVu font.?

 

0
Tsvetomir
Telerik team
answered on 31 Oct 2018, 10:57 AM
Hi Pisith,

The DejaVu font could be applied by using the categoryAxis.labels.font field as follows:

categoryAxis: [{
  labels: {
     font: "20px DejaVu",
  },
  categories: ["2011", "2012", "2013"]
}],


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Pisith
Top achievements
Rank 1
answered on 02 Nov 2018, 07:23 AM

Hello Mihai,

I will try 

Thank you for your idea


Tags
Charts
Asked by
Simon
Top achievements
Rank 1
Answers by
Mihai
Telerik team
Simon
Top achievements
Rank 1
Pisith
Top achievements
Rank 1
Tsvetomir
Telerik team
Share this question
or