GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
utils
gp_markup_justify.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-2.1-or-later
2
/*
3
* Copyright (C) 2022-2023 Cyril Hrubis <metan@ucw.cz>
4
*/
5
11
#ifndef UTILS_GP_MARKUP_JUSTIFY_H
12
#define UTILS_GP_MARKUP_JUSTIFY_H
13
14
#include <
utils/gp_markup.h
>
15
19
typedef
struct
gp_markup_line
{
21
gp_markup_glyph
*
first
;
23
gp_markup_glyph
*
last
;
24
}
gp_markup_line
;
25
31
typedef
struct
gp_markup_lines
{
33
unsigned
int
lines_cnt
;
35
gp_markup_line
lines
[];
36
}
gp_markup_lines
;
37
50
typedef
unsigned
int (*
gp_markup_width_cb
)(
gp_markup_glyph
*first,
size_t
len,
void
*priv);
51
52
62
gp_markup_lines
*
gp_markup_justify
(
gp_markup
*self,
unsigned
int
line_width,
gp_markup_width_cb
width_callback,
void
*priv);
63
69
void
gp_markup_justify_free
(
gp_markup_lines
*self);
70
76
void
gp_markup_justify_dump
(
gp_markup_lines
*self);
77
78
#endif
/* UTILS_GP_MARKUP_JUSTIFY_H */
gp_markup.h
A simple text markup format.
gp_markup_justify_free
void gp_markup_justify_free(gp_markup_lines *self)
Frees justified lines.
gp_markup_justify
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.
gp_markup_width_cb
unsigned int(* gp_markup_width_cb)(gp_markup_glyph *first, size_t len, void *priv)
A callback for text justification.
Definition
gp_markup_justify.h:50
gp_markup_justify_dump
void gp_markup_justify_dump(gp_markup_lines *self)
Dumps justified lines into stdout, used for debugging.
gp_markup_glyph
A markup glyph.
Definition
gp_markup.h:67
gp_markup_line
A markup line.
Definition
gp_markup_justify.h:19
gp_markup_line::first
gp_markup_glyph * first
Definition
gp_markup_justify.h:21
gp_markup_line::last
gp_markup_glyph * last
Definition
gp_markup_justify.h:23
gp_markup_lines
A markup lines.
Definition
gp_markup_justify.h:31
gp_markup_lines::lines
gp_markup_line lines[]
Definition
gp_markup_justify.h:35
gp_markup_lines::lines_cnt
unsigned int lines_cnt
Definition
gp_markup_justify.h:33
gp_markup
A text markup.
Definition
gp_markup.h:97
Generated by
1.9.8