Commit 04f132af authored by Joanmarie Diggs's avatar Joanmarie Diggs
Browse files

Merge branch 'sub-sup' into 'master'

Add ATK_TEXT_ATTR_TEXT_POSITION to the list of possible AtkText attributes

See merge request !33
parents 12697a18 26756a4f
......@@ -135,6 +135,14 @@ static const guint8 underline_offsets[] = {
0, 5, 12, 19, 23
};
static const char text_position[] =
"baseline\0"
"super\0"
"sub\0";
static const guint8 text_position_offsets[] = {
0, 9, 15,
};
static void atk_text_base_init (AtkTextIface *class);
static void atk_text_real_get_range_extents (AtkText *text,
......@@ -1335,6 +1343,9 @@ atk_text_attribute_get_value (AtkTextAttribute attr,
case ATK_TEXT_ATTR_STYLE:
g_assert (index >= 0 && index < G_N_ELEMENTS (style_offsets));
return style + style_offsets[index];
case ATK_TEXT_ATTR_TEXT_POSITION:
g_assert (index >= 0 && index < G_N_ELEMENTS (text_position_offsets));
return text_position + text_position_offsets[index];
default:
return NULL;
}
......
......@@ -43,7 +43,7 @@ G_BEGIN_DECLS
*@ATK_TEXT_ATTR_PIXELS_BELOW_LINES: Pixels of blank space to leave below each newline-terminated line.
*@ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP: Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).
*@ATK_TEXT_ATTR_BG_FULL_HEIGHT: "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.
*@ATK_TEXT_ATTR_RISE: Number of pixels that the characters are risen above the baseline
*@ATK_TEXT_ATTR_RISE: Number of pixels that the characters are risen above the baseline. See also ATK_TEXT_ATTR_TEXT_POSITION.
*@ATK_TEXT_ATTR_UNDERLINE: "none", "single", "double", "low", or "error"
*@ATK_TEXT_ATTR_STRIKETHROUGH: "true" or "false" whether the text is strikethrough
*@ATK_TEXT_ATTR_SIZE: The size of the characters in points. eg: 10
......@@ -61,6 +61,7 @@ G_BEGIN_DECLS
*@ATK_TEXT_ATTR_STRETCH: The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded"
*@ATK_TEXT_ATTR_VARIANT: The capitalization variant of the text, if set. Values are "normal" or "small_caps"
*@ATK_TEXT_ATTR_STYLE: The slant style of the text, if set. Values are "normal", "oblique" or "italic"
*@ATK_TEXT_ATTR_TEXT_POSITION: The vertical position with respect to the baseline. Values are "baseline", "super", or "sub". Note that a super or sub text attribute refers to position with respect to the baseline of the prior character.
*@ATK_TEXT_ATTR_LAST_DEFINED: not a valid text attribute, used for finding end of enumeration
*
* Describes the text attributes supported
......@@ -95,6 +96,7 @@ typedef enum
ATK_TEXT_ATTR_STRETCH,
ATK_TEXT_ATTR_VARIANT,
ATK_TEXT_ATTR_STYLE,
ATK_TEXT_ATTR_TEXT_POSITION,
ATK_TEXT_ATTR_LAST_DEFINED
} AtkTextAttribute;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment