mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
d8d08a449f
commit
5b3b05a943
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user