|
|
|
@@ -234,6 +234,15 @@ namespace CoreTextTypeLayout |
|
|
|
ctFontRef = getFontWithPointSize (ctFontRef, attr.font.getHeight() * getHeightToPointsFactor (ctFontRef));
|
|
|
|
CFAttributedStringSetAttribute (attribString, range, kCTFontAttributeName, ctFontRef);
|
|
|
|
|
|
|
|
if (attr.font.isUnderlined())
|
|
|
|
{
|
|
|
|
auto underline = kCTUnderlineStyleSingle;
|
|
|
|
|
|
|
|
auto numberRef = CFNumberCreate (nullptr, kCFNumberIntType, &underline);
|
|
|
|
CFAttributedStringSetAttribute (attribString, range, kCTUnderlineStyleAttributeName, numberRef);
|
|
|
|
CFRelease (numberRef);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto extraKerning = attr.font.getExtraKerningFactor();
|
|
|
|
|
|
|
|
if (extraKerning != 0)
|
|
|
|
@@ -463,6 +472,26 @@ namespace CoreTextTypeLayout |
|
|
|
String::fromCFString (cfsFontStyle),
|
|
|
|
(float) (CTFontGetSize (ctRunFont) / fontHeightToPointsFactor));
|
|
|
|
|
|
|
|
auto isUnderlined = [&]
|
|
|
|
{
|
|
|
|
CFNumberRef underlineStyle;
|
|
|
|
|
|
|
|
if (CFDictionaryGetValueIfPresent (runAttributes, kCTUnderlineStyleAttributeName, (const void**) &underlineStyle))
|
|
|
|
{
|
|
|
|
if (CFGetTypeID (underlineStyle) == CFNumberGetTypeID())
|
|
|
|
{
|
|
|
|
int value = 0;
|
|
|
|
CFNumberGetValue (underlineStyle, kCFNumberLongType, (void*) &value);
|
|
|
|
|
|
|
|
return value != 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}();
|
|
|
|
|
|
|
|
glyphRun->font.setUnderline (isUnderlined);
|
|
|
|
|
|
|
|
CFRelease (cfsFontStyle);
|
|
|
|
CFRelease (cfsFontFamily);
|
|
|
|
}
|
|
|
|
|