macOS: PDF Output: Fix bold fonts not working on Mojave. Fixes #1799750 [ebook-convert does not display bold font when converting from html to pdf on OSX Mojave](https://bugs.launchpad.net/calibre/+bug/1799750)

This commit is contained in:
Kovid Goyal 2018-12-24 10:32:11 +05:30
parent d8d08a449f
commit 5b3b05a943
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -240,9 +240,9 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
if (styles) { if (styles) {
if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) { if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) {
float normalizedWeight; double normalizedWeight;
if (CFNumberGetValue(weightValue, kCFNumberFloatType, &normalizedWeight)) if (CFNumberGetValue(weightValue, kCFNumberFloat64Type, &normalizedWeight))
fd->weight = QCoreTextFontEngine::qtWeightFromCFWeight(normalizedWeight); fd->weight = QCoreTextFontEngine::qtWeightFromCFWeight(float(normalizedWeight));
} }
if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) { if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) {
double d; double d;