Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# break.hh File Reference

A PangoLogAttr C++ wrapper interface. More...

`#include <xfc/utfstring.hh>`
`#include <pango/pango-break.h>`
`#include <vector>`
`#include <xfc/pango/inline/break.inl>`

## Namespaces

- namespace Xfc
- namespace Xfc::Pango

## Classes

- class Xfc::Pango::LogAttr
    A PangoLogAttr 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.

## Detailed Description

A PangoLogAttr C++ wrapper interface.

Provides LogAttr, an object that stores information about the attributes of a single character.

## 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).

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3