diff options
| author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-23 15:30:44 +0000 |
|---|---|---|
| committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-23 15:30:44 +0000 |
| commit | 00245c94cd25dcff96fa8d54849327dc7f7f2852 (patch) | |
| tree | 7a42e1245fc87351758e443a74ead1de3b35369c /samplecode/SampleFontScalerTest.cpp | |
| parent | 647a804c3dd53b6743091ec97dd12111f90efec3 (diff) | |
test subpixeltext
git-svn-id: http://skia.googlecode.com/svn/trunk@2161 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleFontScalerTest.cpp')
| -rw-r--r-- | samplecode/SampleFontScalerTest.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp index 402c6d88c2..9d3e153e07 100644 --- a/samplecode/SampleFontScalerTest.cpp +++ b/samplecode/SampleFontScalerTest.cpp @@ -45,7 +45,7 @@ public: fFaces[i] = SkTypeface::CreateFromName(gFaces[i].fName, gFaces[i].fStyle); } - this->setBGColor(0xFFDDDDDD); +// this->setBGColor(0xFFDDDDDD); } virtual ~FontScalerTestView() { @@ -87,12 +87,13 @@ protected: canvas->drawPath(path, paint); } +// paint.setSubpixelText(true); paint.setAntiAlias(true); paint.setLCDRenderText(true); SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromName("Times Roman", SkTypeface::kNormal))); // const char* text = "abcdefghijklmnopqrstuvwxyz"; - const char* text = "HnHnHnHnHnHnHnH"; + const char* text = "Hamburgefons ooo mmm"; const size_t textLen = strlen(text); for (int j = 0; j < 2; ++j) { @@ -102,7 +103,7 @@ protected: SkAutoCanvasRestore acr(canvas, true); canvas->translate(50 + i * 230, 20); - rotate_about(canvas, i * 7, x, y * 10); + rotate_about(canvas, i * 5, x, y * 10); { SkPaint p; @@ -113,7 +114,7 @@ protected: } int index = 0; - for (int ps = 9; ps <= 24; ps++) { + for (int ps = 6; ps <= 22; ps++) { paint.setTextSize(SkIntToScalar(ps)); canvas->drawText(text, textLen, x, y, paint); y += paint.getFontMetrics(NULL); @@ -121,7 +122,7 @@ protected: } } canvas->translate(0, 400); - paint.setLinearText(true); + paint.setSubpixelText(true); } } |
