OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2014 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #include "SkRefCnt.h" | |
9 #include "SkScalar.h" | |
10 | |
11 class SkTypeface; | |
12 | |
13 enum SkTextEncoding { | |
14 kUTF8_SkTextEncoding, | |
15 kUTF16_SkTextEncoding, | |
16 kUTF32_SkTextEncoding, | |
17 kGlyphID_SkTextEncoding, | |
18 }; | |
19 | |
20 class SkFont : public SkRefCnt { | |
21 public: | |
22 enum Flags { | |
bungeman-skia
2014/03/25 19:51:45
Should requests for synthetics go here (fake bold)
| |
23 kAutoHint_Flag = 1 << 0, | |
24 kByteCodeHint_Flag = 1 << 1, | |
25 kGridAlignMetrics_Flag = 1 << 2, | |
bungeman-skia
2014/03/25 19:51:45
These three bits are awesome, but I almost want a
| |
26 kVertical_Flag = 1 << 3, | |
27 kEmbeddedBitmaps_Flag = 1 << 4, | |
28 kGenA8FromLCD_Flag = 1 << 5, | |
29 kLCD_Mask_Flag = 1 << 6, | |
30 }; | |
31 uint32_t getFlags() const { return fFlags; } | |
32 | |
33 SkTypeface* getTypeface() const { return fTypeface; } | |
34 SkScalar getSize() const { return fSize; } | |
35 SkScalar getScaleX() const { return fScaleX; } | |
36 SkScalar getSkewX() const { return fSkewX; } | |
37 | |
38 int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding, | |
39 uint16_t glyphs[], int maxGlyphCount) const; | |
40 | |
41 SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) co nst; | |
42 | |
43 private: | |
44 virtual ~SkFont(); | |
45 | |
46 SkTypeface* fTypeface; | |
47 SkScalar fScale; | |
48 SkScalar fScaleX; | |
49 SkScalar fSkewX; | |
50 uint32_t fFlags; | |
51 }; | |
52 | |
OLD | NEW |