Use hintgasp font when testing rendering.
authorbungeman <bungeman@google.com>
Tue, 12 Jul 2016 13:55:25 +0000 (06:55 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 12 Jul 2016 13:55:25 +0000 (06:55 -0700)
The hintgasp font was added specifically for the typefacerendering gm.
However, this gm didn't actually use the font, so now use it. In
addition this adds embedded bitmap strikes to the hintgasp font and the
gm is updated to test these as well.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2140863002

NOTREECHECKS=true
Test only change, does not affect users.

Review-Url: https://codereview.chromium.org/2140863002

gm/typeface.cpp
resources/fonts/hintgasp.ttf

index 8b6a648..34420db 100644 (file)
@@ -180,7 +180,7 @@ protected:
     }
 
     SkISize onISize() override {
-        return SkISize::Make(640, 480);
+        return SkISize::Make(640, 680);
     }
 
     void onDraw(SkCanvas* canvas) override {
@@ -204,7 +204,8 @@ protected:
         // GASP_DOGRAY|GASP_GRIDFIT                         0x0003  13<=ppem<=14
         // GASP_SYMMETRIC_SMOOTHING|GASP_SYMMETRIC_GRIDFIT  0x000C  13<=ppem<=14
         // (neither)                                        0x0000  15<=ppem
-        constexpr SkScalar textSizes[] = { 10, 12, 14, 16 };
+        // Odd sizes have embedded bitmaps.
+        constexpr SkScalar textSizes[] = { 9, 10, 11, 12, 13, 14, 15, 16 };
 
         constexpr SkPaint::Hinting hintingTypes[] = { SkPaint::kNo_Hinting,
                                                       SkPaint::kSlight_Hinting,
@@ -224,6 +225,9 @@ protected:
         constexpr bool rotateABitTypes[] = { false, true };
 
         SkPaint paint;
+        paint.setTypeface(fFace);
+        paint.setEmbeddedBitmapText(true);
+
         SkScalar x = 0;
         SkScalar xMax = x;
         SkScalar xBase = 0;
index f533643..ce1771e 100644 (file)
Binary files a/resources/fonts/hintgasp.ttf and b/resources/fonts/hintgasp.ttf differ