OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Brent Fulgham | 2 * Copyright (C) 2011 Brent Fulgham |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 , m_useSubpixelPositioning(source.m_useSubpixelPositioning) | 146 , m_useSubpixelPositioning(source.m_useSubpixelPositioning) |
147 , m_minSizeForAntiAlias(source.m_minSizeForAntiAlias) | 147 , m_minSizeForAntiAlias(source.m_minSizeForAntiAlias) |
148 , m_minSizeForSubpixel(source.m_minSizeForSubpixel) | 148 , m_minSizeForSubpixel(source.m_minSizeForSubpixel) |
149 #endif | 149 #endif |
150 { | 150 { |
151 #if OS(MACOSX) | 151 #if OS(MACOSX) |
152 platformDataInit(source); | 152 platformDataInit(source); |
153 #endif | 153 #endif |
154 } | 154 } |
155 | 155 |
156 FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize) | |
157 : m_typeface(src.m_typeface) | |
158 #if !OS(WIN) | |
159 , m_family(src.m_family) | |
160 #endif | |
161 , m_textSize(textSize) | |
162 , m_syntheticBold(src.m_syntheticBold) | |
163 , m_syntheticItalic(src.m_syntheticItalic) | |
164 , m_orientation(src.m_orientation) | |
165 #if OS(MACOSX) | |
166 , m_isColorBitmapFont(src.m_isColorBitmapFont) | |
167 , m_isCompositeFontReference(src.m_isCompositeFontReference) | |
168 #endif | |
169 , m_widthVariant(RegularWidth) | |
170 #if !OS(MACOSX) | |
171 , m_style(src.m_style) | |
172 #endif | |
173 , m_harfBuzzFace(nullptr) | |
174 , m_isHashTableDeletedValue(false) | |
175 #if OS(WIN) | |
176 , m_paintTextFlags(src.m_paintTextFlags) | |
177 , m_useSubpixelPositioning(src.m_useSubpixelPositioning) | |
178 , m_minSizeForAntiAlias(src.m_minSizeForAntiAlias) | |
179 , m_minSizeForSubpixel(src.m_minSizeForSubpixel) | |
180 #endif | |
181 { | |
182 #if OS(MACOSX) | |
183 platformDataInit(src); | |
184 #else | |
185 querySystemForRenderStyle(FontDescription::subpixelPositioning()); | |
186 #endif | |
187 } | |
188 | 156 |
189 #if OS(MACOSX) | 157 #if OS(MACOSX) |
190 FontPlatformData::FontPlatformData(CGFontRef cgFont, float size, bool syntheticB
old, bool syntheticItalic, FontOrientation orientation, FontWidthVariant widthVa
riant) | 158 FontPlatformData::FontPlatformData(CGFontRef cgFont, float size, bool syntheticB
old, bool syntheticItalic, FontOrientation orientation, FontWidthVariant widthVa
riant) |
191 : m_typeface(nullptr) | 159 : m_typeface(nullptr) |
192 , m_family(CString()) | 160 , m_family(CString()) |
193 , m_textSize(size) | 161 , m_textSize(size) |
194 , m_syntheticBold(syntheticBold) | 162 , m_syntheticBold(syntheticBold) |
195 , m_syntheticItalic(syntheticItalic) | 163 , m_syntheticItalic(syntheticItalic) |
196 , m_orientation(orientation) | 164 , m_orientation(orientation) |
197 , m_isColorBitmapFont(false) | 165 , m_isColorBitmapFont(false) |
(...skipping 21 matching lines...) Expand all Loading... |
219 #if OS(WIN) | 187 #if OS(WIN) |
220 , m_paintTextFlags(0) | 188 , m_paintTextFlags(0) |
221 , m_useSubpixelPositioning(subpixelTextPosition) | 189 , m_useSubpixelPositioning(subpixelTextPosition) |
222 , m_minSizeForAntiAlias(0) | 190 , m_minSizeForAntiAlias(0) |
223 , m_minSizeForSubpixel(0) | 191 , m_minSizeForSubpixel(0) |
224 #endif | 192 #endif |
225 { | 193 { |
226 querySystemForRenderStyle(subpixelTextPosition); | 194 querySystemForRenderStyle(subpixelTextPosition); |
227 } | 195 } |
228 | 196 |
| 197 |
| 198 FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize) |
| 199 : m_typeface(src.m_typeface) |
| 200 #if !OS(WIN) |
| 201 , m_family(src.m_family) |
| 202 #endif |
| 203 , m_textSize(textSize) |
| 204 , m_syntheticBold(src.m_syntheticBold) |
| 205 , m_syntheticItalic(src.m_syntheticItalic) |
| 206 , m_orientation(src.m_orientation) |
| 207 , m_widthVariant(RegularWidth) |
| 208 , m_harfBuzzFace(nullptr) |
| 209 , m_isHashTableDeletedValue(false) |
| 210 #if OS(WIN) |
| 211 , m_paintTextFlags(src.m_paintTextFlags) |
| 212 , m_useSubpixelPositioning(src.m_useSubpixelPositioning) |
| 213 , m_minSizeForAntiAlias(src.m_minSizeForAntiAlias) |
| 214 , m_minSizeForSubpixel(src.m_minSizeForSubpixel) |
| 215 #endif |
| 216 { |
| 217 querySystemForRenderStyle(FontDescription::subpixelPositioning()); |
| 218 } |
229 #endif | 219 #endif |
230 | 220 |
231 FontPlatformData::~FontPlatformData() | 221 FontPlatformData::~FontPlatformData() |
232 { | 222 { |
233 #if OS(MACOSX) | 223 #if OS(MACOSX) |
234 if (m_font) | 224 if (m_font) |
235 CFRelease(m_font); | 225 CFRelease(m_font); |
236 #endif | 226 #endif |
237 } | 227 } |
238 | 228 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 { | 322 { |
333 #if OS(MACOSX) | 323 #if OS(MACOSX) |
334 if (!m_typeface) | 324 if (!m_typeface) |
335 m_typeface = adoptRef(SkCreateTypefaceFromCTFont(ctFont())); | 325 m_typeface = adoptRef(SkCreateTypefaceFromCTFont(ctFont())); |
336 #endif | 326 #endif |
337 return m_typeface.get(); | 327 return m_typeface.get(); |
338 } | 328 } |
339 | 329 |
340 HarfBuzzFace* FontPlatformData::harfBuzzFace() const | 330 HarfBuzzFace* FontPlatformData::harfBuzzFace() const |
341 { | 331 { |
| 332 #if OS(MACOSX) |
| 333 CTFontRef font = ctFont(); |
| 334 // Keeping the decision not to pass AAT font to HarfBuzz for now, |
| 335 // until we switch to HarfBuzz as a shaper for all cases. |
| 336 if (isAATFont(font)) |
| 337 return 0; |
| 338 #endif |
342 if (!m_harfBuzzFace) | 339 if (!m_harfBuzzFace) |
343 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this
), uniqueID()); | 340 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this
), uniqueID()); |
344 | 341 |
345 return m_harfBuzzFace.get(); | 342 return m_harfBuzzFace.get(); |
346 } | 343 } |
347 | 344 |
348 } // namespace blink | 345 } // namespace blink |
OLD | NEW |