本文整理汇总了C++中IDWriteFactory::CreateRenderingParams方法的典型用法代码示例。如果您正苦于以下问题:C++ IDWriteFactory::CreateRenderingParams方法的具体用法?C++ IDWriteFactory::CreateRenderingParams怎么用?C++ IDWriteFactory::CreateRenderingParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDWriteFactory
的用法示例。
在下文中一共展示了IDWriteFactory::CreateRenderingParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFilterRec
void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const {
if (rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) {
rec->fMaskFormat = SkMask::kA8_Format;
}
unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag |
SkScalerContext::kDevKernText_Flag |
SkScalerContext::kForceAutohinting_Flag |
SkScalerContext::kEmbolden_Flag |
SkScalerContext::kLCD_Vertical_Flag;
rec->fFlags &= ~flagsWeDontSupport;
SkPaint::Hinting h = rec->getHinting();
// DirectWrite does not provide for hinting hints.
h = SkPaint::kSlight_Hinting;
rec->setHinting(h);
#if defined(SK_FONT_HOST_USE_SYSTEM_SETTINGS)
IDWriteFactory* factory = sk_get_dwrite_factory();
if (factory != nullptr) {
SkTScopedComPtr<IDWriteRenderingParams> defaultRenderingParams;
if (SUCCEEDED(factory->CreateRenderingParams(&defaultRenderingParams))) {
float gamma = defaultRenderingParams->GetGamma();
rec->setDeviceGamma(gamma);
rec->setPaintGamma(gamma);
rec->setContrast(defaultRenderingParams->GetEnhancedContrast());
}
}
#endif
}
示例2: ToTextAntialiasMode
void
DWriteContext::SetRenderingParams(
const DWriteRenderingParams *params)
{
if (mDWriteFactory == NULL)
return;
IDWriteRenderingParams *renderingParams = NULL;
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode =
D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
HRESULT hr;
if (params != NULL)
{
hr = mDWriteFactory->CreateCustomRenderingParams(params->gamma,
params->enhancedContrast, params->clearTypeLevel,
ToPixelGeometry(params->pixelGeometry),
ToRenderingMode(params->renderingMode), &renderingParams);
textAntialiasMode = ToTextAntialiasMode(params->textAntialiasMode);
}
else
hr = mDWriteFactory->CreateRenderingParams(&renderingParams);
if (SUCCEEDED(hr) && renderingParams != NULL)
{
SafeRelease(&mRenderingParams);
mRenderingParams = renderingParams;
mTextAntialiasMode = textAntialiasMode;
}
}
示例3: CreateRenderingParams
virtual HRESULT STDMETHODCALLTYPE CreateRenderingParams(
IDWriteRenderingParams** renderingParams
)
{
return orig_this->CreateRenderingParams(renderingParams);
}