Flutter PDF 中古吉拉特语字体渲染问题

2023-12-25

我正在使用 Flutter 2.0 开发移动应用程序,整个应用程序采用古吉拉特语,应用程序已准备就绪,所有文本都在应用程序中完美呈现,但是当我从屏幕上的数据生成 pdf 时,古吉拉特语字体不正确渲染,

我正在使用插件

pdf: ^3.0.1

for Ex,

屏幕上的字符串是લોગિન当我打印为 pdf 时,它变成了લોગનિ

另一个也一样ઉત્સવ变成ઉત્ સવ(忽略单词之间的空格)


使用这个颤振库

https://pub.dev/packages/syncfusion_flutter_pdf#create-a-pdf-document-from-simple-text https://pub.dev/packages/syncfusion_flutter_pdf#create-a-pdf-document-from-simple-text

//Create a new PDF document.
final PdfDocument document = PdfDocument();
//Read font data.
final Uint8List fontData = File('arial.ttf').readAsBytesSync();
//Create a PDF true type font object.
final PdfFont font = PdfTrueTypeFont(fontData, 12);
//Draw text using ttf font.
document.pages.add().graphics.drawString('Hello World!!!', font,
    bounds: const Rect.fromLTWH(0, 0, 200, 50));
// Save the document.
File('TrueType.pdf').writeAsBytes(document.save());
// Dispose the document.
document.dispose();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Flutter PDF 中古吉拉特语字体渲染问题 的相关文章