1cb93a386Sopenharmony_ci#if 0 // Disabled until updated to use current API. 2cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 3cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 4cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 5cb93a386Sopenharmony_ci// HASH=3cad18678254526be66ef162eecd1d23 6cb93a386Sopenharmony_ciREG_FIDDLE(Font_breakText, 280, 128, false, 0) { 7cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 8cb93a386Sopenharmony_ci SkPaint paint; 9cb93a386Sopenharmony_ci paint.setAntiAlias(true); 10cb93a386Sopenharmony_ci paint.setTextSize(50); 11cb93a386Sopenharmony_ci const char str[] = "Breakfast"; 12cb93a386Sopenharmony_ci const int count = sizeof(str) - 1; 13cb93a386Sopenharmony_ci canvas->drawText(str, count, 25, 50, paint); 14cb93a386Sopenharmony_ci SkScalar measuredWidth; 15cb93a386Sopenharmony_ci SkFont font; 16cb93a386Sopenharmony_ci font.setSize(50); 17cb93a386Sopenharmony_ci int partialBytes = font.breakText(str, count, SkTextEncoding::kUTF8, 18cb93a386Sopenharmony_ci 100, &measuredWidth); 19cb93a386Sopenharmony_ci canvas->drawText(str, partialBytes, 25, 100, paint); 20cb93a386Sopenharmony_ci canvas->drawLine(25, 60, 25 + 100, 60, paint); 21cb93a386Sopenharmony_ci canvas->drawLine(25, 110, 25 + measuredWidth, 110, paint); 22cb93a386Sopenharmony_ci} 23cb93a386Sopenharmony_ci} // END FIDDLE 24cb93a386Sopenharmony_ci#endif // Disabled until updated to use current API. 25