# Cinder

# cinder::TextLayout Class Reference

`#include <Text.h>`

List of all members.

## Public Member Functions
| TextLayout ()
| This is an abstract line.
void | clear (const Color &color)
| Sets the background color for the TextLayout. Implicit opqaue alpha.
void | clear (const ColorA &color)
| Sets the background color and alpha for the TextLayout to unpremulitiplied color color.
void | addLine (const std::string &line)
| Adds a left-justified line of text to the layout. Assumes UTF-8 encoding.
void | addCenteredLine (const std::string &line)
| Adds a centered line of text to the layout. Assumes UTF-8 encoding.
void | addRightLine (const std::string &line)
| Adds a right-justified line of text to the layout. Assumes UTF-8 encoding.
void | append (const std::string &str)
| Appends string str to the current line. Assumes UTF-8 encoding.
void | setFont (const Font &font)
void | setColor (const Color &color)
| Sets the currently active color. Implicit opqaue alpha.
void | setColor (const ColorA &color)
| Sets the currently active color and alpha.
void | setLeadingOffset (float leadingOffset)
| Sets an offset relative to the default leading (the vertical space between lines).
void | setBorder (int horizontal, int vertical)
| Adds a horizontal pixel border to the left and the right sides, and a vertical border to the top and bottom.
Surface | render (bool useAlpha=false, bool premultiplied=false)
| Returns a Surface into which the TextLayout is rendered. If useAlpha the Surface will contain an alpha channel. If premultiplied the alpha will be premulitplied.

## Constructor & Destructor Documentation

cinder::TextLayout::TextLayout | ( |  | ) |

This is an abstract line.

Makes a TextLayout Object.

## Member Function Documentation

void cinder::TextLayout::clear | ( | const Color & | color | ) |

Sets the background color for the TextLayout. Implicit opqaue alpha.

void cinder::TextLayout::clear | ( | const ColorA & | color | ) |

Sets the background color and alpha for the TextLayout to unpremulitiplied color color.

void cinder::TextLayout::addLine | ( | const std::string & | line | ) |

Adds a left-justified line of text to the layout. Assumes UTF-8 encoding.

void cinder::TextLayout::addCenteredLine | ( | const std::string & | line | ) |

Adds a centered line of text to the layout. Assumes UTF-8 encoding.

void cinder::TextLayout::addRightLine | ( | const std::string & | line | ) |

Adds a right-justified line of text to the layout. Assumes UTF-8 encoding.

void cinder::TextLayout::append | ( | const std::string & | str | ) |

Appends string str to the current line. Assumes UTF-8 encoding.

void cinder::TextLayout::setFont | ( | const Font & | font | ) |

void cinder::TextLayout::setColor | ( | const Color & | color | ) |

Sets the currently active color. Implicit opqaue alpha.

void cinder::TextLayout::setColor | ( | const ColorA & | color | ) |

Sets the currently active color and alpha.

void cinder::TextLayout::setLeadingOffset | ( | float | leadingOffset | ) |

Sets an offset relative to the default leading (the vertical space between lines).

void cinder::TextLayout::setBorder | ( | int | horizontal,
|  | int | vertical |
| ) |  |  |

Adds a horizontal pixel border to the left and the right sides, and a vertical border to the top and bottom.

Surface cinder::TextLayout::render | ( | bool | useAlpha = `false`,
|  | bool | premultiplied = `false` |
| ) |  |  |

Returns a Surface into which the TextLayout is rendered. If useAlpha the Surface will contain an alpha channel. If premultiplied the alpha will be premulitplied.

The documentation for this class was generated from the following files:

- include/cinder/Text.h
- src/cinder/Text.cpp