mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
PDF Output: Fix the option to break long words at the ends of lines causing boxes to be rendered at the end fo the line on macOS with some
fonts. Fixes #1951467 [Private bug](https://bugs.launchpad.net/calibre/+bug/1951467)
This commit is contained in:
parent
1a8209a898
commit
0e2c29d2e3
@ -31,7 +31,15 @@
|
||||
if (is_block) avoid_page_breaks_inside(img);
|
||||
else if (img.parentNode && img.parentNode.childElementCount === 1) avoid_page_breaks_inside(img.parentNode);
|
||||
}
|
||||
|
||||
// Change the hyphenate character to a plain ASCII minus (U+002d) the default
|
||||
// is U+2010 but that does not render with the default Times font on macOS as of Monterey
|
||||
// and Qt 15.5 See https://bugs.launchpad.net/bugs/1951467 and can be easily reproduced
|
||||
// by converting a plain text file with the --pdf-hyphenate option
|
||||
for (const elem of document.getElementsByTagName('*')) {
|
||||
if (elem.style) {
|
||||
elem.style.setProperty('-webkit-hyphenate-character', '"-"', 'important');
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user