-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wish to understand hyphenation support a bit better, appears partially present. #1451
Comments
Foliate sets the So for this to work:
|
Another book I am looking at here not from a commercial publisher, says "und" for language. The whole book is in English, so for that one it missed identifying it.. but that wouldn't be the sole hyphenation blocker because other ones listed as "English" also don't have it.. hmm.. maybe they are not using the selector.. I will have to look again at the stylesheet. What are the conditions where Foliate can't identify the language from the metadata? |
Foliate simply reads the language code from the metadata and sets it as the value for the So even if the book's langauge is correct, the |
I have attached a link to the book, no worries on copyright as it's from 1920. Took a look at the thing. So for undefined, the metadata.opf file literally says UND in the language.. however! toc.ncx does say "xml:lang="en"" so I'm wondering if a condition should be added where if an opf is und, then look at the toc to see if there is a code there? Looking at the css, it is using divs but the html is using p. I didn't see hyphens named. |
Even if we assume, for the sake of the argument, that it is correct or at least somewhat beneficial to set the language of the book from publication resources when And even then, although it seems reasonable that the package document should describe the languages of the publication resources and so one could fix the absence of language information on this level by looking at its sub-resources, it does not follow that the publication resources themselves can be used to determine the languages of one another, as they all exist independently on the same level. And even then, I don't think it would be helpful very often, because the majority of books do have a And as to whether it is actually beneficial, the general and usual opinion is, I think, that it is better to err on the safe side, i.e. having no hyphenations at all is preferable to having incorrect hyphenations. Actually even the current practice of making the content documents inherit the language from the metadata is a bit iffy. The EPUB spec has a note clarifying this:
There's an even stronger, normative rule in the Reading Systems spec:
However I think these might be a bit misleading because the HTML spec says that you must get the language information "from a higher-level protocol (such as HTTP), if any" to be used as the "final fallback language". My interpretation is that it's okay (or even required) to use the language in the metadata as a fallback if you consider the metadata to be such a "higher-level protocol" (though this would be somewhat debatable). (There is one thing that Foliate does which is not quite in line with the HTML spec, though, which is that when there are multiple languages set in the metadata, it picks the first one rather than leaving the |
Question:
Most of my books don't have hyphenation support but I found an epub where hyphenation is working.
It has "English" defined as the language and forces justification in the stylesheet. I don't see anything in the stylesheet that says "hyphen". Yet, toggling foliate's hyphenation switch works. I can see the reflow and the hyphens appearing and disappearing.
This is with a flatpak install. What is special about this epub that the slider works, but not with other books?
Is it something in the stylesheet or is it something else?
The text was updated successfully, but these errors were encountered: