|
|
@@ -153,8 +153,8 @@ namespace DirectWriteTypeLayout |
|
|
|
HRESULT hr = fontCollection->GetFontFromFontFace (glyphRun->fontFace, dwFont.resetAndGetPointerAddress());
|
|
|
|
jassert (dwFont != nullptr);
|
|
|
|
|
|
|
|
if (dwFont->GetWeight() == DWRITE_FONT_WEIGHT_BOLD) styleFlags &= Font::bold;
|
|
|
|
if (dwFont->GetStyle() == DWRITE_FONT_STYLE_ITALIC) styleFlags &= Font::italic;
|
|
|
|
if (dwFont->GetWeight() == DWRITE_FONT_WEIGHT_BOLD) styleFlags |= Font::bold;
|
|
|
|
if (dwFont->GetStyle() == DWRITE_FONT_STYLE_ITALIC) styleFlags |= Font::italic;
|
|
|
|
|
|
|
|
ComSmartPtr<IDWriteFontFamily> dwFontFamily;
|
|
|
|
hr = dwFont->GetFontFamily (dwFontFamily.resetAndGetPointerAddress());
|
|
|
@@ -248,12 +248,17 @@ namespace DirectWriteTypeLayout |
|
|
|
range.startPosition = attr.range.getStart();
|
|
|
|
range.length = jmin (attr.range.getLength(), textLen - attr.range.getStart());
|
|
|
|
|
|
|
|
if (attr.getFont() != nullptr)
|
|
|
|
const Font* const font = attr.getFont();
|
|
|
|
|
|
|
|
if (font != nullptr)
|
|
|
|
{
|
|
|
|
textLayout->SetFontFamilyName (attr.getFont()->getTypefaceName().toWideCharPointer(), range);
|
|
|
|
textLayout->SetFontFamilyName (font->getTypefaceName().toWideCharPointer(), range);
|
|
|
|
|
|
|
|
const float fontHeightToEmSizeFactor = getFontHeightToEmSizeFactor (*font, *fontCollection);
|
|
|
|
textLayout->SetFontSize (font->getHeight() * fontHeightToEmSizeFactor, range);
|
|
|
|
|
|
|
|
const float fontHeightToEmSizeFactor = getFontHeightToEmSizeFactor (*attr.getFont(), *fontCollection);
|
|
|
|
textLayout->SetFontSize (attr.getFont()->getHeight() * fontHeightToEmSizeFactor, range);
|
|
|
|
if (font->isBold()) textLayout->SetFontWeight (DWRITE_FONT_WEIGHT_BOLD, range);
|
|
|
|
if (font->isItalic()) textLayout->SetFontStyle (DWRITE_FONT_STYLE_ITALIC, range);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attr.getColour() != nullptr)
|
|
|
|