| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 UChar32 m_from; | 79 UChar32 m_from; |
| 80 UChar32 m_to; | 80 UChar32 m_to; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 class UnicodeRangeSet { | 83 class UnicodeRangeSet { |
| 84 public: | 84 public: |
| 85 void add(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from,
to)); } | 85 void add(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from,
to)); } |
| 86 bool intersectsWith(const String&) const; | 86 bool intersectsWith(const String&) const; |
| 87 bool isEntireRange() const { return m_ranges.isEmpty(); } |
| 87 size_t size() const { return m_ranges.size(); } | 88 size_t size() const { return m_ranges.size(); } |
| 88 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } | 89 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } |
| 89 private: | 90 private: |
| 90 Vector<UnicodeRange> m_ranges; | 91 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp
ace. |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 FontFace::LoadStatus loadStatus() const { return m_fontFace ? m_fontFace->lo
adStatus() : FontFace::Loaded; } | 94 FontFace::LoadStatus loadStatus() const { return m_fontFace ? m_fontFace->lo
adStatus() : FontFace::Loaded; } |
| 94 void willUseFontData(const FontDescription&); | 95 void willUseFontData(const FontDescription&); |
| 95 | 96 |
| 96 private: | 97 private: |
| 97 CSSFontFace(PassRefPtr<FontFace> fontFace) | 98 CSSFontFace(PassRefPtr<FontFace> fontFace) |
| 98 : m_segmentedFontFace(0) | 99 : m_segmentedFontFace(0) |
| 99 , m_activeSource(0) | 100 , m_activeSource(0) |
| 100 , m_fontFace(fontFace) | 101 , m_fontFace(fontFace) |
| 101 { | 102 { |
| 102 } | 103 } |
| 103 void setLoadStatus(FontFace::LoadStatus); | 104 void setLoadStatus(FontFace::LoadStatus); |
| 104 | 105 |
| 105 UnicodeRangeSet m_ranges; | 106 UnicodeRangeSet m_ranges; |
| 106 CSSSegmentedFontFace* m_segmentedFontFace; | 107 CSSSegmentedFontFace* m_segmentedFontFace; |
| 107 Vector<OwnPtr<CSSFontFaceSource> > m_sources; | 108 Vector<OwnPtr<CSSFontFaceSource> > m_sources; |
| 108 CSSFontFaceSource* m_activeSource; | 109 CSSFontFaceSource* m_activeSource; |
| 109 RefPtr<FontFace> m_fontFace; | 110 RefPtr<FontFace> m_fontFace; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } | 113 } |
| 113 | 114 |
| 114 #endif | 115 #endif |
| OLD | NEW |