| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 #include <unicode/uchar.h> | 40 #include <unicode/uchar.h> |
| 41 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
| 42 | 42 |
| 43 class UniscribeTest_TooBig_Test; // A gunit test for UniscribeHelper. | 43 class UniscribeTest_TooBig_Test; // A gunit test for UniscribeHelper. |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 class FloatRect; | 47 class FloatRect; |
| 48 class FontFeatureSettings; | 48 class FontFeatureSettings; |
| 49 class FontPlatformData; |
| 49 class GraphicsContext; | 50 class GraphicsContext; |
| 50 | 51 |
| 51 const unsigned cUniscribeHelperStackRuns = 8; | 52 const unsigned cUniscribeHelperStackRuns = 8; |
| 52 const unsigned cUniscribeHelperStackChars = 32; | 53 const unsigned cUniscribeHelperStackChars = 32; |
| 53 const unsigned cUniscribeHelperFeatures = 4; | 54 const unsigned cUniscribeHelperFeatures = 4; |
| 54 | 55 |
| 55 // This object should be safe to create & destroy frequently, as long as the | 56 // This object should be safe to create & destroy frequently, as long as the |
| 56 // caller preserves the script_cache when possible (this data may be slow to | 57 // caller preserves the script_cache when possible (this data may be slow to |
| 57 // compute). | 58 // compute). |
| 58 // | 59 // |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // Converts the given pixel X position into a logical character offset into | 191 // Converts the given pixel X position into a logical character offset into |
| 191 // the run. For positions appearing before the first character, this will | 192 // the run. For positions appearing before the first character, this will |
| 192 // return -1. | 193 // return -1. |
| 193 int xToCharacter(int x) const; | 194 int xToCharacter(int x) const; |
| 194 | 195 |
| 195 // Draws the given characters to (x, y) in the given DC. The font will be | 196 // Draws the given characters to (x, y) in the given DC. The font will be |
| 196 // handled by this function, but the font color and other attributes should | 197 // handled by this function, but the font color and other attributes should |
| 197 // be pre-set. | 198 // be pre-set. |
| 198 // | 199 // |
| 199 // The y position is the upper left corner, NOT the baseline. | 200 // The y position is the upper left corner, NOT the baseline. |
| 200 void draw(GraphicsContext* graphicsContext, HDC dc, | 201 void draw(GraphicsContext*, const FontPlatformData&, HDC, |
| 201 int x, int y, | 202 int x, int y, const FloatRect& textRect, |
| 202 const FloatRect& textRect, | 203 int from, int to); |
| 203 int from, int to); | |
| 204 | 204 |
| 205 // Returns the first glyph assigned to the character at the given offset. | 205 // Returns the first glyph assigned to the character at the given offset. |
| 206 // This function is used to retrieve glyph information when Uniscribe is | 206 // This function is used to retrieve glyph information when Uniscribe is |
| 207 // being used to generate glyphs for non-complex, non-BMP (above U+FFFF) | 207 // being used to generate glyphs for non-complex, non-BMP (above U+FFFF) |
| 208 // characters. These characters are not otherwise special and have no | 208 // characters. These characters are not otherwise special and have no |
| 209 // complex shaping rules, so we don't otherwise need Uniscribe, except | 209 // complex shaping rules, so we don't otherwise need Uniscribe, except |
| 210 // Uniscribe is the only way to get glyphs for non-BMP characters. | 210 // Uniscribe is the only way to get glyphs for non-BMP characters. |
| 211 // | 211 // |
| 212 // Returns 0 if there is no glyph for the given character. | 212 // Returns 0 if there is no glyph for the given character. |
| 213 WORD firstGlyphForCharacter(int charOffset) const; | 213 WORD firstGlyphForCharacter(int charOffset) const; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 440 |
| 441 // This contains Uniscribe's OpenType feature settings. This structure | 441 // This contains Uniscribe's OpenType feature settings. This structure |
| 442 // is filled by using WebKit's |FontFeatureSettings|. | 442 // is filled by using WebKit's |FontFeatureSettings|. |
| 443 TEXTRANGE_PROPERTIES m_rangeProperties; | 443 TEXTRANGE_PROPERTIES m_rangeProperties; |
| 444 Vector<OPENTYPE_FEATURE_RECORD, cUniscribeHelperFeatures> m_featureRecords; | 444 Vector<OPENTYPE_FEATURE_RECORD, cUniscribeHelperFeatures> m_featureRecords; |
| 445 }; | 445 }; |
| 446 | 446 |
| 447 } // namespace WebCore | 447 } // namespace WebCore |
| 448 | 448 |
| 449 #endif // UniscribeHelper_h | 449 #endif // UniscribeHelper_h |
| OLD | NEW |