Repository navigation
fix: retain combining marks with their RTL base characters - #13
Merged
Merged
Conversation
|
בבדיקת צרכן PDF אמיתי נמצא שסידור L3 תלוי במנוע הציור, כפי שמצוין ב־Unicode L3. dart_pdf מצייר גליפים ישירות ומשתמש בניקוד RTL הבולט ימינה; החלת L3 ללא בחירה מפורשת מזיזה ניקוד לאות אחרת. הכנתי תיקון המשך המבוסס ישירות על head הנוכחי של PR זה. הוא מוסיף RtlCombiningMarkOrder מפורש, שומר כברירת מחדל את beforeBase לתאימות, ומאפשר afterBase למנוע שמצפה לצירוף אות וסימנים. בדיקות L3 הקיימות שומרות את אותן תוצאות צפויות ובוחרות במפורש afterBase. כל 9 בדיקות הענף ו־dart analyze עברו. בשילוב עם שאר תיקוני הפורק, PDF מרונדר בשש דוגמאות זהה ברמת הפיקסלים לגרסת הבסיס. לא הייתה הרשאת כתיבה זמינה לענף המקורי ב־palmoni5/bidi, ולכן התיקון פורסם ב־ענף הארגון לצורך יישום באותו PR. הענף המקורי לא שונה ולא נפתח PR כפול. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and resulting behavior
Reversing RTL runs also reversed nonspacing marks independently of their base letters. For logical
א\u05B0ב\u05B1ג, the old output code points were[1490, 1457, 1489, 1456, 1488], attaching marks to the wrong bases. The fixed output is[1490, 1489, 1457, 1488, 1456], preserving each base-plus-mark cluster while retaining original source indices.Restore L3 cluster order after visual run reversal, and recognize nonspacing marks introduced during decomposition. LTR accents continue through the existing normalization behavior. The implementation uses private helpers; no public API or version changes.
Validation
ebef4fb) and this branch.flutter analyze: no issues, including the benchmark and Flutter example.dart test: all 6 tests pass. Regressions cover single and multiple Hebrew marks, RTL clusters inside Latin paragraphs and LTR accent normalization.dart run benchmark/bidi_benchmark.dart: smoke benchmark passes; the existing benchmark remains in CI.This PR is independently based on upstream main and contains only the combining-mark correction, its regressions and complete static-analysis CI. Performance, scalar handling, source mappings and bracket resolution are separate submissions.