| Index: ppapi/api/dev/ppb_font_dev.idl
|
| diff --git a/ppapi/api/trusted/ppb_browser_font_trusted.idl b/ppapi/api/dev/ppb_font_dev.idl
|
| similarity index 74%
|
| copy from ppapi/api/trusted/ppb_browser_font_trusted.idl
|
| copy to ppapi/api/dev/ppb_font_dev.idl
|
| index 7a79417efce00b6bb16c993817c9e56ea428e525..d2051a0be45c5d0330718496fb5f60d20243a87f 100644
|
| --- a/ppapi/api/trusted/ppb_browser_font_trusted.idl
|
| +++ b/ppapi/api/dev/ppb_font_dev.idl
|
| @@ -4,51 +4,49 @@
|
| */
|
|
|
| /**
|
| - * This file defines the <code>PPB_BrowserFont_Trusted</code> interface.
|
| + * This file defines the <code>PPB_Font_Dev</code> interface.
|
| */
|
| label Chrome {
|
| - M19 = 1.0
|
| + M14 = 0.6
|
| };
|
|
|
| [assert_size(4)]
|
| -enum PP_BrowserFont_Trusted_Family {
|
| +enum PP_FontFamily_Dev {
|
| /**
|
| * Uses the user's default web page font (normally either the default serif
|
| * or sans serif font).
|
| */
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT = 0,
|
| + PP_FONTFAMILY_DEFAULT = 0,
|
|
|
| /**
|
| * These families will use the default web page font corresponding to the
|
| * given family.
|
| */
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_SERIF = 1,
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_SANSSERIF = 2,
|
| - PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE = 3
|
| + PP_FONTFAMILY_SERIF = 1,
|
| + PP_FONTFAMILY_SANSSERIF = 2,
|
| + PP_FONTFAMILY_MONOSPACE = 3
|
| };
|
|
|
| /**
|
| * Specifies the font weight. Normally users will only use NORMAL or BOLD.
|
| */
|
| [assert_size(4)]
|
| -enum PP_BrowserFont_Trusted_Weight {
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_100 = 0,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_200 = 1,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_300 = 2,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_400 = 3,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_500 = 4,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_600 = 5,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_700 = 6,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_800 = 7,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_900 = 8,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_NORMAL =
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_400,
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD =
|
| - PP_BROWSERFONT_TRUSTED_WEIGHT_700
|
| +enum PP_FontWeight_Dev {
|
| + PP_FONTWEIGHT_100 = 0,
|
| + PP_FONTWEIGHT_200 = 1,
|
| + PP_FONTWEIGHT_300 = 2,
|
| + PP_FONTWEIGHT_400 = 3,
|
| + PP_FONTWEIGHT_500 = 4,
|
| + PP_FONTWEIGHT_600 = 5,
|
| + PP_FONTWEIGHT_700 = 6,
|
| + PP_FONTWEIGHT_800 = 7,
|
| + PP_FONTWEIGHT_900 = 8,
|
| + PP_FONTWEIGHT_NORMAL = PP_FONTWEIGHT_400,
|
| + PP_FONTWEIGHT_BOLD = PP_FONTWEIGHT_700
|
| };
|
|
|
| [assert_size(48)]
|
| -struct PP_BrowserFont_Trusted_Description {
|
| +struct PP_FontDescription_Dev {
|
| /**
|
| * Font face name as a string. This can also be an undefined var, in which
|
| * case the generic family will be obeyed. If the face is not available on
|
| @@ -67,7 +65,7 @@ struct PP_BrowserFont_Trusted_Description {
|
| * family will not be updated to reflect whether the font name you requested
|
| * is serif or sans serif.
|
| */
|
| - PP_BrowserFont_Trusted_Family family;
|
| + PP_FontFamily_Dev family;
|
|
|
| /**
|
| * Size in pixels.
|
| @@ -80,9 +78,9 @@ struct PP_BrowserFont_Trusted_Description {
|
| uint32_t size;
|
|
|
| /**
|
| - * Normally you will use either normal or bold.
|
| + * Normally you will use either PP_FONTWEIGHT_NORMAL or PP_FONTWEIGHT_BOLD.
|
| */
|
| - PP_BrowserFont_Trusted_Weight weight;
|
| + PP_FontWeight_Dev weight;
|
|
|
| PP_Bool italic;
|
| PP_Bool small_caps;
|
| @@ -106,7 +104,7 @@ struct PP_BrowserFont_Trusted_Description {
|
| };
|
|
|
| [assert_size(20)]
|
| -struct PP_BrowserFont_Trusted_Metrics {
|
| +struct PP_FontMetrics_Dev {
|
| int32_t height;
|
| int32_t ascent;
|
| int32_t descent;
|
| @@ -115,7 +113,7 @@ struct PP_BrowserFont_Trusted_Metrics {
|
| };
|
|
|
| [assert_size(24)]
|
| -struct PP_BrowserFont_Trusted_TextRun {
|
| +struct PP_TextRun_Dev {
|
| /**
|
| * This var must either be a string or a null/undefined var (which will be
|
| * treated as a 0-length string).
|
| @@ -124,27 +122,33 @@ struct PP_BrowserFont_Trusted_TextRun {
|
|
|
| /**
|
| * Set to PP_TRUE if the text is right-to-left.
|
| + *
|
| + * When <code>override_direction</code> is false, the browser will perform
|
| + * the Unicode Bidirectional Algorithm (http://unicode.org/reports/tr9/) on
|
| + * the text. The value of the <code>rtl</code> flag specifies the
|
| + * directionality of the surrounding environment. This means that Hebrew
|
| + * word will always display right to left, even if <code>rtl</code> is false.
|
| + *
|
| + * When <code>override_direction</code> is true, no autodetection will be done
|
| + * and <code>rtl</code> specifies the direction of the text.
|
| + *
|
| + * TODO(brettw) note that autodetection with rtl = true is currently
|
| + * unimplemented.
|
| */
|
| PP_Bool rtl;
|
|
|
| /**
|
| * Set to PP_TRUE to force the directionality of the text regardless of
|
| - * content
|
| + * content.
|
| + *
|
| + * If this flag is set, the browser will skip autodetection of the content
|
| + * and will display all text in the direction specified by the
|
| + * <code>rtl</code> flag.
|
| */
|
| PP_Bool override_direction;
|
| };
|
|
|
| -/**
|
| - * Provides an interface for native browser text rendering.
|
| - *
|
| - * This API is "trusted" not for security reasons, but because it can not be
|
| - * implemented efficiently when running out-of-process in Browser Client. In
|
| - * this case, WebKit is in another process and every text call would require a
|
| - * synchronous IPC to the renderer. It is, however, available to native
|
| - * (non-NaCl) out-of-process PPAPI plugins since WebKit is available in the
|
| - * plugin process.
|
| - */
|
| -interface PPB_BrowserFont_Trusted {
|
| +interface PPB_Font_Dev {
|
| /**
|
| * Returns a list of all available font families on the system. You can use
|
| * this list to decide whether to Create() a font.
|
| @@ -164,7 +168,7 @@ interface PPB_BrowserFont_Trusted {
|
| */
|
| PP_Resource Create(
|
| [in] PP_Instance instance,
|
| - [in] PP_BrowserFont_Trusted_Description description);
|
| + [in] PP_FontDescription_Dev description);
|
|
|
| /**
|
| * Returns PP_TRUE if the given resource is a Font. Returns PP_FALSE if the
|
| @@ -188,8 +192,8 @@ interface PPB_BrowserFont_Trusted {
|
| */
|
| PP_Bool Describe(
|
| [in] PP_Resource font,
|
| - [out] PP_BrowserFont_Trusted_Description description,
|
| - [out] PP_BrowserFont_Trusted_Metrics metrics);
|
| + [out] PP_FontDescription_Dev description,
|
| + [out] PP_FontMetrics_Dev metrics);
|
|
|
| /**
|
| * Draws the text to the image buffer.
|
| @@ -212,7 +216,7 @@ interface PPB_BrowserFont_Trusted {
|
| PP_Bool DrawTextAt(
|
| [in] PP_Resource font,
|
| [in] PP_Resource image_data,
|
| - [in] PP_BrowserFont_Trusted_TextRun text,
|
| + [in] PP_TextRun_Dev text,
|
| [in] PP_Point position,
|
| [in] uint32_t color,
|
| [in] PP_Rect clip,
|
| @@ -230,21 +234,17 @@ interface PPB_BrowserFont_Trusted {
|
| */
|
| int32_t MeasureText(
|
| [in] PP_Resource font,
|
| - [in] PP_BrowserFont_Trusted_TextRun text);
|
| + [in] PP_TextRun_Dev text);
|
|
|
| /**
|
| * Returns the character at the given pixel X position from the beginning of
|
| * the string. This handles complex scripts such as Arabic, where characters
|
| * may be combined or replaced depending on the context. Returns (uint32)-1
|
| * on failure.
|
| - *
|
| - * TODO(brettw) this function may be broken. See the CharPosRTL test. It
|
| - * seems to tell you "insertion point" rather than painting position. This
|
| - * is useful but maybe not what we intended here.
|
| */
|
| uint32_t CharacterOffsetForPixel(
|
| [in] PP_Resource font,
|
| - [in] PP_BrowserFont_Trusted_TextRun text,
|
| + [in] PP_TextRun_Dev text,
|
| [in] int32_t pixel_position);
|
|
|
| /**
|
| @@ -255,7 +255,7 @@ interface PPB_BrowserFont_Trusted {
|
| */
|
| int32_t PixelOffsetForCharacter(
|
| [in] PP_Resource font,
|
| - [in] PP_BrowserFont_Trusted_TextRun text,
|
| + [in] PP_TextRun_Dev text,
|
| [in] uint32_t char_offset);
|
| };
|
|
|
|
|