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

Side by Side Diff: gm/deviceproperties.cpp

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 | « gm/cubicpaths.cpp ('k') | gm/downsamplebitmap.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 2013 Google Inc. 2 * Copyright 2013 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 #include "gm.h" 7 #include "gm.h"
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkTypeface.h" 9 #include "SkTypeface.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 SkCanvas canvas(&device); 48 SkCanvas canvas(&device);
49 canvas.drawColor(SK_ColorWHITE); 49 canvas.drawColor(SK_ColorWHITE);
50 50
51 SkPaint paint; 51 SkPaint paint;
52 52
53 paint.setAntiAlias(true); 53 paint.setAntiAlias(true);
54 paint.setLCDRenderText(true); 54 paint.setLCDRenderText(true);
55 //With freetype the default (normal hinting) can be really ugly. 55 //With freetype the default (normal hinting) can be really ugly.
56 //Most distros now set slight (vertical hinting only) in any event. 56 //Most distros now set slight (vertical hinting only) in any event.
57 paint.setHinting(SkPaint::kSlight_Hinting); 57 paint.setHinting(SkPaint::kSlight_Hinting);
58 SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromName("Times Roman", SkTypeface::kNormal))); 58 sk_tool_utils::set_portable_typeface(&paint, "Times Roman", SkTypeface:: kNormal);
59 59
60 const char* text = "Hamburgefons ooo mmm"; 60 const char* text = "Hamburgefons ooo mmm";
61 const size_t textLen = strlen(text); 61 const size_t textLen = strlen(text);
62 62
63 for (int j = 0; j < 2; ++j) { 63 for (int j = 0; j < 2; ++j) {
64 for (int i = 0; i < 6; ++i) { 64 for (int i = 0; i < 6; ++i) {
65 SkScalar x = SkIntToScalar(10); 65 SkScalar x = SkIntToScalar(10);
66 SkScalar y = SkIntToScalar(20); 66 SkScalar y = SkIntToScalar(20);
67 67
68 SkAutoCanvasRestore acr(&canvas, true); 68 SkAutoCanvasRestore acr(&canvas, true);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 private: 104 private:
105 typedef GM INHERITED; 105 typedef GM INHERITED;
106 }; 106 };
107 107
108 ////////////////////////////////////////////////////////////////////////////// 108 //////////////////////////////////////////////////////////////////////////////
109 109
110 static GM* MyFactory(void*) { return new DevicePropertiesGM; } 110 static GM* MyFactory(void*) { return new DevicePropertiesGM; }
111 static GMRegistry reg(MyFactory); 111 static GMRegistry reg(MyFactory);
112 112
113 } 113 }
OLDNEW
« no previous file with comments | « gm/cubicpaths.cpp ('k') | gm/downsamplebitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698