I want to print Hindi language in my PDF, I've also tried using Raleway-Regular.ttf font by Google but it also didn't worked.
final font = await rootBundle.load("fonts/ARIAL.TTF");
final ttf = pw.Font.ttf(font);
pdf.addPage(
pw.MultiPage(
pageFormat: PdfPageFormat.a4,
margin: pw.EdgeInsets.all(32),
build: (pw.Context context){
return <pw.Widget>[
pw.Center(
child: pw.Text("मेन",style: pw.TextStyle(fontSize: 16,font: ttf))
),
pw.SizedBox(height: 20),
pw.Center(
child: pw.Text("ABC",style: pw.TextStyle(fontSize: 16))
),
),
),
I'm getting following Error:
***I/flutter (24862): Cannot decode the string to Latin1. I/flutter (24862): This font does not support Unicode characters. I/flutter (24862): If you want to use strings other than Latin strings, use a TrueType (TTF) font instead. I/flutter (24862): See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management I/flutter (24862): --------------------------------------------- E/flutter (24862): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Invalid argument (string): Contains invalid characters.: "मेन"
