| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkFontHost_DEFINED | 10 #ifndef SkFontHost_DEFINED |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 enum LCDOrder { | 83 enum LCDOrder { |
| 84 kRGB_LCDOrder = 0, //!< this is the default | 84 kRGB_LCDOrder = 0, //!< this is the default |
| 85 kBGR_LCDOrder = 1, | 85 kBGR_LCDOrder = 1, |
| 86 kNONE_LCDOrder = 2 | 86 kNONE_LCDOrder = 2 |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 /** @deprecated set on Device creation. */ | 89 /** @deprecated set on Device creation. */ |
| 90 static void SetSubpixelOrder(LCDOrder order); | 90 static void SetSubpixelOrder(LCDOrder order); |
| 91 /** @deprecated get from Device. */ | 91 /** @deprecated get from Device. */ |
| 92 static LCDOrder GetSubpixelOrder(); | 92 static LCDOrder GetSubpixelOrder(); |
| 93 | |
| 94 private: | |
| 95 /** Return a new, closest matching typeface given either an existing family | |
| 96 (specified by a typeface in that family) or by a familyName and a | |
| 97 requested style. | |
| 98 1) If familyFace is null, use familyName. | |
| 99 2) If familyName is null, use data (UTF-16 to cover). | |
| 100 3) If all are null, return the default font that best matches style | |
| 101 */ | |
| 102 static SkTypeface* CreateTypeface(const SkTypeface* familyFace, | |
| 103 const char familyName[], | |
| 104 SkTypeface::Style style); | |
| 105 | |
| 106 /** Return a new typeface given the data buffer. If the data does not | |
| 107 represent a valid font, returns null. | |
| 108 | |
| 109 If a typeface instance is returned, the caller is responsible for | |
| 110 calling unref() on the typeface when they are finished with it. | |
| 111 | |
| 112 The returned typeface may or may not have called ref() on the stream | |
| 113 parameter. If the typeface has not called ref(), then it may have made | |
| 114 a copy of the releveant data. In either case, the caller is still | |
| 115 responsible for its refcnt ownership of the stream. | |
| 116 */ | |
| 117 static SkTypeface* CreateTypefaceFromStream(SkStream*); | |
| 118 | |
| 119 /** Return a new typeface from the specified file path. If the file does not | |
| 120 represent a valid font, this returns null. If a typeface is returned, | |
| 121 the caller is responsible for calling unref() when it is no longer used. | |
| 122 */ | |
| 123 static SkTypeface* CreateTypefaceFromFile(const char path[]); | |
| 124 | |
| 125 /////////////////////////////////////////////////////////////////////////// | |
| 126 | |
| 127 friend class SkScalerContext; | |
| 128 friend class SkTypeface; | |
| 129 }; | 93 }; |
| 130 | 94 |
| 131 #endif | 95 #endif |
| OLD | NEW |