| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008 Holger Hans Peter Freyther | 6 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "FontDescription.h" | 28 #include "FontDescription.h" |
| 29 #include "FontFallbackList.h" | 29 #include "FontFallbackList.h" |
| 30 #include "SimpleFontData.h" | 30 #include "SimpleFontData.h" |
| 31 #include "TextDirection.h" | 31 #include "TextDirection.h" |
| 32 #include "TypesettingFeatures.h" | 32 #include "TypesettingFeatures.h" |
| 33 #include <wtf/HashMap.h> | 33 #include <wtf/HashMap.h> |
| 34 #include <wtf/HashSet.h> | 34 #include <wtf/HashSet.h> |
| 35 #include <wtf/MathExtras.h> | 35 #include <wtf/MathExtras.h> |
| 36 #include <wtf/unicode/CharacterNames.h> | 36 #include <wtf/unicode/CharacterNames.h> |
| 37 | 37 |
| 38 #if PLATFORM(QT) | |
| 39 #include <QRawFont> | |
| 40 QT_BEGIN_NAMESPACE | |
| 41 class QTextLayout; | |
| 42 QT_END_NAMESPACE | |
| 43 #endif | |
| 44 | |
| 45 // "X11/X.h" defines Complex to 0 and conflicts | 38 // "X11/X.h" defines Complex to 0 and conflicts |
| 46 // with Complex value in CodePath enum. | 39 // with Complex value in CodePath enum. |
| 47 #ifdef Complex | 40 #ifdef Complex |
| 48 #undef Complex | 41 #undef Complex |
| 49 #endif | 42 #endif |
| 50 | 43 |
| 51 namespace WebCore { | 44 namespace WebCore { |
| 52 | 45 |
| 53 class FloatPoint; | 46 class FloatPoint; |
| 54 class FloatRect; | 47 class FloatRect; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 #endif | 153 #endif |
| 161 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32, bool
mirror, FontDataVariant = AutoVariant) const; | 154 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32, bool
mirror, FontDataVariant = AutoVariant) const; |
| 162 bool primaryFontHasGlyphForCharacter(UChar32) const; | 155 bool primaryFontHasGlyphForCharacter(UChar32) const; |
| 163 | 156 |
| 164 static bool isCJKIdeograph(UChar32); | 157 static bool isCJKIdeograph(UChar32); |
| 165 static bool isCJKIdeographOrSymbol(UChar32); | 158 static bool isCJKIdeographOrSymbol(UChar32); |
| 166 | 159 |
| 167 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD
irection, bool& isAfterExpansion); | 160 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD
irection, bool& isAfterExpansion); |
| 168 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD
irection, bool& isAfterExpansion); | 161 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD
irection, bool& isAfterExpansion); |
| 169 | 162 |
| 170 #if PLATFORM(QT) | |
| 171 QRawFont rawFont() const; | |
| 172 QFont syntheticFont() const; | |
| 173 #endif | |
| 174 | |
| 175 static void setShouldUseSmoothing(bool); | 163 static void setShouldUseSmoothing(bool); |
| 176 static bool shouldUseSmoothing(); | 164 static bool shouldUseSmoothing(); |
| 177 | 165 |
| 178 enum CodePath { Auto, Simple, Complex, SimpleWithGlyphOverflow }; | 166 enum CodePath { Auto, Simple, Complex, SimpleWithGlyphOverflow }; |
| 179 CodePath codePath(const TextRun&) const; | 167 CodePath codePath(const TextRun&) const; |
| 180 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp
le; } | 168 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp
le; } |
| 181 static CodePath characterRangeCodePath(const UChar*, unsigned len); | 169 static CodePath characterRangeCodePath(const UChar*, unsigned len); |
| 182 | 170 |
| 183 private: | 171 private: |
| 184 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; | 172 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 case FontDescription::EnabledLigaturesState: | 277 case FontDescription::EnabledLigaturesState: |
| 290 features |= Ligatures; | 278 features |= Ligatures; |
| 291 break; | 279 break; |
| 292 case FontDescription::NormalLigaturesState: | 280 case FontDescription::NormalLigaturesState: |
| 293 break; | 281 break; |
| 294 } | 282 } |
| 295 | 283 |
| 296 return features; | 284 return features; |
| 297 } | 285 } |
| 298 | 286 |
| 299 #if PLATFORM(QT) | |
| 300 void initFormatForTextLayout(QTextLayout*, const TextRun&) const; | |
| 301 #endif | |
| 302 | |
| 303 static TypesettingFeatures s_defaultTypesettingFeatures; | 287 static TypesettingFeatures s_defaultTypesettingFeatures; |
| 304 | 288 |
| 305 FontDescription m_fontDescription; | 289 FontDescription m_fontDescription; |
| 306 mutable RefPtr<FontFallbackList> m_fontFallbackList; | 290 mutable RefPtr<FontFallbackList> m_fontFallbackList; |
| 307 short m_letterSpacing; | 291 short m_letterSpacing; |
| 308 short m_wordSpacing; | 292 short m_wordSpacing; |
| 309 bool m_isPlatformFont; | 293 bool m_isPlatformFont; |
| 310 bool m_needsTranscoding; | 294 bool m_needsTranscoding; |
| 311 mutable TypesettingFeatures m_typesettingFeatures; // Caches values computed
from m_fontDescription. | 295 mutable TypesettingFeatures m_typesettingFeatures; // Caches values computed
from m_fontDescription. |
| 312 }; | 296 }; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 332 |
| 349 } | 333 } |
| 350 | 334 |
| 351 namespace WTF { | 335 namespace WTF { |
| 352 | 336 |
| 353 template <> void deleteOwnedPtr<WebCore::TextLayout>(WebCore::TextLayout*); | 337 template <> void deleteOwnedPtr<WebCore::TextLayout>(WebCore::TextLayout*); |
| 354 | 338 |
| 355 } | 339 } |
| 356 | 340 |
| 357 #endif | 341 #endif |
| OLD | NEW |