![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Justifies markup into lines. More...
#include <utils/gp_markup.h>Go to the source code of this file.
Data Structures | |
| struct | gp_markup_line |
| A markup line. More... | |
| struct | gp_markup_lines |
| A markup lines. More... | |
Typedefs | |
| typedef struct gp_markup_line | gp_markup_line |
| A markup line. | |
| typedef struct gp_markup_lines | gp_markup_lines |
| A markup lines. | |
| typedef unsigned int(* | gp_markup_width_cb) (gp_markup_glyph *first, size_t len, void *priv) |
| A callback for text justification. | |
Functions | |
| gp_markup_lines * | gp_markup_justify (gp_markup *self, unsigned int line_width, gp_markup_width_cb width_callback, void *priv) |
| Justifies text into lines. | |
| void | gp_markup_justify_free (gp_markup_lines *self) |
| Frees justified lines. | |
| void | gp_markup_justify_dump (gp_markup_lines *self) |
| Dumps justified lines into stdout, used for debugging. | |
Justifies markup into lines.
Definition in file gp_markup_justify.h.
| typedef struct gp_markup_lines gp_markup_lines |
A markup lines.
This represents a markup text justified into a lines.
| typedef unsigned int(* gp_markup_width_cb) (gp_markup_glyph *first, size_t len, void *priv) |
A callback for text justification.
The algorithm that breaks text into lines needs to know the width of a group of glyphs in order to be able to break the text into lines of a given width.
| first | A pointer to a start of the array of glyphs. |
| len | A number of glyphs in the array. |
| priv | A private pointer passed to the gp_markup_justify() function. |
Definition at line 50 of file gp_markup_justify.h.
| gp_markup_lines * gp_markup_justify | ( | gp_markup * | self, |
| unsigned int | line_width, | ||
| gp_markup_width_cb | width_callback, | ||
| void * | priv ) |
Justifies text into lines.
| self | A text markup. |
| line_width | A width the markup should be justified into. |
| width_callback | A callback that computes width of a glyph group. |
| priv | A private pointer passed down to the width_callback. |
| void gp_markup_justify_dump | ( | gp_markup_lines * | self | ) |
Dumps justified lines into stdout, used for debugging.
| self | A justified markup. |
| void gp_markup_justify_free | ( | gp_markup_lines * | self | ) |
Frees justified lines.
| self | A justified markup. |