pangomm
2.42.0
|
The Pango::Attribute structure represents the common portions of all attributes. More...
#include <pangomm/attributes.h>
Public Member Functions | |
Attribute () | |
Constructs an invalid attribute. More... | |
Attribute (const Attribute& src) | |
Attribute (PangoAttribute* castitem, bool take_copy=true) | |
~Attribute () | |
Attribute& | operator= (const Attribute& src) |
AttrType | get_type () const |
Gets the type ID for this attribute. More... | |
unsigned int | get_start_index () const |
Gets the start index of the range. More... | |
unsigned int | get_end_index () const |
Gets the end index of the range. More... | |
void | set_start_index (const unsigned int& value) |
Sets the start index of the range. More... | |
void | set_end_index (const unsigned int& value) |
Sets the end index of the range. More... | |
bool | equal (const Attribute& attr2) const |
Compare two attributes for equality. More... | |
PangoAttribute* | gobj () |
Provides access to the underlying C GObject. More... | |
const PangoAttribute* | gobj () const |
Provides access to the underlying C GObject. More... | |
Static Public Member Functions | |
static AttrType | register_type (const Glib::ustring& name) |
Allocate a new attribute type ID. More... | |
static AttrString | create_attr_family (const Glib::ustring& family) |
Create a new font family attribute. More... | |
static AttrLanguage | create_attr_language (const Language& language) |
Create a new language tag attribute. More... | |
static AttrColor | create_attr_foreground (guint16 red, guint16 green, guint16 blue) |
Create a new foreground color attribute. More... | |
static AttrColor | create_attr_background (guint16 red, guint16 green, guint16 blue) |
Create a new background color attribute. More... | |
static AttrInt | create_attr_foreground_alpha (guint16 alpha) |
Create a new foreground alpha attribute. More... | |
static AttrInt | create_attr_background_alpha (guint16 alpha) |
Create a new background alpha attribute. More... | |
static AttrInt | create_attr_size (int size) |
Create a new font-size attribute. More... | |
static AttrInt | create_attr_size_absolute (int size) |
Create a new font-size attribute. More... | |
static AttrInt | create_attr_style (Style style) |
Create a new font slant style attribute. More... | |
static AttrInt | create_attr_weight (Weight weight) |
Create a new font weight attribute. More... | |
static AttrInt | create_attr_variant (Variant variant) |
Create a new font variant attribute (normal or small caps). More... | |
static AttrInt | create_attr_stretch (Stretch stretch) |
Create a new font stretch attribute. More... | |
static AttrFontDesc | create_attr_font_desc (const FontDescription& desc) |
Create a new font description attribute. More... | |
static AttrInt | create_attr_underline (Underline underline) |
Create a new underline-style object. More... | |
static AttrColor | create_attr_underline_color (guint16 red, guint16 green, guint16 blue) |
Create a new underline color attribute. More... | |
static AttrInt | create_attr_strikethrough (bool strikethrough) |
Create a new font strike-through attribute. More... | |
static AttrColor | create_attr_strikethrough_color (guint16 red, guint16 green, guint16 blue) |
Create a new strikethrough color attribute. More... | |
static AttrInt | create_attr_rise (int rise) |
Create a new baseline displacement attribute. More... | |
static AttrFloat | create_attr_scale (double scale_factor) |
Create a new font size scale attribute. More... | |
static AttrInt | create_attr_fallback (bool enable_fallback) |
Create a new font fallback attribute. More... | |
static AttrInt | create_attr_letter_spacing (int letter_spacing) |
Create a new letter-spacing attribute. More... | |
static AttrShape | create_attr_shape (const Rectangle& ink_rect, const Rectangle& logical_rect) |
Create a new shape attribute. More... | |
static AttrInt | create_attr_gravity (Gravity gravity) |
Create a new gravity attribute. More... | |
static AttrInt | create_attr_gravity_hint (int hint) |
Create a new gravity hint attribute. More... | |
static AttrString | create_attr_font_features (const Glib::ustring& features) |
Create a new font features tag attribute. More... | |
Protected Attributes | |
PangoAttribute* | gobject_ |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const Attribute& lhs, const Attribute& rhs) |
bool | operator!= (const Attribute& lhs, const Attribute& rhs) |
Pango::Attribute | wrap (PangoAttribute* object, bool take_copy=false) |
The Pango::Attribute structure represents the common portions of all attributes.
Particular types of attributes derive this class. It holds the range in which the value in the type-specific part of the attribute applies.
Attributed text is used in a number of places in pango. It is used as the input to the itemization process and also when creating a Pango::Layout.
Pango::Attribute::Attribute | ( | ) |
Constructs an invalid attribute.
Pango::Attribute::Attribute | ( | const Attribute& | src | ) |
|
explicit |
Pango::Attribute::~Attribute | ( | ) |
|
static |
Create a new background color attribute.
red | The red value (ranging from 0 to 65535). |
green | The green value (ranging from 0 to 65535). |
blue | The blue value (ranging from 0 to 65535). |
|
static |
Create a new background alpha attribute.
alpha | The alpha value, between 1 and 65536. |
|
static |
Create a new font fallback attribute.
If fallback is disabled, characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text.
enable_fallback | true if we should fall back on other fonts for characters the active font is missing. |
|
static |
Create a new font family attribute.
family | The family or comma separated list of families. |
|
static |
Create a new font description attribute.
This attribute allows setting family, style, weight, variant, stretch, and size simultaneously.
desc | The font description. |
|
static |
Create a new font features tag attribute.
features | A string with OpenType font features, in CSS syntax. |
|
static |
Create a new foreground color attribute.
red | The red value (ranging from 0 to 65535). |
green | The green value (ranging from 0 to 65535). |
blue | The blue value (ranging from 0 to 65535). |
|
static |
Create a new foreground alpha attribute.
alpha | The alpha value, between 1 and 65536. |
Create a new gravity attribute.
gravity | The gravity value; should not be Pango::Gravity::AUTO. |
|
static |
Create a new gravity hint attribute.
hint | The gravity hint value. Shall be a Pango::GravityHint value. |
|
static |
Create a new language tag attribute.
language | The language tag. |
|
static |
|
static |
Create a new baseline displacement attribute.
rise | The amount that the text should be displaced vertically, in 10'000ths of an em. Positive values displace the text upwards. |
|
static |
Create a new font size scale attribute.
The base font for the affected text will have its size multiplied by scale_factor.
scale_factor | Factor to scale the font. |
|
static |
Create a new shape attribute.
A shape is used to impose a particular ink and logical rect on the result of shaping a particular glyph. This might be used, for instance, for embedding a picture or a widget inside a PangoLayout.
ink_rect | Ink rectangle to assign to each character. |
logical_rect | Logical rectangle assign to each character. |
|
static |
Create a new font-size attribute.
size | The font size, in 1024ths of a point. |
|
static |
Create a new font-size attribute.
size | The font size, in 1024ths of a device unit. |
Create a new font stretch attribute.
stretch | The stretch. |
|
static |
Create a new font strike-through attribute.
strikethrough | True indicates the text should be struck-through. |
|
static |
Create a new strikethrough color attribute.
This attribute modifies the color of strikethrough lines. If not set, strikethrough lines will use the foreground color.
red | The red value (ranging from 0 to 65535). |
green | The green value (ranging from 0 to 65535). |
blue | The blue value (ranging from 0 to 65535). |
Create a new font slant style attribute.
style | The slant style. |
Create a new underline-style object.
underline | The underline style. |
|
static |
Create a new underline color attribute.
This attribute modifies the color of underlines. If not set, underlines will use the foreground color.
red | The red value (ranging from 0 to 65535). |
green | The green value (ranging from 0 to 65535). |
blue | The blue value (ranging from 0 to 65535). |
Create a new font variant attribute (normal or small caps).
variant | The variant. |
Create a new font weight attribute.
weight | The weight. |
bool Pango::Attribute::equal | ( | const Attribute& | attr2 | ) | const |
Compare two attributes for equality.
This compares only the actual value of the two attributes and not the ranges that the attributes apply to.
attr2 | Another Pango::Attribute. |
true
if the two attributes have the same value. unsigned int Pango::Attribute::get_end_index | ( | ) | const |
Gets the end index of the range.
The character at this index is not included in the range.
unsigned int Pango::Attribute::get_start_index | ( | ) | const |
Gets the start index of the range.
AttrType Pango::Attribute::get_type | ( | ) | const |
Gets the type ID for this attribute.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
static |
Allocate a new attribute type ID.
name | An identifier for the type (currently unused). |
void Pango::Attribute::set_end_index | ( | const unsigned int & | value | ) |
Sets the end index of the range.
The character at this index is not included in the range.
value | The new end index (in bytes). |
void Pango::Attribute::set_start_index | ( | const unsigned int & | value | ) |
Sets the start index of the range.
value | The new start index (in bytes). |
|
related |
|
protected |