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

Side by Side Diff: src/ports/SkFontConfigTypeface.h

Issue 23966003: Update the freetype backed fonthost to keep the style and fixed width attributes for a font stream. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: updating per comments Created 7 years, 3 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 | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontHost_fontconfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 #include "SkFontConfigInterface.h" 8 #include "SkFontConfigInterface.h"
9 #include "SkFontHost_FreeType_common.h" 9 #include "SkFontHost_FreeType_common.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
11 #include "SkTypefaceCache.h" 11 #include "SkTypefaceCache.h"
12 12
13 class SkFontDescriptor; 13 class SkFontDescriptor;
14 14
15 class FontConfigTypeface : public SkTypeface_FreeType { 15 class FontConfigTypeface : public SkTypeface_FreeType {
16 SkFontConfigInterface::FontIdentity fIdentity; 16 SkFontConfigInterface::FontIdentity fIdentity;
17 SkString fFamilyName; 17 SkString fFamilyName;
18 SkStream* fLocalStream; 18 SkStream* fLocalStream;
19 19
20 public: 20 public:
21 FontConfigTypeface(Style style, 21 FontConfigTypeface(Style style,
22 const SkFontConfigInterface::FontIdentity& fi, 22 const SkFontConfigInterface::FontIdentity& fi,
23 const SkString& familyName) 23 const SkString& familyName)
24 : INHERITED(style, SkTypefaceCache::NewFontID(), false) 24 : INHERITED(style, SkTypefaceCache::NewFontID(), false)
25 , fIdentity(fi) 25 , fIdentity(fi)
26 , fFamilyName(familyName) 26 , fFamilyName(familyName)
27 , fLocalStream(NULL) {} 27 , fLocalStream(NULL) {}
28 28
29 FontConfigTypeface(Style style, SkStream* localStream) 29 FontConfigTypeface(Style style, bool fixedWidth, SkStream* localStream)
30 : INHERITED(style, SkTypefaceCache::NewFontID(), false) { 30 : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth) {
31 // we default to empty fFamilyName and fIdentity 31 // we default to empty fFamilyName and fIdentity
32 fLocalStream = localStream; 32 fLocalStream = localStream;
33 SkSafeRef(localStream); 33 SkSafeRef(localStream);
34 } 34 }
35 35
36 virtual ~FontConfigTypeface() { 36 virtual ~FontConfigTypeface() {
37 SkSafeUnref(fLocalStream); 37 SkSafeUnref(fLocalStream);
38 } 38 }
39 39
40 const SkFontConfigInterface::FontIdentity& getIdentity() const { 40 const SkFontConfigInterface::FontIdentity& getIdentity() const {
(...skipping 14 matching lines...) Expand all
55 protected: 55 protected:
56 friend class SkFontHost; // hack until we can make public versions 56 friend class SkFontHost; // hack until we can make public versions
57 57
58 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE ; 58 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE ;
59 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; 59 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE;
60 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE; 60 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE;
61 61
62 private: 62 private:
63 typedef SkTypeface_FreeType INHERITED; 63 typedef SkTypeface_FreeType INHERITED;
64 }; 64 };
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontHost_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698