mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Only use the ascii hyphen on macOS since it is only needed there
This commit is contained in:
parent
0e2c29d2e3
commit
dec5cb9d20
@ -35,9 +35,11 @@
|
||||
// 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');
|
||||
if (HYPHEN_CHAR) {
|
||||
for (const elem of document.getElementsByTagName('*')) {
|
||||
if (elem.style) {
|
||||
elem.style.setProperty('-webkit-hyphenate-character', '"-"', 'important');
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
@ -22,7 +22,7 @@ from qt.webengine import (
|
||||
)
|
||||
|
||||
from calibre import detect_ncpus, human_readable, prepare_string_for_xml
|
||||
from calibre.constants import __version__, iswindows
|
||||
from calibre.constants import __version__, iswindows, ismacos
|
||||
from calibre.ebooks.metadata.xmp import metadata_to_xmp_packet
|
||||
from calibre.ebooks.oeb.base import XHTML, XPath
|
||||
from calibre.ebooks.oeb.polish.container import Container as ContainerBase
|
||||
@ -63,7 +63,7 @@ def data_as_pdf_doc(data):
|
||||
def preprint_js():
|
||||
ans = getattr(preprint_js, 'ans', None)
|
||||
if ans is None:
|
||||
ans = preprint_js.ans = P('pdf-preprint.js', data=True).decode('utf-8')
|
||||
ans = preprint_js.ans = P('pdf-preprint.js', data=True).decode('utf-8').replace('HYPHEN_CHAR', 'true' if ismacos else 'false', 1)
|
||||
return ans
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user