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

Side by Side Diff: include/core/SkFont.h

Issue 185293018: WIP -- SkFont (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: new take on flags Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkFont.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698