本文整理汇总了C++中SkPaint::isLinearText方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPaint::isLinearText方法的具体用法?C++ SkPaint::isLinearText怎么用?C++ SkPaint::isLinearText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPaint
的用法示例。
在下文中一共展示了SkPaint::isLinearText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Make
sk_sp<SkFont> SkFont::Testing_CreateFromPaint(const SkPaint& paint) {
uint32_t flags = 0;
if (paint.isVerticalText()) {
flags |= kVertical_Flag;
}
if (paint.isEmbeddedBitmapText()) {
flags |= kEmbeddedBitmaps_Flag;
}
if (paint.getFlags() & SkPaint::kGenA8FromLCD_Flag) {
flags |= kGenA8FromLCD_Flag;
}
if (paint.isFakeBoldText()) {
flags |= kEmbolden_Flag;
}
if (SkPaint::kFull_Hinting == paint.getHinting()) {
flags |= kEnableByteCodeHints_Flag;
}
if (paint.isAutohinted()) {
flags |= kEnableAutoHints_Flag;
}
if (paint.isSubpixelText() || paint.isLinearText()) {
// this is our default
} else {
flags |= kUseNonlinearMetrics_Flag;
}
MaskType maskType = SkFont::kBW_MaskType;
if (paint.isAntiAlias()) {
maskType = paint.isLCDRenderText() ? kLCD_MaskType : kA8_MaskType;
}
return Make(sk_ref_sp(paint.getTypeface()), paint.getTextSize(), paint.getTextScaleX(),
paint.getTextSkewX(), maskType, flags);
}
示例2: stringForSkPaintFlags
String LoggingCanvas::stringForSkPaintFlags(const SkPaint& paint)
{
if (!paint.getFlags())
return "none";
String flagsString = "";
appendFlagToString(&flagsString, paint.isAntiAlias(), "AntiAlias");
appendFlagToString(&flagsString, paint.isDither(), "Dither");
appendFlagToString(&flagsString, paint.isUnderlineText(), "UnderlinText");
appendFlagToString(&flagsString, paint.isStrikeThruText(), "StrikeThruText");
appendFlagToString(&flagsString, paint.isFakeBoldText(), "FakeBoldText");
appendFlagToString(&flagsString, paint.isLinearText(), "LinearText");
appendFlagToString(&flagsString, paint.isSubpixelText(), "SubpixelText");
appendFlagToString(&flagsString, paint.isDevKernText(), "DevKernText");
appendFlagToString(&flagsString, paint.isLCDRenderText(), "LCDRenderText");
appendFlagToString(&flagsString, paint.isEmbeddedBitmapText(), "EmbeddedBitmapText");
appendFlagToString(&flagsString, paint.isAutohinted(), "Autohinted");
appendFlagToString(&flagsString, paint.isVerticalText(), "VerticalText");
appendFlagToString(&flagsString, paint.getFlags() & SkPaint::kGenA8FromLCD_Flag, "GenA8FromLCD");
return flagsString;
}
示例3: is_use_nonlinear_metrics
static bool is_use_nonlinear_metrics(const SkPaint& paint) {
return !paint.isSubpixelText() && !paint.isLinearText();
}