Git Product home page Git Product logo

Comments (6)

 avatar commented on September 23, 2024

No, I haven't. Please describe this problem in more detail. Which language diacritics are not rendered?
Perhaps you can submit a pull-request to fix it yourself?

from openpdf.

asturio avatar asturio commented on September 23, 2024

As with the unicode issue, it seems that the fonts provided are not so symbol rich as you need it, Please try loading a font which has the symbols you need, and see if it works.

Take a look at this "test": https://github.com/LibrePDF/OpenPDF/blob/master/openpdf/src/test/java/com/lowagie/text/pdf/UnicodePdfTest.java

from openpdf.

asturio avatar asturio commented on September 23, 2024

@wickstargazer , you mean the combination of 2 symbols like "a" + "´" = "á", and be hanled like 2 symbols, instead of 1?

from openpdf.

rntrp avatar rntrp commented on September 23, 2024

We've recently run into the same (?) problem with the German Umlauts (ä, ö, ü). The base letter and the diaeresis were rendered side by side, e.g. as "a¨", as described by @asturio in the comment above.

There are two solutions for this problem:
If you are using common diacritics, for which a singleton character exists in Unicode, then simply preprocess your text with the java.text.Normalizer using the NFC algorithm as described here. Of course there is some performance penalty for this.
Set the correct PDF Font encoding–I suggest Identity H–as described here. If you're using OpenPDF with FlyingSaucer, then you need to call ITextRenderer.getFontResolver().addFont(path, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

from openpdf.

venkattarigopula avatar venkattarigopula commented on September 23, 2024

Hi all,
The same issue I am getting with Telugu ( India ) language like pointed by @asturio of two characters not mixing to have proper diacritic. The solutions suggested by @rntrp is not solving. As @asturio said about using the right font, I think that is not the issue in my case. Please let me explain.

If the combined string of the two characters ( \u0C2D \u0C4B ) are displaying properly in the sysout.
But not in the PDF.
Character \u0C2D is
image

Character(diactric) \u0C4B is
image

In PDF it is displaying as
image

and in console it is displaying as
image

The code i have written basically is ..

static String FONT = "c:\\windows\\fonts\\lohit-telugu.ttf";
BaseFont bfComic = BaseFont.createFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font font = new Font(bfComic, 12);
String text3 = "Some Telugu \u0305cha\u0C46racter\u0300s: భోజనం తర్వాత తదుపరి పైన ముందు \u0C2D\u0C4B ";
doc.add(new Paragraph(text3, font));

from openpdf.

codecracker2014 avatar codecracker2014 commented on September 23, 2024

With #329 this issue has been fixed, please check with latest OpenPDF, make sure to include FOP dependency as well. @asturio we can close this issue.

from openpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.