| Index: Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h
|
| diff --git a/Source/platform/fonts/FontPlatformData.h b/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h
|
| similarity index 64%
|
| copy from Source/platform/fonts/FontPlatformData.h
|
| copy to Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h
|
| index a60a1632d39c6127cdd767e7c5696a1b3f9ad3bc..4091bf7f680cd0491d9add001ad4687feb05e115 100644
|
| --- a/Source/platform/fonts/FontPlatformData.h
|
| +++ b/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h
|
| @@ -28,11 +28,10 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef FontPlatformData_h
|
| -#define FontPlatformData_h
|
| +#ifndef FontPlatformDataHarfBuzz_h
|
| +#define FontPlatformDataHarfBuzz_h
|
|
|
| #include "SkPaint.h"
|
| -#include "platform/PlatformExport.h"
|
| #include "platform/SharedBuffer.h"
|
| #include "platform/fonts/FontDescription.h"
|
| #include "platform/fonts/FontOrientation.h"
|
| @@ -44,19 +43,6 @@
|
| #include "wtf/text/CString.h"
|
| #include "wtf/text/StringImpl.h"
|
|
|
| -#if OS(MACOSX)
|
| -OBJC_CLASS NSFont;
|
| -
|
| -typedef struct CGFont* CGFontRef;
|
| -typedef const struct __CTFont* CTFontRef;
|
| -
|
| -#include "platform/fonts/mac/MemoryActivatedFont.h"
|
| -#include <CoreFoundation/CFBase.h>
|
| -#include <objc/objc-auto.h>
|
| -
|
| -inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
|
| -#endif // OS(MACOSX)
|
| -
|
| class SkTypeface;
|
| typedef uint32_t SkFontID;
|
|
|
| @@ -74,42 +60,17 @@ public:
|
| // set everything to 0.
|
| FontPlatformData(WTF::HashTableDeletedValueType);
|
| FontPlatformData();
|
| - FontPlatformData(const FontPlatformData&);
|
| -#if OS(MACOSX)
|
| - FontPlatformData(float size, bool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
|
| - FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticItalic = false,
|
| - FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
|
| - FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation, FontWidthVariant);
|
| -#else
|
| FontPlatformData(float textSize, bool syntheticBold, bool syntheticItalic);
|
| + FontPlatformData(const FontPlatformData&);
|
| FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, bool subpixelTextPosition = defaultUseSubpixelPositioning());
|
| FontPlatformData(const FontPlatformData& src, float textSize);
|
| -#endif
|
| ~FontPlatformData();
|
|
|
| -#if OS(MACOSX)
|
| - NSFont* font() const { return m_font; }
|
| - void setFont(NSFont*);
|
| -
|
| - CGFontRef cgFont() const { return m_cgFont.get(); }
|
| - CTFontRef ctFont() const;
|
| -
|
| - bool roundsGlyphAdvances() const;
|
| - bool allowsLigatures() const;
|
| -
|
| - bool isColorBitmapFont() const { return m_isColorBitmapFont; }
|
| - bool isCompositeFontReference() const { return m_isCompositeFontReference; }
|
| -
|
| - FontWidthVariant widthVariant() const { return m_widthVariant; }
|
| -#endif
|
| -
|
| String fontFamilyName() const;
|
| float size() const { return m_textSize; }
|
| bool isFixedPitch() const;
|
| - bool syntheticBold() const { return m_syntheticBold; }
|
| - bool syntheticItalic() const { return m_syntheticItalic; }
|
|
|
| - SkTypeface* typeface() const;
|
| + SkTypeface* typeface() const { return m_typeface.get(); }
|
| HarfBuzzFace* harfBuzzFace() const;
|
| SkFontID uniqueID() const;
|
| unsigned hash() const;
|
| @@ -119,11 +80,13 @@ public:
|
| void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold; }
|
| void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheticItalic; }
|
| bool operator==(const FontPlatformData&) const;
|
| - const FontPlatformData& operator=(const FontPlatformData&);
|
| + FontPlatformData& operator=(const FontPlatformData&);
|
| bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
|
| #if OS(WIN)
|
| void setMinSizeForAntiAlias(unsigned size) { m_minSizeForAntiAlias = size; }
|
| unsigned minSizeForAntiAlias() const { return m_minSizeForAntiAlias; }
|
| + void setMinSizeForSubpixel(float size) { m_minSizeForSubpixel = size; }
|
| + float minSizeForSubpixel() const { return m_minSizeForSubpixel; }
|
| void setHinting(SkPaint::Hinting style)
|
| {
|
| m_style.useAutoHint = 0;
|
| @@ -141,11 +104,9 @@ public:
|
| String description() const;
|
| #endif
|
|
|
| -#if !OS(MACOSX)
|
| // The returned styles are all actual styles without FontRenderStyle::NoPreference.
|
| const FontRenderStyle& fontRenderStyle() const { return m_style; }
|
| void setupPaint(SkPaint*, GraphicsContext* = 0) const;
|
| -#endif
|
|
|
| #if OS(WIN)
|
| int paintTextFlags() const { return m_paintTextFlags; }
|
| @@ -158,57 +119,28 @@ public:
|
| #endif
|
|
|
| private:
|
| -#if !OS(MACOSX)
|
| bool static defaultUseSubpixelPositioning();
|
| void querySystemForRenderStyle(bool useSkiaSubpixelPositioning);
|
| -#else
|
| - // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters:
|
| - // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same
|
| - // font as |nsFont|. This because the sandbox may block loading of the original font.
|
| - // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont.
|
| - // The caller is responsible for calling CFRelease() on this parameter when done with it.
|
| - // * cgFont - CGFontRef representing the input font at the specified point size.
|
| - void loadFont(NSFont*, float fontSize, NSFont*& outNSFont, CGFontRef&);
|
| -
|
| - bool platformIsEqual(const FontPlatformData&) const;
|
| - void platformDataInit(const FontPlatformData&);
|
| - const FontPlatformData& platformDataAssign(const FontPlatformData&);
|
| -#endif
|
|
|
| - mutable RefPtr<SkTypeface> m_typeface;
|
| + RefPtr<SkTypeface> m_typeface;
|
| #if !OS(WIN)
|
| CString m_family;
|
| #endif
|
| -
|
| -public:
|
| float m_textSize;
|
| bool m_syntheticBold;
|
| bool m_syntheticItalic;
|
| FontOrientation m_orientation;
|
| -#if OS(MACOSX)
|
| - bool m_isColorBitmapFont;
|
| - bool m_isCompositeFontReference;
|
| - FontWidthVariant m_widthVariant;
|
| -#endif
|
| -private:
|
| -#if OS(MACOSX)
|
| - NSFont* m_font;
|
| - RetainPtr<CGFontRef> m_cgFont;
|
| - mutable RetainPtr<CTFontRef> m_CTFont;
|
| - RefPtr<MemoryActivatedFont> m_inMemoryFont;
|
| -#else
|
| FontRenderStyle m_style;
|
| -#endif
|
| -
|
| mutable RefPtr<HarfBuzzFace> m_harfBuzzFace;
|
| bool m_isHashTableDeletedValue;
|
| #if OS(WIN)
|
| int m_paintTextFlags;
|
| bool m_useSubpixelPositioning;
|
| unsigned m_minSizeForAntiAlias;
|
| + float m_minSizeForSubpixel;
|
| #endif
|
| };
|
|
|
| } // namespace blink
|
|
|
| -#endif // ifdef FontPlatformData_h
|
| +#endif // ifdef FontPlatformDataHarfBuzz_h
|
|
|