本文整理汇总了C++中FontStyle::getItalic方法的典型用法代码示例。如果您正苦于以下问题:C++ FontStyle::getItalic方法的具体用法?C++ FontStyle::getItalic怎么用?C++ FontStyle::getItalic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontStyle
的用法示例。
在下文中一共展示了FontStyle::getItalic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeMatch
// Compute a matching metric between two styles - 0 is an exact match
static int computeMatch(FontStyle style1, FontStyle style2) {
if (style1 == style2)
return 0;
int score = abs(style1.getWeight() - style2.getWeight());
if (style1.getItalic() != style2.getItalic()) {
score += 2;
}
return score;
}
示例2: computeFakery
static FontFakery computeFakery(FontStyle wanted, FontStyle actual) {
// If desired weight is semibold or darker, and 2 or more grades
// higher than actual (for example, medium 500 -> bold 700), then
// select fake bold.
int wantedWeight = wanted.getWeight();
bool isFakeBold =
wantedWeight >= 6 && (wantedWeight - actual.getWeight()) >= 2;
bool isFakeItalic = wanted.getItalic() && !actual.getItalic();
return FontFakery(isFakeBold, isFakeItalic);
}
示例3: doLayout
void MinikinUtils::doLayout(Layout* layout, const Paint* paint, int bidiFlags, TypefaceImpl* typeface,
const uint16_t* buf, size_t start, size_t count, size_t bufSize) {
TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(typeface);
layout->setFontCollection(resolvedFace->fFontCollection);
FontStyle resolved = resolvedFace->fStyle;
/* Prepare minikin FontStyle */
std::string lang = paint->getTextLocale();
FontLanguage minikinLang(lang.c_str(), lang.size());
FontVariant minikinVariant = (paint->getFontVariant() == VARIANT_ELEGANT) ? VARIANT_ELEGANT
: VARIANT_COMPACT;
FontStyle minikinStyle(minikinLang, minikinVariant, resolved.getWeight(), resolved.getItalic());
/* Prepare minikin Paint */
MinikinPaint minikinPaint;
minikinPaint.size = (int)/*WHY?!*/paint->getTextSize();
minikinPaint.scaleX = paint->getTextScaleX();
minikinPaint.skewX = paint->getTextSkewX();
minikinPaint.letterSpacing = paint->getLetterSpacing();
minikinPaint.paintFlags = MinikinFontSkia::packPaintFlags(paint);
minikinPaint.fontFeatureSettings = paint->getFontFeatureSettings();
layout->doLayout(buf, start, count, bufSize, bidiFlags, minikinStyle, minikinPaint);
}