OpenPDF icon indicating copy to clipboard operation
OpenPDF copied to clipboard

Some styles do not work for phrases containing Polish letters

Open bard4 opened this issue 1 year ago • 2 comments

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 avatar Dec 23 '24 08:12 bard4

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

vk-github18 avatar Dec 25 '24 16:12 vk-github18

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

andreasrosdal avatar Jan 08 '25 09:01 andreasrosdal