DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.39k stars 625 forks source link

Gujarati language font is not rendering correctly. #1311

Closed alpesh031 closed 1 year ago

alpesh031 commented 1 year ago

I used this package and created app for android where I used Gujarati language fonts to generate pdf and after saving as pdf file it shows incorrect words.

Expected behavior વસ્તુનું નામ, કિલો, ગ્રામ

Result image

Flutter Doctor

[!] Flutter (Channel stable, 3.7.2, on Microsoft Windows [Version 10.0.19044.2604], locale en-IN)
    • Flutter version 3.7.2 on channel stable at C:\Users\admin\Downloads\flutter
    ! Warning: `dart` on your path resolves to C:\tools\dart-sdk\bin\dart.exe, which is not inside your current Flutter SDK checkout at
      C:\Users\admin\Downloads\flutter. Consider adding C:\Users\admin\Downloads\flutter\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 32fb2f948e (6 weeks ago), 2023-02-08 07:30:10 -0800
    • Engine revision f40b73f8a4
    • Dart version 2.19.2
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks   
      and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\admin\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[!] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    X Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[√] VS Code (version 1.69.2)
    • VS Code at C:\Users\admin\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • SM M325F (mobile) • RZ8T90QEMNW • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.19044.2604]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 111.0.5563.66
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 111.0.1661.51

[√] HTTP Host Availability
    • All required HTTP hosts are available

Smartphone (please complete the following information):

I already tried one solution from [https://github.com/DavBfr/dart_pdf/issues/198] but it won't help

Hope to get any help from here, thank you in advance.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

alpesh031 commented 1 year ago

Kindly help me here in case any solution are there.

tgucio commented 1 year ago

Gujarati, as all other Indic scripts, requires complex text shaping which isn't supported by dart_pdf. This is non trivial and would require a complete shaper implementation together with OpenType support for GSUB and GPOS tables to render text correctly.

Some reading:

Shahriyar13 commented 1 year ago

please check this bug:

https://github.com/DavBfr/dart_pdf/issues/1238#issuecomment-1534277803

also try with these fonts: https://www.fileformat.info/info/unicode/char/0AA8/fontsupport.htm

mbalu8229 commented 1 year ago

I am also facing the same problem with the Telugu language. Is there any solution?.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] commented 1 year ago

Closing this stale issue because it has no activity.

rabadiaanurag commented 6 months ago

Same problem still exists from long time. no solution found.

DyDev-1 commented 2 months ago

the same issue with khmer font too.