STLL
0.0
Simple Text Layouting Library
|
The namespace for the library. Every function and class is within this namespace. More...
Classes | |
class | AttributeIndex_c |
collection of codepointAttributes for the layouter. More... | |
class | CodepointAttributes_c |
this structure contains all attributes that a single glyph can get assigned More... | |
class | Color_c |
a little class representing an RGBA colour value, an a value of 255 is assumed to be opaque More... | |
class | CommandData_c |
This structure encapsulates a drawing command. More... | |
class | Font_c |
contains all the FontFaces_c of one FontRessource_c More... | |
class | FontCache_c |
this class encapsulates open fonts of a single library, it makes sure that each font is open only once More... | |
class | FontFace_c |
This class represents one font, made out of one font file resource with a certain size. More... | |
class | FontFamily_c |
a class contains all resources for a family of fonts More... | |
class | FontResource_c |
This class represents a font resource. More... | |
class | FreetypeException_c |
This class is thrown on problems with the FreeType library. More... | |
class | FreeTypeLibrary_c |
This class encapsulates an instance of the FreeType library. More... | |
class | LayoutProperties_c |
this structure contains information for the layouter how to layout the text More... | |
class | RectangleShape_c |
concrete implementation of the shape that will allow layouting inside a rectangular with a certain width More... | |
class | Shape_c |
base class to define the shape to layout text into More... | |
class | showOpenGL |
a class to output layouts using OpenGL More... | |
class | showSDL |
a class to output layouts using SDL More... | |
class | TextLayout_c |
encapsulates a finished layout. More... | |
class | TextStyleSheet_c |
this class encapsulates information for how to format a text, just like the style sheets in html are doing. More... | |
class | XhtmlException_c |
exception thrown on XHTML and CSS problems More... | |
Typedefs | |
typedef uint32_t | glyphIndex_t |
type used for all glyph indices. Right now there is no font with more than 2^16 fonts, so 2^32 should be on the safe side. Also HarfBuzz also uses only 2^32 codepoints. More... | |
Enumerations | |
enum | SubPixelArrangement { SUBP_NONE, SUBP_RGB, SUBP_BGR, SUBP_RGB_V, SUBP_BGR_V } |
define, which sub-pixel arrangement you want to use for sub-pixel output More... | |
Functions | |
void | addHyphenDictionary (const std::vector< std::string > &langs, std::istream &str) |
register a hyphen dictionary for a given set of languages More... | |
void | addHyphenDictionary (const std::vector< std::string > &langs, std::istream &&str) |
see the other addHyphenDictionary function More... | |
TextLayout_c | layoutParagraph (const std::u32string &txt32, const AttributeIndex_c &attr, const Shape_c &shape, const LayoutProperties_c &prop, int32_t ystart=0) |
TextLayout_c | layoutXML (pugi::xml_node txt, const TextStyleSheet_c &rules, const Shape_c &shape) |
layout the given preparsed XML tree as an HTML dom tree More... | |
TextLayout_c | layoutXML (const xmlNode *txt, const TextStyleSheet_c &rules, const Shape_c &shape) |
TextLayout_c | layoutXHTMLPugi (const std::string &txt, const TextStyleSheet_c &rules, const Shape_c &shape) |
layout the given XHTML code More... | |
TextLayout_c | layoutXHTMLLibXML2 (const std::string &txt, const TextStyleSheet_c &rules, const Shape_c &shape) |
The namespace for the library. Every function and class is within this namespace.
typedef uint32_t STLL::glyphIndex_t |
type used for all glyph indices. Right now there is no font with more than 2^16 fonts, so 2^32 should be on the safe side. Also HarfBuzz also uses only 2^32 codepoints.
void STLL::addHyphenDictionary | ( | const std::vector< std::string > & | langs, |
std::istream & | str | ||
) |
register a hyphen dictionary for a given set of languages
langs | a vector of language strings. The language strings are the ones that you use in the lang xml attributes or in the lang member of the AttributeIndex class. If the language to be looked for when looking for a dictionary to do the hyphenation contains an dash stll will also look for a dictionary with the text just before that dash. So if you register a dictionary for the language "en" and use "en-US" in your language tag it will use your hyphenation dictionary |
str | must point to an input stream of a hyphen dictionary, the file must be an UTF-8 encoded Open Office hyphen dictionary, nothing else is not supported |
void STLL::addHyphenDictionary | ( | const std::vector< std::string > & | langs, |
std::istream && | str | ||
) |
see the other addHyphenDictionary function
TextLayout_c STLL::layoutParagraph | ( | const std::u32string & | txt32, |
const AttributeIndex_c & | attr, | ||
const Shape_c & | shape, | ||
const LayoutProperties_c & | prop, | ||
int32_t | ystart = 0 |
||
) |
paragraph layouting function
txt32 | the utf-32 encoded text to layout, no control sequences exist, use "\n" for newlines |
attr | the attributes (colours, ...) for all the characters in the text |
shape | the shape that the final result is supposed to have |
prop | some parameters that the line breaking algorithm needs to give the result the expected shape (centre or justified, ...) |
ystart | the vertical starting point (in 1/64th pixels) of your output, the baseline of the first line of text will be shifted down from this position by the ascender of the line |
TODO: instead of crashing, rather throw an exception in that case.
TextLayout_c STLL::layoutXHTMLLibXML2 | ( | const std::string & | txt, |
const TextStyleSheet_c & | rules, | ||
const Shape_c & | shape | ||
) |
TextLayout_c STLL::layoutXHTMLPugi | ( | const std::string & | txt, |
const TextStyleSheet_c & | rules, | ||
const Shape_c & | shape | ||
) |
layout the given XHTML code
lib | the library to use, currently supported as Pugi and LibXML2 |
txt | the html text to parse, is must be utf-8. The text must be a proper XHTML document (see also HTML) |
rules | the stylesheet to use for layouting |
shape | the shape to layout into |
TextLayout_c STLL::layoutXML | ( | pugi::xml_node | txt, |
const TextStyleSheet_c & | rules, | ||
const Shape_c & | shape | ||
) |
layout the given preparsed XML tree as an HTML dom tree
xml | the xml tree to layout |
rules | the stylesheet to use for layouting |
shape | the shape to layout into |
TextLayout_c STLL::layoutXML | ( | const xmlNode * | txt, |
const TextStyleSheet_c & | rules, | ||
const Shape_c & | shape | ||
) |