dart_pdf icon indicating copy to clipboard operation
dart_pdf copied to clipboard

Fix: Only break text into several spans if the font fallback is not the same (in _preProcessSpans)

Open erwamartin opened this issue 1 year ago • 1 comments

Right now, when the main font doesn’t support certain characters, it creates a separate span for each one. This causes problems with the Arabic layout processor (and similar scripts), which needs the characters to stay together for proper rendering.

With this fix, we’ll only create a new span if the fallback font is different, allowing the layout to work correctly for complex scripts like Arabic.

Fixes https://github.com/DavBfr/dart_pdf/issues/1743

erwamartin avatar Sep 18 '24 14:09 erwamartin

Can you add a test that highlight the fix with a correct rendering?

DavBfr avatar Oct 05 '24 12:10 DavBfr