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

Bold text not rendered on OS X 10.14 #385

Closed
ranwaldo opened this issue Oct 28, 2018 · 5 comments
Closed

Bold text not rendered on OS X 10.14 #385

ranwaldo opened this issue Oct 28, 2018 · 5 comments

Comments

@ranwaldo
Copy link

Rendering of bold text is not working in Sigil v0.9.10 for OS X Mojave 10.14. The same .epub file was working fine before the OS X upgrade. The bold text looks fine on Sigil v0.9.10 for Windows. It looks fine when opened with 'Kindle Previewer 3'.

The symptom is very easily reproduced. Just open a new Sigil file. Type in 'aaaa bbbb'. Select 'aaaa'. Select the Bold button. Notice that there is no bold text. The code view looks like this:

<p><span style="font-weight: bold;">aaaa</span> bbbb</p>

~ranwaldo

@kevinhendricks
Copy link
Contributor

This could be a bug in Qt that only manifests itslf on Mojave or a bug or missing library in Mojave, As Mojave is new, I will not be moving any of my development machines to that OS version for at least 6 months or possibly more as stability is key.

So once released, please test the upcomng Sigil release on Mojave as it will be using a mucher newer version of Qt (5.11.1) than the current version which uses Qt 5.6.2.

Sorry, I can't be more help here as none of my machines will move to Mojave for quite some time yet.

@kevinhendricks
Copy link
Contributor

kevinhendricks commented Oct 28, 2018

Here is Kovid's Qt patch:

--- ./qtbase/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm.orig	2018-10-18 10:36:55.016457121 +0530
+++ ./qtbase/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm	2018-10-18 10:37:26.469615885 +0530
@@ -300,9 +300,9 @@ static void getFontDescription(CTFontDes
 
     if (styles) {
         if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) {
-            float normalizedWeight;
-            if (CFNumberGetValue(weightValue, kCFNumberFloatType, &normalizedWeight))
-                fd->weight = QCoreTextFontEngine::qtWeightFromCFWeight(normalizedWeight);
+            double normalizedWeight;
+            if (CFNumberGetValue(weightValue, kCFNumberFloat64Type, &normalizedWeight))
+                fd->weight = QCoreTextFontEngine::qtWeightFromCFWeight(float(normalizedWeight));
         }
         if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) {
             double d;

@kevinhendricks
Copy link
Contributor

I will check to see if Qt's 5.11.1 version ncludes this fix already or not. If not, I will add it to my own Qt build.

@kevinhendricks
Copy link
Contributor

The fix is in Qt 5.12 not Qt 5.11.1. I will look into backporting it and include it in an upcomng release.

@kevinhendricks
Copy link
Contributor

I backported that patch to Qt 5.11.1 and rebuilt all of Qt with that fix. So I am closing this as the fix will appear in the next official release of Sigil.

Thank you for your bug report.

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

No branches or pull requests

2 participants