From e954b9df38817c1c198b0224b6b5dd0491ec1ca5 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 10 Dec 2018 09:22:56 -0500 Subject: [PATCH] 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 Commit-Queue: Cary Clark Auto-Submit: Cary Clark --- docs/SkFont_Reference.bmh | 23 ++++++++++++++++++++++- docs/SkPaint_Reference.bmh | 23 ++--------------------- docs/spelling.txt | 2 +- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/docs/SkFont_Reference.bmh b/docs/SkFont_Reference.bmh index 1d69f3488d..516da21777 100644 --- a/docs/SkFont_Reference.bmh +++ b/docs/SkFont_Reference.bmh @@ -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 diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh index f8427b67d7..50f2dee7ee 100644 --- a/docs/SkPaint_Reference.bmh +++ b/docs/SkPaint_Reference.bmh @@ -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 +## ## diff --git a/docs/spelling.txt b/docs/spelling.txt index 796637b535..b1a304a803 100644 --- a/docs/spelling.txt +++ b/docs/spelling.txt @@ -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