Skip to content
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

[BUG] Hebrew vowels and cantillation marks (slightly) misplaced #435

Open
jcornuz opened this issue Jul 2, 2023 · 3 comments
Open

[BUG] Hebrew vowels and cantillation marks (slightly) misplaced #435

jcornuz opened this issue Jul 2, 2023 · 3 comments

Comments

@jcornuz
Copy link

jcornuz commented Jul 2, 2023

Problem

On OSHB module, show "hebrew vowel points" and "hebrew cantillation marks"

Some points / marks are slightly off making reading very confusing.

Screenshot comparison

Here is a comparison screenshot of Bibletime (right) vs Xiphos (left) for the same text (same font, same size). The problematic points / marks are airbrushed in pale red for verses 1-3.

bt_hebrew_font_bug

System information

standard install (rpm) of Bibletime (3.0.3) on Fedora (KDE spin) with standard Fedora Sword (1.9.0)

Additional context

By the way, I use EZRA SIL font (fairly standard for biblical hebrew) for the screenshots. The same problem happens for all the hebrew fonts I have tested.

Last but most important word:

Thank you for BibleTime! Your hard work, dedication and perseverence are much appreciated!

@jaakristioja
Copy link
Member

jaakristioja commented Aug 23, 2023

Since we don't directly do such rendering in BibleTime code, this sounds more like a Qt issue. Copy-pasting the text to a text editor seems to yield correct marks and the HTML markup when saving the chapter as HTML also does not seem to be a problem:

<body id="bible" class="bible bible_OSHB">
    <div class="chaptertitle"><center>1. Kuningate 20</center></div>
    <div id="content" lang="hbo" xml:lang="hbo" dir="rtl">
		<div class="inline entry" xml:lang="hbo" lang="hbo" dir="rtl"><span class="entryname" dir="ltr">1. Kuningate 20:1</span><span>וּבֶן</span><span>־</span><span>הֲדַ֣ד</span> <span>מֶֽלֶךְ</span><span>־</span><span>אֲרָ֗ם</span> <span>קָבַץ֙</span> <span>אֶת</span><span>־</span><span>כָּל</span><span>־</span><span>חֵיל֔וֹ</span> <span>וּשְׁלֹשִׁ֨ים</span> <span>וּשְׁנַ֥יִם</span> <span>מֶ֛לֶךְ</span> <span>אִתּ֖וֹ</span> <span>וְס֣וּס</span> <span>וָרָ֑כֶב</span> <span>וַיַּ֗עַל</span> <span>וַיָּ֨צַר֙</span> <span>עַל</span><span>־</span><span>שֹׁ֣מְר֔וֹן</span> <span>וַיִּלָּ֖חֶם</span> <span>בָּֽהּ</span><span>׃</span></div>

		<div class="inline entry" xml:lang="hbo" lang="hbo" dir="rtl"><span class="entryname" dir="ltr">1. Kuningate 20:2</span><span>וַיִּשְׁלַ֧ח</span> <span>מַלְאָכִ֛ים</span> <span>אֶל</span><span>־</span><span>אַחְאָ֥ב</span> <span>מֶֽלֶךְ</span><span>־</span><span>יִשְׂרָאֵ֖ל</span> <span>הָעִֽירָה</span><span>׃</span></div>

		<div class="inline entry" xml:lang="hbo" lang="hbo" dir="rtl"><span class="entryname" dir="ltr">1. Kuningate 20:3</span><span>וַיֹּ֣אמֶר</span> <span>ל֗וֹ</span> <span>כֹּ֚ה</span> <span>אָמַ֣ר</span> <span>בֶּן</span><span>־</span><span>הֲדַ֔ד</span>  <span>כַּסְפְּךָ֥</span> <span>וּֽזְהָבְךָ֖</span> <span>לִֽי</span><span>־</span><span>ה֑וּא</span> <span>וְנָשֶׁ֧יךָ</span> <span>וּבָנֶ֛יךָ</span> <span>הַטּוֹבִ֖ים</span> <span>לִי</span><span>־</span><span>הֵֽם</span><span>׃</span></div>

Scribus seems to have had a similar problem, but fixed it by what I think is a switch from their custom rendering engine to something based on HarfBuzz with scribusproject/scribus@53a6dca. But since this type of low-level rendering in BibleTime is done by Qt, this seems to be an upstream Qt issue, possibly related to how the QML Text element renders its HTML.

@jaakristioja
Copy link
Member

It is weird, however, that when I try to render the (not exported) HTML in QML, it seems to work correctly:

import QtQuick 2.10

Rectangle {
  id: app
  TextEdit {
    anchors.fill: parent
    textFormat: Text.RichText
    font.pointSize: 36
    font.family: "Ezra SIL"
    wrapMode: Text.WordWrap
    text: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <title></title>\n    <meta name=\"GENERATOR\" content=\"BibleTime - https://bibletime.info\" />\n    <meta name=\"AUTHOR\" content=\"BibleTime - https://bibletime.info\" />\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\"/>\n    <style type=\"text/css\">\n\n    .chaptertitle {\n        font-weight: bold;\n        font-size: x-large\n    }\n\n    /* <![CDATA[ */\n#content{font-family:Noto Sans;font-size:10.000000pt;font-weight:normal;font-style:normal}*[lang=hbo]{font-family:Ezra SIL;font-size:26.000000pt;font-weight:505.545;font-style:normal;text-decoration:none}\n\n\n    /* ]]> */\n    </style>\n\n    <!-- Link to the application default stylesheet -->\n    <style type=\"text/css\">/**\n * Theme by BibleTime - https://bibletime.info *\n */\n\n#content {\n    margin:10px;\n}\n#content > table {\n    margin: 0;\n    padding: 0;\n    border-spacing:10px;\n}\n#content > table th {\n    padding: 0 0 2px 0;\n    text-align: center;\n    font-weight: bold;\n    font-size: 110%;\n    border-bottom: 1px dotted #7B7B7B;\n}\n\na {\n    text-decoration:none;\n    font-weight:normal;\n    padding:0 2px;\n    color: #b6c1d0;\n}\n\n.inline {\n    display: inline;\n}\n\n/* Settings which apply to all entries in all modules */\n.entry {\n    padding: 2px;\n     /*vertical-align: middle;*/\n     text-align: justify;\n}\ntd.entry, td.currententry {\n    vertical-align: top;\n     text-align: justify !important;\n}\n#printer .entry {\n    font-size: 90%;\n    text-align: left;\n}\n.entry[dir=rtl] {\n    text-align: left !important;\n}\n#printer .entry[dir=rtl] {\n    text-align:left !important;\n}\n\n/* Keep the values the same as in .entry (take the border into account!) */\n.currententry {\n    padding: 2px;\n     /*vertical-align: middle;*/\n    text-align: justify;\n    background-color: #444455;\n}\n.currententry[dir=rtl] {\n    text-align:left !important;\n}\n.currententry.inline {\n    line-height:1.4em;\n}\ndiv.currententry {\n}\nspan.currententry {\n    background-color: #EDEFFF !important;\n}\n\n/* Space between the columns of modules displayed side by side */\ntd.entry + td.entry {\n    margin-left: 5px;\n}\n\n/* Several additional settings for display of modules*/\n#bible div.currententry, #bible td.currententry {\n    border: 1px solid #B7B7B7;\n    padding: 2px;\n}\n\n\n/*Same for books!*/\n#book div.currententry, #book td.currententry {\n    border: 1px solid #B7B7B7;\n    padding: 2px;\n}\n#book .entryname + .entry {\n    margin-top:2px;\n    padding-top:1px;\n}\n/* To remove the gap between the entrynam and the entry's content*/\n#book .entry > *, #book .currententry > * {\n    margin-top:0px;\n    padding-top:0px;\n}\n\n.entryname {\n    font-size:80%;\n    padding:0 2px 0 0;\n    vertical-align:super;\n}\n.entry[dir=rtl] .entryname, .currententry[dir=rtl] .entryname {\n    padding: 0 0 0 2px;\n    font-size: 80%;\n    vertical-align: super;\n}\n.entryname a, #printer .entryname  {\n}\n\n#printer .entry  .entry, #printer .entry .sectiontitle , #printer .entry .booktitle {\n    padding-top: 0.05em;\n    margin-left: 10px;\n}\n\n.footnote {\n    vertical-align:super;\n    font-weight: normal;\n    color: #88aaff;\n    font-size: 80%;\n    cursor: help;\n}\n\n.footnote:before { content:\"(\"; }\n.footnote:after { content:\")\"; }\n\n.footnotepre {\n     font-style: italic;\n}\n\n\n.crossreference {\n    font-size: 80%;\n    color: #88aaff;\n}\n\n.crossreference a {\n    color: #88aaff;\n}\n\na[name=\"crossref\"] {\n    color: #88aaff;\n}\n\n#bible .crossreference:before  { content:\" [\"; }\n#bible .crossreference:after  { content:\"]\"; }\n\na[name=\"crossref\"] {\n    font-size: small;\n}\n\n.alternative {}\n.alternative:before { content:\"'\"attr(alternative); }\n.alternative:after{ content:\"'\";}\n\n.abbreviation {\n\n}\n\n.sectiontitle {\n    font-weight: bold;\n    font-size: 110%;\n}\n#printer .sectiontitle {\n    font-weight: bold;\n    font-size: 100%;\n}\n* + .sectiontitle {\n    margin-top:15px;\n}\n\n.booktitle {\n    font-weight: bold;\n    font-size: large;\n    font-variant: small-caps;\n}\n#printer .booktitle {\n    font-weight: bold;\n    font-size: large;\n    font-variant: small-caps;\n}\n.foreign {\n}\n\n.jesuswords {\n    color: #ff6060;\n}\n\n.jesuswords #lemmamorph {\n    color: #ff6060;\n}\n\n.introduction {\n    font-size:small;\n    text-align:justify;\n}\n\n.quotation {\n}\n.poetry {\n}\n.sup {\n    vertical-align: super;\n}\n.sub {\n    vertical-align: sub;\n}\n.right {\n    text-align: right;\n}\n.center {\n    text-align: center;\n}\n\n.bold {\n    font-weight:bold;\n}\n.illuminated {\n}\n.italic {\n    font-style:italic;\n}\n.line-through {\n    text-decoration: line-through;\n}\n.normal {\n}\n.small-caps {\n   font-variant: small-caps;\n}\n.underline {\n    text-decoration: underline;\n}\n\n.inscription {\n}\n.mentioned {\n}\n.name > .geographic {\n}\n.name > .holiday {\n}\n.name > .nonhuman {\n}\n.name > .person {\n}\n.name > .ritual {\n}\n.name > .divine {\n   font-variant: small-caps;\n}\n\n.transchange {\n    font-style:italic;\n}\n.transchange > .added {\n}\n.transchange > .amplified {\n}\n.transchange > .changed {\n}\n.transchange > .deleted {\n}\n.transchange > .moved {\n}\n.transchange > .tenseChange {\n}\n\n.morphSegmentation {\n    border-right: 2px solid gray;\n}\n\n#infodisplay {\n    margin:0;\n    padding:0;\n}\n\n#infodisplay .footnoteinfo h3, #infodisplay .strongsinfo h3, #infodisplay .morphinfo h3, #infodisplay .translationinfo h3, #infodisplay .crossrefinfo h3, #infodisplay .moduleinfo h3 {\n    padding:4px 4px 2px 0;\n    color:darkGray;\n    font-weight:bold;\n    border-bottom:1px solid gray;\n    text-align: right;\n}\n\n#infodisplay > p, #infodisplay * > p,\n#infodisplay > .para, #infodisplay * > .para\n{ /* We only format the first p child in a special way */\n    text-align:justify !important;\n    margin:0px;\n    padding:0px;\n}\n\n/*Required for cross references*/\n#infodisplay .entry {\n    padding:2px;\n    text-align:justify !important;\n    margin-bottom:10px;\n    margin-left:15px;\n}\n#infodisplay .entry[dir=rtl] {\n    text-align: left !important;\n}\n#infodisplay .entry .entry { /*No smaller font size for nested entries*/\n    margin:0px;\n}\n#infodisplay .entry .entry[dir=rtl] { /*No smaller font size for nested entries*/\n    text-align: left !important;\n}\n#infodisplay .entryname {\n    padding:2px;\n    margin:0px;\n    text-align:left !important;\n    font-weight:bold;\n}\n\n#infodisplay .rangeheading {\n    color:black;\n    font-weight:bold;\n    margin-left:-10px;\n}\n\n#printer .rangeheading {\n    border-bottom:1px solid black;\n    color:black;\n}\n\n.highlightwords {\n    background-color: #999900;\n}\n.highlightwords2 {\n    background-color: #ffaa00;\n}\n</style>\n    <!-- Link to module stylesheet, if applicable -->\n\n</head>\n\n<body id=\"bible\" class=\"bible bible_OSHB\">\n    <div class=\"chaptertitle\"><center></center></div>\n    <div id=\"content\" lang=\"hbo\" xml:lang=\"hbo\" dir=\"rtl\">\n\t\t<div class=\"inline entry\" xml:lang=\"hbo\" lang=\"hbo\" dir=\"rtl\"><span class=\"entryname\" dir=\"ltr\"><a name=\"1.Kuningate20_2\" href=\"sword://Bible/OSHB/1. Kuningate 20:2\">2</a>\n</span><span lemma=\"H07971\" morph=\"oshm:HC/Vqw3ms\">וַיִּשְׁלַ֧ח</span> <span lemma=\"H04397\" morph=\"oshm:HNcmpa\">מַלְאָכִ֛ים</span> <span lemma=\"H00413\" morph=\"oshm:HR\">אֶל</span><span>־</span><span lemma=\"H00256\" morph=\"oshm:HNp\">אַחְאָ֥ב</span> <span lemma=\"H04428\" morph=\"oshm:HNcmsc\">מֶֽלֶךְ</span><span>־</span><span lemma=\"H03478\" morph=\"oshm:HNp\">יִשְׂרָאֵ֖ל</span> <span lemma=\"H05892\" morph=\"oshm:HTd/Ncfsa/Sd\">הָעִֽירָה</span><span>׃<</span></div>\n</div>\n</body>\n</html>\n"
  }
}

@jcornuz
Copy link
Author

jcornuz commented Aug 24, 2023

Thanks for having a look. I tried a few more things:

  • Copying / pasting Hebrew text from Bibletime to Kate and changing Kate's display font to Ezra SIL: Hebrew text is displayed correctly in Kate.
  • Recompiling Bibletime from master (Fedora 38): bug still present.
  • Creating an empty (blank css) BT display style: bug still present.

I guess this one of these bugs that will disappear one fine day with a new version of Qt5 or port to Qt6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants