Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some styles do not work for phrases containing Polish letters #1251

Open
bard4 opened this issue Dec 23, 2024 · 2 comments
Open

Some styles do not work for phrases containing Polish letters #1251

bard4 opened this issue Dec 23, 2024 · 2 comments
Labels

Comments

@bard4
Copy link

bard4 commented Dec 23, 2024

Describe the bug

When I used polish letters and trid to apply BOLD or ITALIC style I noticed that it doesn`t work.
In the example below:

  • in 1. (polish letters) I should get bolded text
  • in 3. (polish letters) I should get italic text
  • in 2,4 (no polish letters) styles are correctly applied
  • in 5,6 (polish letters) strikethroug and underline styles are correctly applied

obraz

To Reproduce

Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("c:/pdf/pdf-document.pdf"));
document.open();
PdfPTable datatable = new PdfPTable(2);
datatable.addCell(new Phrase("1. aącćeęlł BOLD", new Font(Font.HELVETICA, 20, Font.BOLD)));
datatable.addCell(new Phrase("2. aacceell BOLD", new Font(Font.HELVETICA, 20, Font.BOLD)));
datatable.addCell(new Phrase("3. aącćeęlł ITALIC", new Font(Font.HELVETICA, 20, Font.ITALIC)));
datatable.addCell(new Phrase("4. aacceell ITALIC", new Font(Font.HELVETICA, 20, Font.ITALIC)));
datatable.addCell(new Phrase("5. aącćeęlł STRIKETHRU", new Font(Font.HELVETICA, 20, Font.STRIKETHRU)));
datatable.addCell(new Phrase("6. aącćeęlł UNDERLINE", new Font(Font.HELVETICA, 20, Font.UNDERLINE)));
document.add(datatable);
document.close();

Expected behavior

  • in 1. (polish letters) I should get bolded text
  • in 3. (polish letters) I should get italic text

System

(please complete the following information)

  • Windows 11
  • Used font: HELVETICA
  • OpenPDF version: 2.0.3
@bard4 bard4 added the bug label Dec 23, 2024
@vk-github18
Copy link
Contributor

vk-github18 commented Dec 25, 2024

You can try an OpenType font like Noto Sans
See also https://github.com/LibrePDF/OpenPDF/wiki/Accents,-DIN-91379,-non-Latin-scripts

@andreasrosdal
Copy link
Contributor

żądanie ściągnięcia, zapraszamy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants