Kaydet (Commit) 6e082083 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i124122# emulate bold font weights for CoreText if needed

üst 2a589af3
...@@ -141,6 +141,16 @@ CTTextStyle::CTTextStyle( const ImplFontSelectData& rFSD ) ...@@ -141,6 +141,16 @@ CTTextStyle::CTTextStyle( const ImplFontSelectData& rFSD )
CFDictionarySetValue( mpStyleDict, kCTFontAttributeName, pNewCTFont ); CFDictionarySetValue( mpStyleDict, kCTFontAttributeName, pNewCTFont );
CFRelease( pNewCTFont); CFRelease( pNewCTFont);
// handle emulation of bold styles if requested and the font that doesn't provide them
if( (pReqFont->meWeight > WEIGHT_MEDIUM)
&& (mpFontData->meWeight <= WEIGHT_MEDIUM)
&& (mpFontData->meWeight != WEIGHT_DONTKNOW))
{
const int nBoldFactor = -lrint( (3.5F * pReqFont->meWeight) / mpFontData->meWeight);
CFNumberRef pCFIntBold = CFNumberCreate( NULL, kCFNumberIntType, &nBoldFactor);
CFDictionarySetValue( mpStyleDict, kCTStrokeWidthAttributeName, pCFIntBold);
}
#if 0 // LastResort is implicit in CoreText's font cascading #if 0 // LastResort is implicit in CoreText's font cascading
const void* aGFBDescriptors[] = { CTFontDescriptorCreateWithNameAndSize( CFSTR("LastResort"), 0) }; // TODO: use the full GFB list const void* aGFBDescriptors[] = { CTFontDescriptorCreateWithNameAndSize( CFSTR("LastResort"), 0) }; // TODO: use the full GFB list
const int nGfbCount = sizeof(aGFBDescriptors) / sizeof(*aGFBDescriptors); const int nGfbCount = sizeof(aGFBDescriptors) / sizeof(*aGFBDescriptors);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment