]>
git.saurik.com Git - iphone-api.git/blob - WebCore/FontFallbackList.h
2 * This file is part of the internal font implementation. It should not be included by anyone other than
3 * FontMac.cpp, FontWin.cpp and Font.cpp.
5 * Copyright (C) 2006 Apple Computer, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 // This file has no guards on purpose in order to detect redundant includes. This is a private header
25 // and so this may catch someone trying to include this file in public cpp files.
27 #include "FontSelector.h"
28 #include "SimpleFontData.h"
29 #include <wtf/Forward.h>
34 class GraphicsContext
;
36 class FontDescription
;
37 class FontPlatformData
;
40 const int cAllFamiliesScanned
= -1;
42 class FontFallbackList
: public RefCounted
<FontFallbackList
> {
44 static PassRefPtr
<FontFallbackList
> create() { return adoptRef(new FontFallbackList()); }
46 ~FontFallbackList() { releaseFontData(); }
47 void invalidate(PassRefPtr
<FontSelector
>);
49 bool isFixedPitch(const Font
* f
) const { if (m_pitch
== UnknownPitch
) determinePitch(f
); return m_pitch
== FixedPitch
; };
50 void determinePitch(const Font
*) const;
52 bool loadingCustomFonts() const { return m_loadingCustomFonts
; }
54 FontSelector
* fontSelector() const { return m_fontSelector
.get(); }
55 unsigned generation() const { return m_generation
; }
60 const FontData
* primaryFont(const Font
* f
) const { return fontDataAt(f
, 0); }
61 const FontData
* fontDataAt(const Font
*, unsigned index
) const;
62 const FontData
* fontDataForCharacters(const Font
*, const UChar
*, int length
) const;
64 void setPlatformFont(const FontPlatformData
&);
66 void releaseFontData();
68 mutable Vector
<pair
<const FontData
*, bool>, 1> m_fontList
;
69 mutable int m_familyIndex
;
70 mutable Pitch m_pitch
;
71 mutable bool m_loadingCustomFonts
;
72 RefPtr
<FontSelector
> m_fontSelector
;
73 unsigned m_generation
;