| OLD | NEW |
| 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 | 7 |
| 8 | 8 |
| 9 #include "gm.h" | 9 #include "gm.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| 11 #include "SkTypeface.h" | 11 #include "SkTypeface.h" |
| 12 | 12 |
| 13 namespace skiagm { | 13 namespace skiagm { |
| 14 | 14 |
| 15 #define TEXT_SIZE 48 | 15 #define TEXT_SIZE 48 |
| 16 static const char gText[] = "Hello"; | 16 constexpr char gText[] = "Hello"; |
| 17 | 17 |
| 18 //Before shaping | 18 //Before shaping |
| 19 //static const char gText[] = "「テスト。」"; | 19 //constexpr char gText[] = "「テスト。」"; |
| 20 //static const char gText[] = {0xE3,0x80,0x8C, 0xE3,0x83,0x86, 0xE3,0x82,0xB9, 0
xE3,0x83,0x88, 0xE3,0x80,0x82, 0xE3,0x80,0x8D, 0x0}; | 20 //constexpr char gText[] = {0xE3,0x80,0x8C, 0xE3,0x83,0x86, 0xE3,0x82,0xB9, 0xE3
,0x83,0x88, 0xE3,0x80,0x82, 0xE3,0x80,0x8D, 0x0}; |
| 21 | 21 |
| 22 //After shaping | 22 //After shaping |
| 23 //static const char gText[] = "﹁テスト︒﹂"; | 23 //constexpr char gText[] = "﹁テスト︒﹂"; |
| 24 //static const char gText[] = {0xEF,0xB9,0x81, 0xE3,0x83,0x86, 0xE3,0x82,0xB9, 0
xE3,0x83,0x88, 0xEF,0xB8,0x92, 0xEF,0xB9,0x82, 0x0}; | 24 //constexpr char gText[] = {0xEF,0xB9,0x81, 0xE3,0x83,0x86, 0xE3,0x82,0xB9, 0xE3
,0x83,0x88, 0xEF,0xB8,0x92, 0xEF,0xB9,0x82, 0x0}; |
| 25 | 25 |
| 26 static const size_t gLen = sizeof(gText) - sizeof(gText[0]); | 26 constexpr size_t gLen = sizeof(gText) - sizeof(gText[0]); |
| 27 | 27 |
| 28 class VertTextGM : public GM { | 28 class VertTextGM : public GM { |
| 29 public: | 29 public: |
| 30 VertTextGM() | 30 VertTextGM() |
| 31 // : fFace(SkTypeface::CreateFromName("unifont", SkTypeface::kNormal)) | 31 // : fFace(SkTypeface::CreateFromName("unifont", SkTypeface::kNormal)) |
| 32 // : fFace(SkTypeface::CreateFromFile("MotoyaL04Mincho_3.ttf")) | 32 // : fFace(SkTypeface::CreateFromFile("MotoyaL04Mincho_3.ttf")) |
| 33 | 33 |
| 34 // Bitmap fonts on OS X. | 34 // Bitmap fonts on OS X. |
| 35 // : fFace(SkTypeface::CreateFromName("GB18030 Bitmap", SkTypeface::kNor
mal)) | 35 // : fFace(SkTypeface::CreateFromName("GB18030 Bitmap", SkTypeface::kNor
mal)) |
| 36 // : fFace(SkTypeface::CreateFromName("Apple Color Emoji", SkTypeface::k
Normal)) | 36 // : fFace(SkTypeface::CreateFromName("Apple Color Emoji", SkTypeface::k
Normal)) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 private: | 111 private: |
| 112 typedef GM INHERITED; | 112 typedef GM INHERITED; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 /////////////////////////////////////////////////////////////////////////////// | 115 /////////////////////////////////////////////////////////////////////////////// |
| 116 | 116 |
| 117 static GM* MyFactory(void*) { return new VertTextGM; } | 117 static GM* MyFactory(void*) { return new VertTextGM; } |
| 118 static GMRegistry reg(MyFactory); | 118 static GMRegistry reg(MyFactory); |
| 119 | 119 |
| 120 } | 120 } |
| OLD | NEW |