| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifndef FontPlatformData_h | 31 #ifndef FontPlatformData_h |
| 32 #define FontPlatformData_h | 32 #define FontPlatformData_h |
| 33 | 33 |
| 34 #include "SkPaint.h" | 34 #include "SkPaint.h" |
| 35 #include "SkTypeface.h" | 35 #include "SkTypeface.h" |
| 36 #include "platform/PlatformExport.h" | 36 #include "platform/PlatformExport.h" |
| 37 #include "platform/SharedBuffer.h" | 37 #include "platform/SharedBuffer.h" |
| 38 #include "platform/fonts/FontDescription.h" | 38 #include "platform/fonts/FontDescription.h" |
| 39 #include "platform/fonts/FontOrientation.h" | 39 #include "platform/fonts/FontOrientation.h" |
| 40 #include "platform/fonts/FontRenderStyle.h" | |
| 41 #include "platform/fonts/SmallCapsIterator.h" | 40 #include "platform/fonts/SmallCapsIterator.h" |
| 42 #include "platform/fonts/opentype/OpenTypeVerticalData.h" | 41 #include "platform/fonts/opentype/OpenTypeVerticalData.h" |
| 43 #include "wtf/Allocator.h" | 42 #include "wtf/Allocator.h" |
| 44 #include "wtf/Forward.h" | 43 #include "wtf/Forward.h" |
| 45 #include "wtf/HashTableDeletedValueType.h" | 44 #include "wtf/HashTableDeletedValueType.h" |
| 46 #include "wtf/RefPtr.h" | 45 #include "wtf/RefPtr.h" |
| 47 #include "wtf/text/CString.h" | 46 #include "wtf/text/CString.h" |
| 48 #include "wtf/text/StringImpl.h" | 47 #include "wtf/text/StringImpl.h" |
| 49 | 48 |
| 49 #if OS(LINUX) || OS(ANDROID) |
| 50 #include "platform/fonts/linux/FontRenderStyle.h" |
| 51 #endif // OS(LINUX) || OS(ANDROID) |
| 52 |
| 50 #if OS(MACOSX) | 53 #if OS(MACOSX) |
| 51 OBJC_CLASS NSFont; | 54 OBJC_CLASS NSFont; |
| 52 | 55 |
| 53 typedef struct CGFont* CGFontRef; | 56 typedef struct CGFont* CGFontRef; |
| 54 typedef const struct __CTFont* CTFontRef; | 57 typedef const struct __CTFont* CTFontRef; |
| 55 | 58 |
| 56 #include <objc/objc-auto.h> | 59 #include <objc/objc-auto.h> |
| 57 | 60 |
| 58 inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef
>(nsFont); } | 61 inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef
>(nsFont); } |
| 59 inline NSFont* toNSFont(CTFontRef ctFontRef) { return const_cast<NSFont*>(reinte
rpret_cast<const NSFont*>(ctFontRef)); } | 62 inline NSFont* toNSFont(CTFontRef ctFontRef) { return const_cast<NSFont*>(reinte
rpret_cast<const NSFont*>(ctFontRef)); } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheti
cItalic; } | 113 void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheti
cItalic; } |
| 111 bool operator==(const FontPlatformData&) const; | 114 bool operator==(const FontPlatformData&) const; |
| 112 const FontPlatformData& operator=(const FontPlatformData&); | 115 const FontPlatformData& operator=(const FontPlatformData&); |
| 113 | 116 |
| 114 bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } | 117 bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } |
| 115 #if OS(WIN) | 118 #if OS(WIN) |
| 116 void setMinSizeForAntiAlias(unsigned size) { m_minSizeForAntiAlias = size; } | 119 void setMinSizeForAntiAlias(unsigned size) { m_minSizeForAntiAlias = size; } |
| 117 unsigned minSizeForAntiAlias() const { return m_minSizeForAntiAlias; } | 120 unsigned minSizeForAntiAlias() const { return m_minSizeForAntiAlias; } |
| 118 void setMinSizeForSubpixel(float size) { m_minSizeForSubpixel = size; } | 121 void setMinSizeForSubpixel(float size) { m_minSizeForSubpixel = size; } |
| 119 float minSizeForSubpixel() const { return m_minSizeForSubpixel; } | 122 float minSizeForSubpixel() const { return m_minSizeForSubpixel; } |
| 120 void setHinting(SkPaint::Hinting style) | |
| 121 { | |
| 122 m_style.useAutoHint = 0; | |
| 123 m_style.hintStyle = style; | |
| 124 } | |
| 125 #endif | 123 #endif |
| 126 bool fontContainsCharacter(UChar32 character); | 124 bool fontContainsCharacter(UChar32 character); |
| 127 | 125 |
| 128 PassRefPtr<OpenTypeVerticalData> verticalData() const; | 126 PassRefPtr<OpenTypeVerticalData> verticalData() const; |
| 129 PassRefPtr<SharedBuffer> openTypeTable(SkFontTableTag) const; | 127 PassRefPtr<SharedBuffer> openTypeTable(SkFontTableTag) const; |
| 130 | 128 |
| 131 #if !OS(MACOSX) | 129 #if OS(LINUX) || OS(ANDROID) |
| 132 // The returned styles are all actual styles without FontRenderStyle::NoPref
erence. | 130 // The returned styles are all actual styles without FontRenderStyle::NoPref
erence. |
| 133 const FontRenderStyle& getFontRenderStyle() const { return m_style; } | 131 const FontRenderStyle& getFontRenderStyle() const { return m_style; } |
| 134 #endif | 132 #endif |
| 135 void setupPaint(SkPaint*, float deviceScaleFactor = 1, const Font* = 0) cons
t; | 133 void setupPaint(SkPaint*, float deviceScaleFactor = 1, const Font* = 0) cons
t; |
| 136 | 134 |
| 137 #if OS(WIN) | 135 #if OS(WIN) |
| 138 int paintTextFlags() const { return m_paintTextFlags; } | 136 int paintTextFlags() const { return m_paintTextFlags; } |
| 139 #else | 137 #else |
| 140 static void setHinting(SkPaint::Hinting); | 138 static void setHinting(SkPaint::Hinting); |
| 141 static void setAutoHint(bool); | 139 static void setAutoHint(bool); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 153 #if !OS(WIN) | 151 #if !OS(WIN) |
| 154 CString m_family; | 152 CString m_family; |
| 155 #endif | 153 #endif |
| 156 | 154 |
| 157 public: | 155 public: |
| 158 float m_textSize; | 156 float m_textSize; |
| 159 bool m_syntheticBold; | 157 bool m_syntheticBold; |
| 160 bool m_syntheticItalic; | 158 bool m_syntheticItalic; |
| 161 FontOrientation m_orientation; | 159 FontOrientation m_orientation; |
| 162 private: | 160 private: |
| 163 #if !OS(MACOSX) | 161 #if OS(LINUX) || OS(ANDROID) |
| 164 FontRenderStyle m_style; | 162 FontRenderStyle m_style; |
| 165 #endif | 163 #endif |
| 166 | 164 |
| 167 mutable RefPtr<HarfBuzzFace> m_harfBuzzFace; | 165 mutable RefPtr<HarfBuzzFace> m_harfBuzzFace; |
| 168 bool m_isHashTableDeletedValue; | 166 bool m_isHashTableDeletedValue; |
| 169 #if OS(WIN) | 167 #if OS(WIN) |
| 170 int m_paintTextFlags; | 168 int m_paintTextFlags; |
| 171 unsigned m_minSizeForAntiAlias; | 169 unsigned m_minSizeForAntiAlias; |
| 172 float m_minSizeForSubpixel; | 170 float m_minSizeForSubpixel; |
| 173 #endif | 171 #endif |
| 174 }; | 172 }; |
| 175 | 173 |
| 176 } // namespace blink | 174 } // namespace blink |
| 177 | 175 |
| 178 #endif // ifdef FontPlatformData_h | 176 #endif // ifdef FontPlatformData_h |
| OLD | NEW |