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

Side by Side Diff: gm/fontscaler.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/fontcache.cpp ('k') | gm/gammatext.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 2011 Google Inc. 2 * Copyright 2011 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 "SkTypeface.h" 8 #include "SkTypeface.h"
9 9
10 namespace skiagm { 10 namespace skiagm {
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 virtual void onDraw(SkCanvas* canvas) { 42 virtual void onDraw(SkCanvas* canvas) {
43 SkPaint paint; 43 SkPaint paint;
44 44
45 paint.setAntiAlias(true); 45 paint.setAntiAlias(true);
46 paint.setLCDRenderText(true); 46 paint.setLCDRenderText(true);
47 //With freetype the default (normal hinting) can be really ugly. 47 //With freetype the default (normal hinting) can be really ugly.
48 //Most distros now set slight (vertical hinting only) in any event. 48 //Most distros now set slight (vertical hinting only) in any event.
49 paint.setHinting(SkPaint::kSlight_Hinting); 49 paint.setHinting(SkPaint::kSlight_Hinting);
50 SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromName("Times Roman", SkTypeface::kNormal))); 50 sk_tool_utils::set_portable_typeface(&paint, "Times Roman", SkTypeface:: kNormal);
51 51
52 const char* text = "Hamburgefons ooo mmm"; 52 const char* text = "Hamburgefons ooo mmm";
53 const size_t textLen = strlen(text); 53 const size_t textLen = strlen(text);
54 54
55 for (int j = 0; j < 2; ++j) { 55 for (int j = 0; j < 2; ++j) {
56 // This used to do 6 iterations but it causes the N4 to crash in the MSAA4 config. 56 // This used to do 6 iterations but it causes the N4 to crash in the MSAA4 config.
57 for (int i = 0; i < 5; ++i) { 57 for (int i = 0; i < 5; ++i) {
58 SkScalar x = SkIntToScalar(10); 58 SkScalar x = SkIntToScalar(10);
59 SkScalar y = SkIntToScalar(20); 59 SkScalar y = SkIntToScalar(20);
60 60
(...skipping 27 matching lines...) Expand all
88 private: 88 private:
89 typedef GM INHERITED; 89 typedef GM INHERITED;
90 }; 90 };
91 91
92 ////////////////////////////////////////////////////////////////////////////// 92 //////////////////////////////////////////////////////////////////////////////
93 93
94 static GM* MyFactory(void*) { return new FontScalerGM; } 94 static GM* MyFactory(void*) { return new FontScalerGM; }
95 static GMRegistry reg(MyFactory); 95 static GMRegistry reg(MyFactory);
96 96
97 } 97 }
OLDNEW
« no previous file with comments | « gm/fontcache.cpp ('k') | gm/gammatext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698