OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 { | 94 { |
95 // FIXME: We really want to be using a newer version of Uniscribe that suppo
rts the new OpenType | 95 // FIXME: We really want to be using a newer version of Uniscribe that suppo
rts the new OpenType |
96 // functions. Those functions would allow us to turn off kerning and ligatu
res. Without being able | 96 // functions. Those functions would allow us to turn off kerning and ligatu
res. Without being able |
97 // to do that, we will have buggy line breaking and metrics when simple and
complex text are close | 97 // to do that, we will have buggy line breaking and metrics when simple and
complex text are close |
98 // together (the complex code path will narrow the text because of kerning a
nd ligatures and then | 98 // together (the complex code path will narrow the text because of kerning a
nd ligatures and then |
99 // when bidi processing splits into multiple runs, the simple portions will
get wider and cause us to | 99 // when bidi processing splits into multiple runs, the simple portions will
get wider and cause us to |
100 // spill off the edge of a line). | 100 // spill off the edge of a line). |
101 if (static_cast<int>(offset) > m_end) | 101 if (static_cast<int>(offset) > m_end) |
102 offset = m_end; | 102 offset = m_end; |
103 | 103 |
104 // Itemize the string. | |
105 const UChar* cp = m_run.data(m_currentCharacter); | |
106 int length = offset - m_currentCharacter; | 104 int length = offset - m_currentCharacter; |
107 if (length <= 0) | 105 if (length <= 0) |
108 return; | 106 return; |
109 | 107 |
| 108 // Itemize the string. |
| 109 const UChar* cp = m_run.data(m_currentCharacter); |
110 unsigned baseCharacter = m_currentCharacter; | 110 unsigned baseCharacter = m_currentCharacter; |
111 | 111 |
112 // We break up itemization of the string by fontData and (if needed) the use
of small caps. | 112 // We break up itemization of the string by fontData and (if needed) the use
of small caps. |
113 | 113 |
114 // FIXME: It's inconsistent that we use logical order when itemizing, since
this | 114 // FIXME: It's inconsistent that we use logical order when itemizing, since
this |
115 // does not match normal RTL. | 115 // does not match normal RTL. |
116 | 116 |
117 // FIXME: This function should decode surrogate pairs. Currently it makes li
ttle difference that | 117 // FIXME: This function should decode surrogate pairs. Currently it makes li
ttle difference that |
118 // it does not because the font cache on Windows does not support non-BMP ch
aracters. | 118 // it does not because the font cache on Windows does not support non-BMP ch
aracters. |
119 Vector<UChar, 256> smallCapsBuffer; | 119 Vector<UChar, 256> smallCapsBuffer; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 if (FAILED(shapeResult)) | 409 if (FAILED(shapeResult)) |
410 return false; | 410 return false; |
411 | 411 |
412 glyphs.shrink(glyphCount); | 412 glyphs.shrink(glyphCount); |
413 visualAttributes.shrink(glyphCount); | 413 visualAttributes.shrink(glyphCount); |
414 | 414 |
415 return true; | 415 return true; |
416 } | 416 } |
417 | 417 |
418 } | 418 } |
OLD | NEW |