| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebFontInfo_h | 31 #ifndef WebFontInfo_h |
| 32 #define WebFontInfo_h | 32 #define WebFontInfo_h |
| 33 | 33 |
| 34 #include "../WebCString.h" | 34 #include "../WebCString.h" |
| 35 #include "WebFallbackFont.h" |
| 35 #include "WebFontFamily.h" | 36 #include "WebFontFamily.h" |
| 36 #include "WebFontRenderStyle.h" | 37 #include "WebFontRenderStyle.h" |
| 37 | 38 |
| 38 #include <string.h> | 39 #include <string.h> |
| 39 #include <unistd.h> | 40 #include <unistd.h> |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class WebFontInfo { | 44 class WebFontInfo { |
| 44 public: | 45 public: |
| 45 // Set a global preference describing whether renderStyleForStrike() should | 46 // Set a global preference describing whether renderStyleForStrike() should |
| 46 // enable subpixel positioning or not. FontConfig doesn't currently provide | 47 // enable subpixel positioning or not. FontConfig doesn't currently provide |
| 47 // a parameter for controlling this. | 48 // a parameter for controlling this. |
| 48 BLINK_EXPORT static void setSubpixelPositioning(bool); | 49 BLINK_EXPORT static void setSubpixelPositioning(bool); |
| 49 | 50 |
| 50 // Return a font family which provides a glyph for the Unicode code point | 51 // Return a font family which provides a glyph for the Unicode code point |
| 51 // specified by character. | 52 // specified by character. |
| 52 // character: a UTF-32 code point | 53 // character: a UTF-32 code point |
| 53 // preferredLocale: preferred locale identifier for the |characters| | 54 // preferredLocale: preferred locale identifier for the |characters| |
| 54 // (e.g. "en", "ja", "zh-CN") | 55 // (e.g. "en", "ja", "zh-CN") |
| 55 // | 56 // |
| 56 // Returns: the font family or an empty string if the request could not be s
atisfied. | 57 // Returns: the font family or an empty string if the request could not be s
atisfied. |
| 57 // Returns: the font family instance. The instance has an empty font name if
the request could not be satisfied. | 58 // Returns: the font family instance. The instance has an empty font name if
the request could not be satisfied. |
| 59 BLINK_EXPORT static void fallbackFontForChar(const WebUChar32 character, con
st char* preferredLocale, WebFallbackFont*); |
| 60 |
| 61 // TODO(dro): Remove this legacy version, kept until renames on the Chromium
side are done. crbug.com/382411 |
| 58 BLINK_EXPORT static void familyForChar(const WebUChar32 character, const cha
r* preferredLocale, WebFontFamily*); | 62 BLINK_EXPORT static void familyForChar(const WebUChar32 character, const cha
r* preferredLocale, WebFontFamily*); |
| 59 | 63 |
| 60 // Fill out the given WebFontRenderStyle with the user's preferences for | 64 // Fill out the given WebFontRenderStyle with the user's preferences for |
| 61 // rendering the given font at the given size (in pixels). | 65 // rendering the given font at the given size (in pixels). |
| 62 // family: i.e. "Times New Roman" | 66 // family: i.e. "Times New Roman" |
| 63 // sizeAndStyle: | 67 // sizeAndStyle: |
| 64 // 3322222222221111111111 | 68 // 3322222222221111111111 |
| 65 // 10987654321098765432109876543210 | 69 // 10987654321098765432109876543210 |
| 66 // +--------------------------------+ | 70 // +--------------------------------+ |
| 67 // |..............Size............IB| | 71 // |..............Size............IB| |
| 68 // +--------------------------------+ | 72 // +--------------------------------+ |
| 69 // I: italic flag | 73 // I: italic flag |
| 70 // B: bold flag | 74 // B: bold flag |
| 71 BLINK_EXPORT static void renderStyleForStrike(const char* family, int sizeAn
dStyle, WebFontRenderStyle* result); | 75 BLINK_EXPORT static void renderStyleForStrike(const char* family, int sizeAn
dStyle, WebFontRenderStyle* result); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace blink | 78 } // namespace blink |
| 75 | 79 |
| 76 #endif | 80 #endif |
| OLD | NEW |