pango-coverage.h 3.62 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Pango
 * pango-coverage.h: Coverage sets for fonts
 *
 * Copyright (C) 2000 Red Hat Software
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __PANGO_COVERAGE_H__
#define __PANGO_COVERAGE_H__

25
#include <glib-object.h>
26

27
#include <pango/pango-version-macros.h>
Matthias Clasen's avatar
Matthias Clasen committed
28
#include <hb.h>
29

Owen Taylor's avatar
Owen Taylor committed
30
G_BEGIN_DECLS
31

32
33
34
/**
 * PangoCoverage:
 *
35
36
 * A `PangoCoverage` structure is a map from Unicode characters
 * to [enum@Pango.CoverageLevel] values.
Matthias Clasen's avatar
Matthias Clasen committed
37
 *
38
39
40
41
42
 * It is often necessary in Pango to determine if a particular
 * font can represent a particular character, and also how well
 * it can represent that character. The `PangoCoverage` is a data
 * structure that is used to represent that information. It is an
 * opaque structure with no public fields.
43
 */
44
45
typedef struct _PangoCoverage PangoCoverage;

46
47
/**
 * PangoCoverageLevel:
48
49
50
51
52
53
54
55
56
57
58
59
 * @PANGO_COVERAGE_NONE: The character is not representable with
 *   the font.
 * @PANGO_COVERAGE_FALLBACK: The character is represented in a
 *   way that may be comprehensible but is not the correct
 *   graphical form. For instance, a Hangul character represented
 *   as a a sequence of Jamos, or a Latin transliteration of a
 *   Cyrillic word.
 * @PANGO_COVERAGE_APPROXIMATE: The character is represented as
 *   basically the correct graphical form, but with a stylistic
 *   variant inappropriate for the current script.
 * @PANGO_COVERAGE_EXACT: The character is represented as the
 *   correct graphical form.
60
 *
61
62
 * `PangoCoverageLevel` is used to indicate how well a font can
 * represent a particular Unicode character for a particular script.
63
64
65
 *
 * Since 1.44, only %PANGO_COVERAGE_NONE and %PANGO_COVERAGE_EXACT
 * will be returned.
66
 */
67
68
69
70
71
72
73
typedef enum {
  PANGO_COVERAGE_NONE,
  PANGO_COVERAGE_FALLBACK,
  PANGO_COVERAGE_APPROXIMATE,
  PANGO_COVERAGE_EXACT
} PangoCoverageLevel;

74
75
76
PANGO_AVAILABLE_IN_ALL
GType pango_coverage_get_type (void) G_GNUC_CONST;

77
PANGO_AVAILABLE_IN_ALL
78
PangoCoverage *    pango_coverage_new     (void);
79
PANGO_AVAILABLE_IN_ALL
80
PangoCoverage *    pango_coverage_ref     (PangoCoverage      *coverage);
81
PANGO_AVAILABLE_IN_ALL
Owen Taylor's avatar
Owen Taylor committed
82
void               pango_coverage_unref   (PangoCoverage      *coverage);
83
PANGO_AVAILABLE_IN_ALL
84
PangoCoverage *    pango_coverage_copy    (PangoCoverage      *coverage);
85
PANGO_AVAILABLE_IN_ALL
86
PangoCoverageLevel pango_coverage_get     (PangoCoverage      *coverage,
87
					   int                 index_);
88
PANGO_AVAILABLE_IN_ALL
89
void               pango_coverage_set     (PangoCoverage      *coverage,
90
					   int                 index_,
91
					   PangoCoverageLevel  level);
92
PANGO_DEPRECATED_IN_1_44
93
94
95
void               pango_coverage_max     (PangoCoverage      *coverage,
					   PangoCoverage      *other);

96
PANGO_DEPRECATED_IN_1_44
Owen Taylor's avatar
Owen Taylor committed
97
98
99
void           pango_coverage_to_bytes   (PangoCoverage  *coverage,
					  guchar        **bytes,
					  int            *n_bytes);
100
PANGO_DEPRECATED_IN_1_44
Owen Taylor's avatar
Owen Taylor committed
101
102
103
PangoCoverage *pango_coverage_from_bytes (guchar         *bytes,
					  int             n_bytes);

Owen Taylor's avatar
Owen Taylor committed
104
G_END_DECLS
105

106
#endif /* __PANGO_COVERAGE_H__ */