Skip to content

GlyphLayoutProcessor for correct glyph layout and support of DIN 91379 (Issue PDFBOX-4951)#436

Open
vk-github18 wants to merge 22 commits into
apache:trunkfrom
vk-github18:trunk
Open

GlyphLayoutProcessor for correct glyph layout and support of DIN 91379 (Issue PDFBOX-4951)#436
vk-github18 wants to merge 22 commits into
apache:trunkfrom
vk-github18:trunk

Conversation

@vk-github18
Copy link
Copy Markdown

@vk-github18 vk-github18 commented Apr 5, 2026

GlyphLayoutProcessor for correct glyph layout and support of DIN 91379
using AWT classes for glyph layout based on HarfBuzz library.

Can be switched on for individual ContentStream or Acroform.
Does not change processing for other documents.

Works in single threading and in multi threading environments, you can use different instances of GlyphLayoutProcessor in different threads, but each instance of GlyphLayoutProcessor can only be used in one thread.

See DoGlyphLayoutDin91379.java, DoGlyphLayoutDin91379Form.java, DoGlyphLayoutLigaturesAndKerning.java, DoGlyphLayoutBidi.java, DoGlyphLayoutBengali.java, DoGlyphLayoutMissingGlyphs.java, and DoGlyphLayoutSMP.java for usage.

Example document showing correct rendering of all letters of DIN 91379: DoGlyphLayoutDin91379.pdf

Example form: DoGlyphLayoutDin91379Form.pdf

Example for ligatures and kerning:
DoGlyphLayoutLigaturesAndKerning.pdf

Example for bidirectional text:
DoGlyphLayoutBidi.pdf

Examples for Supplementary Multilingual Plane:
DoGlyphLayoutSMP.pdf

Error message for missing glyph:

Exception in thread "main" java.lang.IllegalArgumentException: Missing glyph in font 'Lohit Bengali' for the character 'A', codePoint: 65 (U+0041).
	at org.apache.pdfbox.pdmodel.GlyphLayoutProcessor.checkMissingGlyphs(GlyphLayoutProcessor.java:91)
	at org.apache.pdfbox.pdmodel.GlyphLayoutProcessor.computeGlyphVector(GlyphLayoutProcessor.java:180)
	at org.apache.pdfbox.pdmodel.GlyphLayoutProcessor.showText(GlyphLayoutProcessor.java:210)
	at org.apache.pdfbox.pdmodel.PDAbstractContentStream.showText(PDAbstractContentStream.java:326)
	at org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:37)
	at org.apache.pdfbox.examples.pdmodel.glyphlayout.DoGlyphLayoutMissingGlyphs.showLine(DoGlyphLayoutMissingGlyphs.java:99)
	at org.apache.pdfbox.examples.pdmodel.glyphlayout.DoGlyphLayoutMissingGlyphs.test(DoGlyphLayoutMissingGlyphs.java:69)
	at org.apache.pdfbox.examples.pdmodel.glyphlayout.DoGlyphLayoutMissingGlyphs.main(DoGlyphLayoutMissingGlyphs.java:39)

See https://issues.apache.org/jira/browse/PDFBOX-4951

@vk-github18
Copy link
Copy Markdown
Author

vk-github18 commented May 31, 2026

changed <p/> to <p>
refactored ifMixedThenDivideTextAndShow
added public modifier
moved showTextPDType0Font to GlyphProcessor
New test class DoGlyphLayoutHelloWorld

vk-github18 and others added 4 commits June 1, 2026 21:04
…elete unused method

use try with ressources, rethink public/protected, add Null checks, delete unused method
javadoc additions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant