@@ -4,6 +4,7 @@ import { ExportUtilities } from '../exporter-common/export-utilities';
44import { IgxPdfExporterOptions } from './pdf-exporter-options' ;
55import { IBaseEventArgs } from 'igniteui-angular/core' ;
66import type { jsPDF } from 'jspdf' ;
7+ import { RobotoSubsetFont } from './roboto-subset-font' ;
78
89export interface IPdfExportEndedEventArgs extends IBaseEventArgs {
910 pdf ?: jsPDF ;
@@ -222,6 +223,11 @@ export class IgxPdfExporterService extends IgxBaseExporter {
222223 format : options . pageSize
223224 } ) ;
224225
226+ // Add Unicode-capable font for non-Latin character support
227+ // This allows proper rendering of Chinese, Japanese, and other non-Latin scripts
228+ pdf . addFileToVFS ( 'Roboto-Subset.ttf' , RobotoSubsetFont ) ;
229+ pdf . addFont ( 'Roboto-Subset.ttf' , 'Roboto' , 'normal' ) ;
230+
225231 const pageWidth = pdf . internal . pageSize . getWidth ( ) ;
226232 const pageHeight = pdf . internal . pageSize . getHeight ( ) ;
227233 const margin = 40 ;
@@ -241,7 +247,8 @@ export class IgxPdfExporterService extends IgxBaseExporter {
241247
242248 let yPosition = margin ;
243249
244- // Set font
250+ // Set font to Roboto for Unicode support
251+ pdf . setFont ( 'Roboto' , 'normal' ) ;
245252 pdf . setFontSize ( options . fontSize ) ;
246253
247254 // Draw multi-level headers if present
@@ -268,7 +275,7 @@ export class IgxPdfExporterService extends IgxBaseExporter {
268275 }
269276
270277 // Draw data rows
271- pdf . setFont ( 'helvetica ' , 'normal' ) ;
278+ pdf . setFont ( 'Roboto ' , 'normal' ) ;
272279
273280 // Check if this is a tree grid export (tree grids can have both TreeGridRecord and DataRecord types for nested children)
274281 const isTreeGridExport = data . some ( record => record . type === ExportRecordType . TreeGridRecord ) ;
@@ -423,7 +430,7 @@ export class IgxPdfExporterService extends IgxBaseExporter {
423430 allColumns ?: any [ ]
424431 ) : number {
425432 let yPosition = yStart ;
426- pdf . setFont ( 'helvetica ' , 'bold' ) ;
433+ pdf . setFont ( 'Roboto ' , 'bold' ) ;
427434
428435 // First, draw row dimension header labels (for pivot grids) if present
429436 // Draw headers if we have any row dimension headers, regardless of maxRowLevel
@@ -633,7 +640,7 @@ export class IgxPdfExporterService extends IgxBaseExporter {
633640 yPosition = yStart + totalHeaderHeight ;
634641 }
635642
636- pdf . setFont ( 'helvetica ' , 'normal' ) ;
643+ pdf . setFont ( 'Roboto ' , 'normal' ) ;
637644 return yPosition ;
638645 }
639646
@@ -842,7 +849,7 @@ export class IgxPdfExporterService extends IgxBaseExporter {
842849 tableWidth : number ,
843850 options : IgxPdfExporterOptions
844851 ) : void {
845- pdf . setFont ( 'helvetica ' , 'bold' ) ;
852+ pdf . setFont ( 'Roboto ' , 'bold' ) ;
846853 pdf . setFillColor ( 240 , 240 , 240 ) ;
847854
848855 if ( options . showTableBorders ) {
@@ -908,7 +915,7 @@ export class IgxPdfExporterService extends IgxBaseExporter {
908915 pdf . text ( headerText , textX , textY ) ;
909916 } ) ;
910917
911- pdf . setFont ( 'helvetica ' , 'normal' ) ;
918+ pdf . setFont ( 'Roboto ' , 'normal' ) ;
912919 }
913920
914921 private drawDataRow (
0 commit comments