本文整理汇总了C++中SkPaint::setDevKernText方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPaint::setDevKernText方法的具体用法?C++ SkPaint::setDevKernText怎么用?C++ SkPaint::setDevKernText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPaint
的用法示例。
在下文中一共展示了SkPaint::setDevKernText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_paint
static SkPaint make_paint() {
SkPaint paint;
if (fuzz->exhausted()) {
return paint;
}
paint.setHinting(make_paint_hinting());
paint.setAntiAlias(make_bool());
paint.setDither(make_bool());
paint.setLinearText(make_bool());
paint.setSubpixelText(make_bool());
paint.setLCDRenderText(make_bool());
paint.setEmbeddedBitmapText(make_bool());
paint.setAutohinted(make_bool());
paint.setVerticalText(make_bool());
paint.setFakeBoldText(make_bool());
paint.setDevKernText(make_bool());
paint.setFilterQuality(make_filter_quality());
paint.setStyle(make_paint_style());
paint.setColor(make_color());
paint.setStrokeWidth(make_number(false));
paint.setStrokeMiter(make_number(false));
paint.setStrokeCap(make_paint_cap());
paint.setStrokeJoin(make_paint_join());
paint.setColorFilter(make_color_filter());
paint.setBlendMode(make_blendmode());
paint.setPathEffect(make_path_effect());
paint.setMaskFilter(make_mask_filter());
if (false) {
// our validating buffer does not support typefaces yet, so skip this for now
paint.setTypeface(SkTypeface::MakeFromName(make_font_name().c_str(),make_typeface_style()));
}
SkLayerRasterizer::Builder rasterizerBuilder;
SkPaint paintForRasterizer;
if (make_bool()) {
paintForRasterizer = make_paint();
}
rasterizerBuilder.addLayer(paintForRasterizer);
paint.setRasterizer(rasterizerBuilder.detach());
paint.setImageFilter(make_image_filter());
bool a, b, c;
fuzz->next(&a, &b, &c);
sk_sp<SkData> data(make_3Dlut(nullptr, a, b, c));
paint.setTextAlign(make_paint_align());
SkScalar d, e, f;
fuzz->next(&d, &e, &f);
paint.setTextSize(d);
paint.setTextScaleX(e);
paint.setTextSkewX(f);
paint.setTextEncoding(make_paint_text_encoding());
return paint;
}
示例2: fuzz_drawText
static void fuzz_drawText(Fuzz* fuzz, sk_sp<SkTypeface> font) {
SkPaint p;
init_paint(fuzz, &p);
sk_sp<SkSurface> surface;
init_surface(fuzz, &surface);
char text[kTxtLen];
init_string(fuzz, text, kTxtLen);
SkScalar x, y;
fuzz->next(&x, &y);
// populate pts array
SkPoint pts[kPtsLen];
for (uint8_t i = 0; i < kPtsLen; ++i) {
pts[i].set(x, y);
x += p.getTextSize();
}
p.setTypeface(font);
// set text related attributes
bool b;
fuzz->next(&b);
p.setAutohinted(b);
fuzz->next(&b);
p.setDevKernText(b);
fuzz->next(&b);
p.setEmbeddedBitmapText(b);
fuzz->next(&b);
p.setFakeBoldText(b);
fuzz->next(&b);
p.setLCDRenderText(b);
fuzz->next(&b);
p.setLinearText(b);
fuzz->next(&b);
p.setSubpixelText(b);
fuzz->next(&x);
p.setTextScaleX(x);
fuzz->next(&x);
p.setTextSkewX(x);
fuzz->next(&x);
p.setTextSize(x);
fuzz->next(&b);
p.setVerticalText(b);
SkCanvas* cnv = surface->getCanvas();
cnv->drawPosText(text, (kTxtLen-1), pts, p);
fuzz->next(&x);
fuzz->next(&y);
cnv->drawText(text, (kTxtLen-1), x, y, p);
}
示例3: make_paint
static SkPaint make_paint() {
SkPaint paint;
paint.setHinting(make_paint_hinting());
paint.setAntiAlias(make_bool());
paint.setDither(make_bool());
paint.setLinearText(make_bool());
paint.setSubpixelText(make_bool());
paint.setLCDRenderText(make_bool());
paint.setEmbeddedBitmapText(make_bool());
paint.setAutohinted(make_bool());
paint.setVerticalText(make_bool());
paint.setUnderlineText(make_bool());
paint.setStrikeThruText(make_bool());
paint.setFakeBoldText(make_bool());
paint.setDevKernText(make_bool());
paint.setFilterQuality(make_filter_quality());
paint.setStyle(make_paint_style());
paint.setColor(make_color());
paint.setStrokeWidth(make_scalar());
paint.setStrokeMiter(make_scalar());
paint.setStrokeCap(make_paint_cap());
paint.setStrokeJoin(make_paint_join());
paint.setColorFilter(make_color_filter());
paint.setXfermodeMode(make_xfermode());
paint.setPathEffect(make_path_effect());
paint.setMaskFilter(make_mask_filter());
if (false) {
// our validating buffer does not support typefaces yet, so skip this for now
SkAutoTUnref<SkTypeface> typeface(
SkTypeface::CreateFromName(make_font_name().c_str(), make_typeface_style()));
paint.setTypeface(typeface);
}
SkLayerRasterizer::Builder rasterizerBuilder;
SkPaint paintForRasterizer;
if (R(2) == 1) {
paintForRasterizer = make_paint();
}
rasterizerBuilder.addLayer(paintForRasterizer);
paint.setRasterizer(rasterizerBuilder.detach());
paint.setImageFilter(make_image_filter());
sk_sp<SkData> data(make_3Dlut(nullptr, make_bool(), make_bool(), make_bool()));
paint.setTextAlign(make_paint_align());
paint.setTextSize(make_scalar());
paint.setTextScaleX(make_scalar());
paint.setTextSkewX(make_scalar());
paint.setTextEncoding(make_paint_text_encoding());
return paint;
}
示例4: make_paint
static SkPaint make_paint() {
SkPaint paint;
paint.setHinting(make_paint_hinting());
paint.setAntiAlias(make_bool());
paint.setDither(make_bool());
paint.setLinearText(make_bool());
paint.setSubpixelText(make_bool());
paint.setLCDRenderText(make_bool());
paint.setEmbeddedBitmapText(make_bool());
paint.setAutohinted(make_bool());
paint.setVerticalText(make_bool());
paint.setFakeBoldText(make_bool());
paint.setDevKernText(make_bool());
paint.setFilterQuality(make_filter_quality());
paint.setStyle(make_paint_style());
paint.setColor(make_color());
paint.setStrokeWidth(make_scalar());
paint.setStrokeMiter(make_scalar());
paint.setStrokeCap(make_paint_cap());
paint.setStrokeJoin(make_paint_join());
paint.setColorFilter(make_color_filter());
paint.setBlendMode(make_xfermode());
paint.setPathEffect(make_path_effect());
paint.setMaskFilter(make_mask_filter());
if (false) {
// our validating buffer does not support typefaces yet, so skip this for now
paint.setTypeface(SkTypeface::MakeFromName(make_font_name().c_str(),
make_typeface_style()));
}
paint.setImageFilter(make_image_filter());
sk_sp<SkData> data(make_3Dlut(nullptr, make_bool(), make_bool(), make_bool()));
paint.setTextAlign(make_paint_align());
paint.setTextSize(make_scalar());
paint.setTextScaleX(make_scalar());
paint.setTextSkewX(make_scalar());
paint.setTextEncoding(make_paint_text_encoding());
return paint;
}