mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-18 11:14:02 +02:00
Merge pull request #21082 from calixteman/fix_comb_ltr
Fix how the text is printed/saved in a comb field when it's a RTL one
This commit is contained in:
commit
fbed36db00
@ -2547,6 +2547,7 @@ class WidgetAnnotation extends Annotation {
|
||||
descent,
|
||||
lineHeight,
|
||||
alignment,
|
||||
bidi(lines[0]).dir === "rtl",
|
||||
annotationStorage
|
||||
);
|
||||
}
|
||||
@ -2911,6 +2912,7 @@ class TextWidgetAnnotation extends WidgetAnnotation {
|
||||
descent,
|
||||
lineHeight,
|
||||
alignment,
|
||||
isRTL,
|
||||
annotationStorage
|
||||
) {
|
||||
const combWidth = width / this.data.maxLen;
|
||||
@ -2922,6 +2924,9 @@ class TextWidgetAnnotation extends WidgetAnnotation {
|
||||
for (const [start, end] of positions) {
|
||||
buf.push(`(${escapeString(text.substring(start, end))}) Tj`);
|
||||
}
|
||||
if (isRTL) {
|
||||
buf.reverse();
|
||||
}
|
||||
|
||||
const textWidth = combWidth * positions.length;
|
||||
let hShift = hPadding;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user