当前位置: 首页>>代码示例>>C++>>正文


C++ FontStyle::getItalic方法代码示例

本文整理汇总了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;
}
开发者ID:mikejurka,项目名称:engine,代码行数:10,代码来源:FontFamily.cpp

示例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);
}
开发者ID:mikejurka,项目名称:engine,代码行数:10,代码来源:FontFamily.cpp

示例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);
}
开发者ID:ArunkumarUnity,项目名称:platform_frameworks_base,代码行数:24,代码来源:MinikinUtils.cpp


注:本文中的FontStyle::getItalic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。