Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: tools/sk_tool_utils.h

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/create_test_font.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef sk_tool_utils_DEFINED 8 #ifndef sk_tool_utils_DEFINED
9 #define sk_tool_utils_DEFINED 9 #define sk_tool_utils_DEFINED
10 10
11 #include "SkBitmap.h"
12 #include "SkCanvas.h"
13 #include "SkImageInfo.h" 11 #include "SkImageInfo.h"
14 #include "SkPaint.h"
15 #include "SkTypeface.h" 12 #include "SkTypeface.h"
16 13
14 class SkBitmap;
15 class SkCanvas;
16 class SkPaint;
17 class SkTestFont;
18
17 namespace sk_tool_utils { 19 namespace sk_tool_utils {
18 20
19 extern bool gEnablePortableTypeface;
20
21 const char* colortype_name(SkColorType); 21 const char* colortype_name(SkColorType);
22 22
23 /** 23 /**
24 * Sets the paint to use a platform-independent text renderer. 24 * Sets the paint to use a platform-independent text renderer.
25 */ 25 */
26 void set_portable_typeface(SkPaint* paint, SkTypeface::Style style = SkTypef ace::kNormal); 26 void set_portable_typeface(SkPaint* paint, const char* name = NULL,
27 SkTypeface::Style style = SkTypeface::kNormal);
28 SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style sty le);
29 void report_used_chars();
27 30
28 /** 31 /**
29 * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims 32 * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims
30 * the pixels are colorType + alphaType 33 * the pixels are colorType + alphaType
31 */ 34 */
32 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA lphaType); 35 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA lphaType);
33 36
37 // private to sk_tool_utils
38 SkTypeface* create_font(const char* name, SkTypeface::Style );
39 SkTypeface* resource_font(const char* name, SkTypeface::Style );
40
34 } // namespace sk_tool_utils 41 } // namespace sk_tool_utils
35 42
36 #endif // sk_tool_utils_DEFINED 43 #endif // sk_tool_utils_DEFINED
OLDNEW
« no previous file with comments | « tools/create_test_font.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698