Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
pango-break.h
Go to the documentation of this file.
1/* Pango
2 * pango-break.h:
3 *
4 * Copyright (C) 1999 Red Hat Software
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef __PANGO_BREAK_H__
23#define __PANGO_BREAK_H__
24
25#include <glib.h>
26
28
29#include <pango/pango-item.h>
30
31/* Logical attributes of a character.
32 */
33/**
34 * PangoLogAttr:
35 * @is_line_break: if set, can break line in front of character
36 * @is_mandatory_break: if set, must break line in front of character
37 * @is_char_break: if set, can break here when doing character wrapping
38 * @is_white: is whitespace character
39 * @is_cursor_position: if set, cursor can appear in front of character.
40 * i.e. this is a grapheme boundary, or the first character in the text.
41 * This flag implements Unicode's
42 * [Grapheme Cluster Boundaries](http://www.unicode.org/reports/tr29/)
43 * semantics.
44 * @is_word_start: is first character in a word
45 * @is_word_end: is first non-word char after a word
46 * Note that in degenerate cases, you could have both @is_word_start
47 * and @is_word_end set for some character.
48 * @is_sentence_boundary: is a sentence boundary.
49 * There are two ways to divide sentences. The first assigns all
50 * inter-sentence whitespace/control/format chars to some sentence,
51 * so all chars are in some sentence; @is_sentence_boundary denotes
52 * the boundaries there. The second way doesn't assign
53 * between-sentence spaces, etc. to any sentence, so
54 * @is_sentence_start/@is_sentence_end mark the boundaries of those sentences.
55 * @is_sentence_start: is first character in a sentence
56 * @is_sentence_end: is first char after a sentence.
57 * Note that in degenerate cases, you could have both @is_sentence_start
58 * and @is_sentence_end set for some character. (e.g. no space after a
59 * period, so the next sentence starts right away)
60 * @backspace_deletes_character: if set, backspace deletes one character
61 * rather than the entire grapheme cluster. This field is only meaningful
62 * on grapheme boundaries (where @is_cursor_position is set). In some languages,
63 * the full grapheme (e.g. letter + diacritics) is considered a unit, while in
64 * others, each decomposed character in the grapheme is a unit. In the default
65 * implementation of [func@break], this bit is set on all grapheme boundaries
66 * except those following Latin, Cyrillic or Greek base characters.
67 * @is_expandable_space: is a whitespace character that can possibly be
68 * expanded for justification purposes. (Since: 1.18)
69 * @is_word_boundary: is a word boundary, as defined by UAX#29.
70 * More specifically, means that this is not a position in the middle of a word.
71 * For example, both sides of a punctuation mark are considered word boundaries.
72 * This flag is particularly useful when selecting text word-by-word. This flag
73 * implements Unicode's [Word Boundaries](http://www.unicode.org/reports/tr29/)
74 * semantics. (Since: 1.22)
75 * @break_inserts_hyphen: when breaking lines before this char, insert a hyphen.
76 * Since: 1.50
77 * @break_removes_preceding: when breaking lines before this char, remove the
78 * preceding char. Since 1.50
79 *
80 * The `PangoLogAttr` structure stores information about the attributes of a
81 * single character.
82 */
103
105void pango_break (const char *text,
106 int length,
107 PangoAnalysis *analysis,
108 PangoLogAttr *attrs,
109 int attrs_len);
110
112void pango_get_log_attrs (const char *text,
113 int length,
114 int level,
115 PangoLanguage *language,
116 PangoLogAttr *attrs,
117 int attrs_len);
118
120void pango_default_break (const char *text,
121 int length,
122 PangoAnalysis *analysis,
123 PangoLogAttr *attrs,
124 int attrs_len);
125
127void pango_tailor_break (const char *text,
128 int length,
129 PangoAnalysis *analysis,
130 int offset,
131 PangoLogAttr *attrs,
132 int attrs_len);
133
135void pango_attr_break (const char *text,
136 int length,
137 PangoAttrList *attr_list,
138 int offset,
139 PangoLogAttr *attrs,
140 int attrs_len);
141
143
144#endif /* __PANGO_BREAK_H__ */
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
unsigned int guint
Definition gtypes.h:61
struct _PangoAttrList PangoAttrList
PANGO_AVAILABLE_IN_1_50 void pango_attr_break(const char *text, int length, PangoAttrList *attr_list, int offset, PangoLogAttr *attrs, int attrs_len)
PANGO_DEPRECATED_IN_1_44 void pango_break(const char *text, int length, PangoAnalysis *analysis, PangoLogAttr *attrs, int attrs_len)
PANGO_AVAILABLE_IN_ALL void pango_get_log_attrs(const char *text, int length, int level, PangoLanguage *language, PangoLogAttr *attrs, int attrs_len)
PANGO_AVAILABLE_IN_ALL void pango_default_break(const char *text, int length, PangoAnalysis *analysis, PangoLogAttr *attrs, int attrs_len)
PANGO_AVAILABLE_IN_1_44 void pango_tailor_break(const char *text, int length, PangoAnalysis *analysis, int offset, PangoLogAttr *attrs, int attrs_len)
typedefG_BEGIN_DECLS struct _PangoAnalysis PangoAnalysis
Definition pango-item.h:30
typedefG_BEGIN_DECLS struct _PangoLogAttr PangoLogAttr
Definition pango-types.h:32
struct _PangoLanguage PangoLanguage
Definition pango-types.h:46
#define PANGO_AVAILABLE_IN_1_44
#define PANGO_DEPRECATED_IN_1_44
#define PANGO_AVAILABLE_IN_1_50
#define PANGO_AVAILABLE_IN_ALL
guint is_expandable_space
Definition pango-break.h:96
guint break_removes_preceding
Definition pango-break.h:99
guint is_cursor_position
Definition pango-break.h:89
guint break_inserts_hyphen
Definition pango-break.h:98
guint is_word_start
Definition pango-break.h:90
guint is_word_end
Definition pango-break.h:91
guint is_char_break
Definition pango-break.h:87
guint backspace_deletes_character
Definition pango-break.h:95
guint is_line_break
Definition pango-break.h:85
guint is_mandatory_break
Definition pango-break.h:86
guint is_sentence_start
Definition pango-break.h:93
guint is_word_boundary
Definition pango-break.h:97
guint is_sentence_end
Definition pango-break.h:94
guint is_sentence_boundary
Definition pango-break.h:92