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

Side by Side Diff: src/core/SkFontHost.cpp

Issue 13094005: impl part of SKFontMgr for mac (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | « include/ports/SkFontMgr.h ('k') | src/ports/SkFontHost_mac.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 2009 The Android Open Source Project 2 * Copyright 2009 The Android Open Source Project
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 "SkFontLCDConfig.h" 8 #include "SkFontLCDConfig.h"
9 9
10 static SkFontLCDConfig::LCDOrientation gLCDOrientation = SkFontLCDConfig::kHoriz ontal_LCDOrientation; 10 static SkFontLCDConfig::LCDOrientation gLCDOrientation = SkFontLCDConfig::kHoriz ontal_LCDOrientation;
(...skipping 28 matching lines...) Expand all
39 SkFontLCDConfig::SetSubpixelOrientation((SkFontLCDConfig::LCDOrientation)ori entation); 39 SkFontLCDConfig::SetSubpixelOrientation((SkFontLCDConfig::LCDOrientation)ori entation);
40 } 40 }
41 41
42 SkFontHost::LCDOrder SkFontHost::GetSubpixelOrder() { 42 SkFontHost::LCDOrder SkFontHost::GetSubpixelOrder() {
43 return (SkFontHost::LCDOrder)SkFontLCDConfig::GetSubpixelOrder(); 43 return (SkFontHost::LCDOrder)SkFontLCDConfig::GetSubpixelOrder();
44 } 44 }
45 45
46 void SkFontHost::SetSubpixelOrder(LCDOrder order) { 46 void SkFontHost::SetSubpixelOrder(LCDOrder order) {
47 SkFontLCDConfig::SetSubpixelOrder((SkFontLCDConfig::LCDOrder)order); 47 SkFontLCDConfig::SetSubpixelOrder((SkFontLCDConfig::LCDOrder)order);
48 } 48 }
49
50 ///////////////////////////////////////////////////////////////////////////////
51 ///////////////////////////////////////////////////////////////////////////////
52
53 #include "SkFontMgr.h"
54
55 SkFontStyle::SkFontStyle() {
56 fUnion.fU32 = 0;
57 fUnion.fR.fWeight = kNormal_Weight;
58 fUnion.fR.fWidth = kNormal_Width;
59 fUnion.fR.fSlant = kUpright_Slant;
60 }
61
62 SkFontStyle::SkFontStyle(int weight, int width, Slant slant) {
63 fUnion.fU32 = 0;
64 fUnion.fR.fWeight = SkPin32(weight, kThin_Weight, kBlack_Weight);
65 fUnion.fR.fWidth = SkPin32(width, kUltraCondensed_Width, kUltaExpanded_Width );
66 fUnion.fR.fSlant = kUpright_Slant;
sugoi 2013/03/26 18:03:42 Not sure if this is the intended behavior, but the
67 }
68
69 int SkFontMgr::countFamilies() {
70 return this->onCountFamilies();
71 }
72
73 void SkFontMgr::getFamilyName(int index, SkString* familyName) {
74 this->onGetFamilyName(index, familyName);
75 }
76
77 SkFontStyleSet* SkFontMgr::createStyleSet(int index) {
78 return this->onCreateStyleSet(index);
79 }
80
81 SkTypeface* SkFontMgr::matchFamilyStyle(const char familyName[],
82 const SkFontStyle& fs) {
83 return this->onMatchFamilyStyle(familyName, fs);
84 }
85
86 SkTypeface* SkFontMgr::matchFaceStyle(const SkTypeface* face,
87 const SkFontStyle& fs) {
88 return this->matchFaceStyle(face, fs);
89 }
90
91 SkTypeface* SkFontMgr::createFromData(SkData* data, int ttcIndex) {
92 return this->onCreateFromData(data, ttcIndex);
93 }
94
95 SkTypeface* SkFontMgr::createFromStream(SkStream* stream, int ttcIndex) {
96 return this->onCreateFromStream(stream, ttcIndex);
97 }
98
99 SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) {
100 return this->onCreateFromFile(path, ttcIndex);
101 }
102
103 SkFontMgr* SkFontMgr::RefDefault() {
104 static SkFontMgr* gFM;
105 if (NULL == gFM) {
106 gFM = SkFontMgr::Factory();
107 }
108 return SkRef(gFM);
109 }
110
OLDNEW
« no previous file with comments | « include/ports/SkFontMgr.h ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698