Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Pango Namespace Reference

C++ framework for the Pango text handling library. More...

## Compounds

- class Analysis
    A PangoAnalysis C++ wrapper class. More...
- class AttrBackground
    A PangoAttrBackground C++ wrapper class. More...
- class AttrColor
    A PangoAttrColor C++ wrapper class. More...
- class AttrEmbossed
    A GdkPangoAttrEmbossed C++ wrapper class. More...
- class AttrFamily
    A PangoAttrFamily C++ wrapper class. More...
- class AttrFloat
    A PangoAttrFloat C++ wrapper class. More...
- class AttrFontDesc
    A PangoAttrFontDesc C++ wrapper class. More...
- class AttrForeground
    A PangoAttrForeground C++ wrapper class. More...
- class Attribute
    A PangoAttriubte C++ wrapper class. More...
- class AttrInt
    A PangoAttrInt C++ wrapper class. More...
- class AttrIterator
    A PangoAttrIterator C++ wrapper class. More...
- class AttrLanguage
    A PangoAttrLanguage C++ wrapper class. More...
- class AttrList
    A PangoAttrList C++ wrapper class. More...
- class AttrRise
    A PangoAttrRise C++ wrapper class. More...
- class AttrScale
    A PangoAttrScale C++ wrapper class. More...
- class AttrShape
    A PangoAttrShape C++ wrapper class. More...
- class AttrSize
    A PangoAttrSize C++ wrapper class. More...
- class AttrStipple
    A GdkPangoAttrStipple C++ wrapper class. More...
- class AttrStretch
    A PangoAttrStretch C++ wrapper class. More...
- class AttrStrikethrough
    A PangoAttrStrikethrough C++ wrapper class. More...
- class AttrString
    A PangoAttrString C++ wrapper class. More...
- class AttrStyle
    A PangoAttrStyle C++ wrapper class. More...
- class AttrUnderline
    A PangoAttrUnderline C++ wrapper class. More...
- class AttrVariant
    A PangoAttrVariant C++ wrapper class. More...
- class AttrWeight
    A PangoAttrWeight C++ wrapper class. More...
- class Context
    A PangoLogAttr C++ wrapper class. More...
- class Coverage
    A PangoCoverage C++ wrapper class. More...
- class Font
    A PangoFont C++ wrapper class. More...
- class FontDescription
    A PangoFontDescription C++ wrapper class. More...
- class FontFace
    A PangoFontFace C++ wrapper class. More...
- class FontFamily
    A PangoFontFamily C++ wrapper class. More...
- class FontMap
    A PangoFontMap C++ wrapper class. More...
- class FontMetrics
    A PangoFontMetrics C++ wrapper class. More...
- class Fontset
    A PangoFontset C++ wrapper class. More...
- class GlyphGeometry
    A PangoGlyphGeometry C++ wrapper class. More...
- class GlyphInfo
    A PangoGlyphInfo C++ wrapper class. More...
- class GlyphString
    A PangoGlyphString C++ wrapper class. More...
- class GlyphVisAttr
    A PangoGlyphVisAttr C++ wrapper class. More...
- class Item
    A PangoItem C++ wrapper class. More...
- class Layout
    A PangoLayout C++ wrapper class. More...
- class LayoutIter
    A PangoLayoutIter C++ wrapper class. More...
- class LayoutLine
    A PangoLayoutLine C++ wrapper class. More...
- class LayoutRun
    A PangoLayoutRun C++ wrapper class. More...
- class LogAttr
    A PangoLogAttr C++ wrapper class. More...
- class Rectangle
    A PangoRectangle C++ wrapper class. More...
- class TabArray
    A PangoTabArray C++ wrapper class. More...

## Rendering Methods

- void break_text (const String &text, const Analysis &analysis, std::vector< LogAttr > &attrs)
    Determines possible line, word, and character breaks for a string of Unicode text.
- void find_paragraph_boundary (const String &text, int *paragraph_delimiter_index, int *next_paragraph_start)
    Locates a paragraph boundary in text.
- void get_log_attrs (const String &text, PangoLanguage *language, std::vector< LogAttr > &attrs, int level=-1)
    Computes a LogAttr for each character in text.

## Item methods

- std::vector< Pointer< Item > > reorder_items (const std::vector< Pointer< Item > > &logical_items)
    From a list of items in logical order and the associated directional levels, produce a list in visual order (the original list is unmodified).

## Typedefs

- typedef unsigned int FontMaskField
    FontMaskField holds one or more values from the FontMask enumeration OR'd together.
- typedef PangoGlyphUnit GlyphUnit
    GlyphUnit is a convenient typedef for PangoGlyphUnit.
- typedef PangoGlyph Glyph
    Glyph is a convenient typedef for PangoGlyph.

## Enumerations

- enum Underline {
  UNDERLINE_NONE = PANGO_UNDERLINE_NONE,
  UNDERLINE_SINGLE = PANGO_UNDERLINE_SINGLE,
  UNDERLINE_DOUBLE = PANGO_UNDERLINE_DOUBLE,
  UNDERLINE_LOW = PANGO_UNDERLINE_LOW
  }
    Underline is used to specify whether text should be underlined, and if so, the type of underlining. More...
- enum AttrType {
  ATTR_INVALID = PANGO_ATTR_INVALID,
  ATTR_LANGUAGE = PANGO_ATTR_LANGUAGE,
  ATTR_FAMILY = PANGO_ATTR_FAMILY,
  ATTR_STYLE = PANGO_ATTR_STYLE,
  ATTR_WEIGHT = PANGO_ATTR_WEIGHT,
  ATTR_VARIANT = PANGO_ATTR_VARIANT,
  ATTR_STRETCH = PANGO_ATTR_STRETCH,
  ATTR_SIZE = PANGO_ATTR_SIZE,
  ATTR_FONT_DESC = PANGO_ATTR_FONT_DESC,
  ATTR_FOREGROUND = PANGO_ATTR_FOREGROUND,
  ATTR_BACKGROUND = PANGO_ATTR_BACKGROUND,
  ATTR_UNDERLINE = PANGO_ATTR_UNDERLINE,
  ATTR_STRIKETHROUGH = PANGO_ATTR_STRIKETHROUGH,
  ATTR_RISE = PANGO_ATTR_RISE,
  ATTR_SHAPE = PANGO_ATTR_SHAPE,
  ATTR_SCALE = PANGO_ATTR_SCALE
  }
    Distinguishes between different types of attributes. More...
- enum CoverageLevel {
  COVERAGE_NONE = PANGO_COVERAGE_NONE,
  COVERAGE_FALLBACK = PANGO_COVERAGE_FALLBACK,
  COVERAGE_APPROXIMATE = PANGO_COVERAGE_APPROXIMATE,
  COVERAGE_EXACT = PANGO_COVERAGE_EXACT
  }
    Used to indicate how well a font can represent a particular ISO 10646 character point for a particular script. More...
- enum Style {
  STYLE_NORMAL = PANGO_STYLE_NORMAL,
  STYLE_OBLIQUE = PANGO_STYLE_OBLIQUE,
  STYLE_ITALIC = PANGO_STYLE_ITALIC
  }
    Specifies the various slant styles possible for a font. More...
- enum Variant {
  VARIANT_NORMAL = PANGO_VARIANT_NORMAL,
  VARIANT_SMALL_CAPS = PANGO_VARIANT_SMALL_CAPS
  }
    Specifies the capitalization variant of the font. More...
- enum Weight {
  WEIGHT_ULTALIGHT = PANGO_WEIGHT_ULTRALIGHT,
  WEIGHT_LIGHT = PANGO_WEIGHT_LIGHT,
  WEIGHT_NORMAL = PANGO_WEIGHT_NORMAL,
  WEIGHT_BOLD = PANGO_WEIGHT_BOLD,
  WEIGHT_ULTRABOLD = PANGO_WEIGHT_ULTRABOLD,
  WEIGHT_HEAVY = PANGO_WEIGHT_HEAVY
  }
    Specifies the weight (boldness) of a font. More...
- enum Stretch {
  STRETCH_UTLRA_CONDENSED = PANGO_STRETCH_ULTRA_CONDENSED,
  STRETCH_EXTRA_CONDENSED = PANGO_STRETCH_EXTRA_CONDENSED,
  STRETCH_CONDENSED = PANGO_STRETCH_CONDENSED,
  STRETCH_SEMI_CONDENSED = PANGO_STRETCH_SEMI_CONDENSED,
  STRETCH_NORMAL = PANGO_STRETCH_NORMAL,
  STRETCH_SEMI_EXPANDED = PANGO_STRETCH_SEMI_EXPANDED,
  STRETCH_EXPANDED = PANGO_STRETCH_EXPANDED,
  STRETCH_EXTRA_EXPANDED = PANGO_STRETCH_EXTRA_EXPANDED,
  STRETCH_ULTRA_EXPANDED = PANGO_STRETCH_ULTRA_EXPANDED
  }
    Specifies the width of the font relative to other designs within a family. More...
- enum FontMask {
  FONT_MASK_FAMILY = PANGO_FONT_MASK_FAMILY,
  FONT_MASK_STYLE = PANGO_FONT_MASK_STYLE,
  FONT_MASK_VARIANT = PANGO_FONT_MASK_VARIANT,
  FONT_MASK_WEIGHT = PANGO_FONT_MASK_WEIGHT,
  FONT_MASK_STRETCH = PANGO_FONT_MASK_STRETCH,
  FONT_MASK_SIZE = PANGO_FONT_MASK_SIZE
  }
    The bit flags in a FontMask correspond to fields in a FontDescription that have been set. More...
- enum Alignment {
  ALIGN_LEFT = PANGO_ALIGN_LEFT,
  ALIGN_CENTER = PANGO_ALIGN_CENTER,
  ALIGN_RIGHT = PANGO_ALIGN_RIGHT
  }
    Describes how to align the lines of a Layout within the available space. More...
- enum WrapMode {
  WRAP_WORD = PANGO_WRAP_WORD,
  WRAP_CHAR = PANGO_WRAP_CHAR,
  WRAP_WORD_CHAR = PANGO_WRAP_WORD_CHAR
  }
- enum TabAlign { TAB_LEFT = PANGO_TAB_LEFT }
    Specifies where a tab stop appears relative to the text. More...
- enum Direction {
  DIRECTION_LTR = PANGO_DIRECTION_LTR,
  DIRECTION_RTL = PANGO_DIRECTION_RTL,
  DIRECTION_TTB_LTR = PANGO_DIRECTION_TTB_LTR,
  DIRECTION_TTB_RTL = PANGO_DIRECTION_TTB_RTL
  }
    The Direction type represents the direction of writing for text. More...

## Detailed Description

C++ framework for the Pango text handling library.

Pango is a library for internationalized text handling. It centers around the Pango::Layout object, representing a paragraph of text. Pango provides the engine for Gtk::TextView, Gtk::Label, Gtk::Entry and other widgets that display text.

## Typedef Documentation

typedef PangoGlyph Inti::Pango::Glyph

| Glyph is a convenient typedef for PangoGlyph. Glyph structure represents a single glyph in the output form of a glyph string.

typedef PangoGlyphUnit Inti::Pango::GlyphUnit

GlyphUnit is a convenient typedef for PangoGlyphUnit.

The GlyphUnit type is used to store dimensions within Pango. Dimensions are stored in 1/PANGO_SCALE of a device unit. (A device unit might be a pixel for screen display, or a point on a printer.) PANGO_SCALE is currently 1024, and is unlikely to change, but you should not depend on its exact value. The PANGO_PIXELS() macro can be used to convert from glyph units into device units with correct rounding.

## Enumeration Type Documentation

enum Inti::Pango::Alignment

Describes how to align the lines of a Layout within the available space.

If the PangoLayout is set to justify using Pango::Layout::set_justify(), then this only has an effect for partial lines.

Enumeration values:

  ALIGN_LEFT | Put all available space on the right.
  ALIGN_CENTER | Center the line within the available space.
  ALIGN_RIGHT | Put all available space on the left.

enum Inti::Pango::AttrType

Distinguishes between different types of attributes.

Along with the predefined values, it is possible to allocate additional values for custom attributes using pango_attr_register_type(). The predefined values are given below. The type of class used to store the attribute is listed in parentheses after the description.

Enumeration values:

  ATTR_INVALID | Invalid.
  ATTR_LANGUAGE | Language (AttrLanguage).
  ATTR_FAMILY | Font family name list (AttrString).
  ATTR_STYLE | Font slant style (AttrInt).
  ATTR_WEIGHT | Font weight (AttrInt).
  ATTR_VARIANT | Font variant (normal or small caps) (AttrInt).
  ATTR_STRETCH | Font stretch (AttrInt).
  ATTR_SIZE | Font size in points divided by PANGO_SCALE (AttrInt).
  ATTR_FONT_DESC | Font description (AttrFontDesc).
  ATTR_FOREGROUND | Foreground color (AttrColor).
  ATTR_BACKGROUND | Background color (AttrColor).
  ATTR_UNDERLINE | Whether the text has an underline (AttrInt).
  ATTR_STRIKETHROUGH | Whether the text is struck-through (AttrInt).
  ATTR_RISE | Baseline displacement (AttrInt).
  ATTR_SHAPE | Shape (AttrShape).
  ATTR_SCALE | Font size scale factor (AttrScale).

enum Inti::Pango::CoverageLevel

Used to indicate how well a font can represent a particular ISO 10646 character point for a particular script.

Enumeration values:

  COVERAGE_NONE | The character is not representable with the font.
  COVERAGE_FALLBACK | The character is represented in a way that may be comprehensible but is not the correct graphical form; for instance, a Hangul character represented as a a sequence of Jamos, or a Latin transliteration of a Cyrillic word.
  COVERAGE_APPROXIMATE | The character is represented as basically the correct graphical form, but with a stylistic variant inappropriate for the current script.
  COVERAGE_EXACT | The character is represented as the correct graphical form.

enum Inti::Pango::Direction

The Direction type represents the direction of writing for text.

Enumeration values:

  DIRECTION_LTR | The text is written left-to-right.
  DIRECTION_RTL | The text is written right-to-left.
  DIRECTION_TTB_LTR | The text is written vertically top-to-bottom, with the rows ordered from left to right.
  DIRECTION_TTB_RTL | The text is written vertically top-to-bottom, with the rows ordered from right to left.

enum Inti::Pango::FontMask

The bit flags in a FontMask correspond to fields in a FontDescription that have been set.

Enumeration values:

  FONT_MASK_FAMILY | The font family is specified.
  FONT_MASK_STYLE | The font style is specified.
  FONT_MASK_VARIANT | T font variant is specified.
  FONT_MASK_WEIGHT | The font weight is specified.
  FONT_MASK_STRETCH | The font stretch is specified.
  FONT_MASK_SIZE | The font size is specified.

enum Inti::Pango::Stretch

Specifies the width of the font relative to other designs within a family.

Enumeration values:

  STRETCH_UTLRA_CONDENSED | Ultra condensed width.
  STRETCH_EXTRA_CONDENSED | Extra condensed width.
  STRETCH_CONDENSED | Condensed width.
  STRETCH_SEMI_CONDENSED | Semi condensed width.
  STRETCH_NORMAL | Normal width.
  STRETCH_SEMI_EXPANDED | Semi expanded width.
  STRETCH_EXPANDED | Expanded width.
  STRETCH_EXTRA_EXPANDED | Extra expanded width.
  STRETCH_ULTRA_EXPANDED | Ultra expanded width.

enum Inti::Pango::Style

Specifies the various slant styles possible for a font.

Enumeration values:

  STYLE_NORMAL | The font is upright.
  STYLE_OBLIQUE | The font is slanted, but in a roman style.
  STYLE_ITALIC | The font is slanted in an italic style.

enum Inti::Pango::TabAlign

Specifies where a tab stop appears relative to the text.

Currently there is only TAB_LEFT, but TAB_RIGHT, TAB_CENTER and TAB_NUMERIC may be supported in the future.

Enumeration values:

  TAB_LEFT | The tab stop appears to the left of the text.

enum Inti::Pango::Underline

Underline is used to specify whether text should be underlined, and if so, the type of underlining.

Enumeration values:

  UNDERLINE_NONE | No underline should be drawn.
  UNDERLINE_SINGLE | A single underline should be drawn.
  UNDERLINE_DOUBLE | A double underline should be drawn.
  UNDERLINE_LOW | A single underline should be drawn at a position beneath the ink extents of the text being underlined; this should be used only for underlining single characters, such as for keyboard accelerators; UNDERLINE_SINGLE should be used for extended portions of text.

enum Inti::Pango::Variant

Specifies the capitalization variant of the font.

Enumeration values:

  VARIANT_NORMAL | A normal font.
  VARIANT_SMALL_CAPS | A font with the lower case characters replaced by smaller variants of the capital characters.

enum Inti::Pango::Weight

Specifies the weight (boldness) of a font.

This is a numerical value ranging from 100 to 900, but there are some predefined values:

Enumeration values:

  WEIGHT_ULTALIGHT | The ultralight weight (= 200).
  WEIGHT_LIGHT | The light weight (=300).
  WEIGHT_NORMAL | The default weight (= 400).
  WEIGHT_BOLD | The bold weight (= 700).
  WEIGHT_ULTRABOLD | The ultrabold weight (= 800).
  WEIGHT_HEAVY | The heavy weight (= 900).

enum Inti::Pango::WrapMode

Enumeration values:

  WRAP_WORD | Wrap lines at word boundaries.
  WRAP_CHAR | Wrap lines at character boundaries.
  WRAP_WORD_CHAR | Wrap lines at word boundaries, but fall back to character boundaries if there is not enought space for a full word.

## Function Documentation

void break_text | ( | const String & | text,
|  | const Analysis & | analysis,
|  | std::vector< LogAttr > & | attrs
| ) |

Determines possible line, word, and character breaks for a string of Unicode text.

Parameters:

  text | The text to process.
  analysis | An Analysis structure from Pango::Context::itemize().
  attrs | A vector of LogAttr to store the character information in.

void find_paragraph_boundary | ( | const String & | text,
|  | int * | paragraph_delimiter_index,
|  | int * | next_paragraph_start
| ) |

Locates a paragraph boundary in text.

Parameters:

  text | The UTF-8 text.
  paragraph_delimiter_index | The return location for index of delimiter.
  next_paragraph_start | The return location for start of next paragraph.

A boundary is caused by delimiter characters, such as a newline, carriage return, carriage return-newline pair, or Unicode paragraph separator character. The index of the run of delimiters is returned in paragraph_delimiter_index. The index of the start of the paragraph (index after all delimiters) is stored in next_paragraph_start. If no delimiters are found, both paragraph_delimiter_index and next_paragraph_start are filled with the length of text (an index one off the end).

void get_log_attrs | ( | const String & | text,
|  | PangoLanguage * | language,
|  | std::vector< LogAttr > & | attrs,
|  | int | level = -1
| ) |

Computes a LogAttr for each character in text.

Parameters:

  text | The text to process.
  language | The language tag.
  attrs | A vector of LogAttr with one LogAttr per character in text, plus one extra, to be filled in.
  level | The embedding level, or -1 if unknown.

The log_attrs vector must have one LogAttr for each position in text; if text contains N characters, it has N+1 positions, including the last position at the end of the text. text should be an entire paragraph; logical attributes can't be computed without context (for example you need to see spaces on either side of a word to know the word is a word).

std::vector<Pointer<Item> > reorder_items | ( | const std::vector< Pointer< Item > > & | logical_items | ) |

From a list of items in logical order and the associated directional levels, produce a list in visual order (the original list is unmodified).

Parameters:

  logical_items | A vector of Pointer<Item> in logical order.

Returns:
  A vector of Pointer<Item> in visual order.

Please mail otaylor@redhat.com if you use this method. It is not a particularly convenient interface, and the code is duplicated elsewhere in Pango for that reason.

Main Page - Footer