OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /** | 6 /** |
7 * This file defines the <code>PPB_BrowserFont_Trusted</code> interface. | 7 * This file defines the <code>PPB_BrowserFont_Trusted</code> interface. |
8 */ | 8 */ |
9 label Chrome { | 9 label Chrome { |
10 M19 = 1.0 | 10 M19 = 1.0 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 */ | 230 */ |
231 int32_t MeasureText( | 231 int32_t MeasureText( |
232 [in] PP_Resource font, | 232 [in] PP_Resource font, |
233 [in] PP_BrowserFont_Trusted_TextRun text); | 233 [in] PP_BrowserFont_Trusted_TextRun text); |
234 | 234 |
235 /** | 235 /** |
236 * Returns the character at the given pixel X position from the beginning of | 236 * Returns the character at the given pixel X position from the beginning of |
237 * the string. This handles complex scripts such as Arabic, where characters | 237 * the string. This handles complex scripts such as Arabic, where characters |
238 * may be combined or replaced depending on the context. Returns (uint32)-1 | 238 * may be combined or replaced depending on the context. Returns (uint32)-1 |
239 * on failure. | 239 * on failure. |
| 240 * |
| 241 * TODO(brettw) this function may be broken. See the CharPosRTL test. It |
| 242 * seems to tell you "insertion point" rather than painting position. This |
| 243 * is useful but maybe not what we intended here. |
240 */ | 244 */ |
241 uint32_t CharacterOffsetForPixel( | 245 uint32_t CharacterOffsetForPixel( |
242 [in] PP_Resource font, | 246 [in] PP_Resource font, |
243 [in] PP_BrowserFont_Trusted_TextRun text, | 247 [in] PP_BrowserFont_Trusted_TextRun text, |
244 [in] int32_t pixel_position); | 248 [in] int32_t pixel_position); |
245 | 249 |
246 /** | 250 /** |
247 * Returns the horizontal advance to the given character if the string was | 251 * Returns the horizontal advance to the given character if the string was |
248 * placed at the given position. This handles complex scripts such as Arabic, | 252 * placed at the given position. This handles complex scripts such as Arabic, |
249 * where characters may be combined or replaced depending on context. Returns | 253 * where characters may be combined or replaced depending on context. Returns |
250 * -1 on error. | 254 * -1 on error. |
251 */ | 255 */ |
252 int32_t PixelOffsetForCharacter( | 256 int32_t PixelOffsetForCharacter( |
253 [in] PP_Resource font, | 257 [in] PP_Resource font, |
254 [in] PP_BrowserFont_Trusted_TextRun text, | 258 [in] PP_BrowserFont_Trusted_TextRun text, |
255 [in] uint32_t char_offset); | 259 [in] uint32_t char_offset); |
256 }; | 260 }; |
257 | 261 |
OLD | NEW |