fix bookmaker nightly

Move breakText example to SkFont_Reference.bmh

NOTRY=true
TBR=reed@google.com

Bug: skia:
Change-Id: I2876f0ecc63eb0a50d7232d2f66dae0d81e74b2a
Reviewed-on: https://skia-review.googlesource.com/c/175983
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-12-10 09:22:56 -05:00 committed by Skia Commit-Bot
parent f5bbf66eb4
commit e954b9df38
3 changed files with 25 additions and 23 deletions

View File

@ -691,7 +691,28 @@ Whether edge pixels draw opaque or with partial transparency.
#Populate
#Example
// incomplete
#Description
Line under "Breakfast" shows desired width, shorter than available characters.
Line under "Bre" shows measured width after breaking text.
##
#Height 128
#Width 280
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setTextSize(50);
const char str[] = "Breakfast";
const int count = sizeof(str) - 1;
canvas->drawText(str, count, 25, 50, paint);
SkScalar measuredWidth;
SkFont font;
font.setSize(50);
int partialBytes = font.breakText(str, count, kUTF8_SkTextEncoding,
100, &measuredWidth);
canvas->drawText(str, partialBytes, 25, 100, paint);
canvas->drawLine(25, 60, 25 + 100, 60, paint);
canvas->drawLine(25, 110, 25 + measuredWidth, 110, paint);
}
##
#SeeAlso incomplete

View File

@ -3286,27 +3286,8 @@ void draw(SkCanvas* canvas) {
#Line # returns text that fits in a width ##
#Populate
#Example
#Description
Line under "Breakfast" shows desired width, shorter than available characters.
Line under "Bre" shows measured width after breaking text.
##
#Height 128
#Width 280
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setTextSize(50);
const char str[] = "Breakfast";
const int count = sizeof(str) - 1;
canvas->drawText(str, count, 25, 50, paint);
SkScalar measuredWidth;
int partialBytes = paint.breakText(str, count, 100, &measuredWidth);
canvas->drawText(str, partialBytes, 25, 100, paint);
canvas->drawLine(25, 60, 25 + 100, 60, paint);
canvas->drawLine(25, 110, 25 + measuredWidth, 110, paint);
}
##
#NoExample
##
##

View File

@ -211,7 +211,7 @@ specifies specify specifying speed speeds spirit square squared squares stack st
standard standards stands start started starting starts state states stationary stay
stays std step steps still stock stop stops storage store stored stores storing straight
straight-line streams strength stretched strictly strikeout strings stripe stripes
striping stroke stroked strokes stroking struct studio style stylistic sub-pixel subclass
striping stroke stroked strokes stroking struct studio style stylistic subclass
submitting subsequent subsequently subset substitution subtle subtract subtracted subtracts
succeed succeeded succeeds success successful successfully successive such sufficient
suggests sum summing supplied supplies supply supplying support supported supports