1 | /* Pango |
2 | * pangofc-decoder.c: Custom font encoder/decoders |
3 | * |
4 | * Copyright (C) 2004 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 | #include "config.h" |
23 | #include "pangofc-decoder.h" |
24 | |
25 | G_DEFINE_ABSTRACT_TYPE (PangoFcDecoder, pango_fc_decoder, G_TYPE_OBJECT) |
26 | |
27 | static void |
28 | pango_fc_decoder_init (PangoFcDecoder *decoder G_GNUC_UNUSED) |
29 | { |
30 | } |
31 | |
32 | static void |
33 | pango_fc_decoder_class_init (PangoFcDecoderClass *klass G_GNUC_UNUSED) |
34 | { |
35 | } |
36 | |
37 | /** |
38 | * pango_fc_decoder_get_charset: |
39 | * @decoder: a `PangoFcDecoder` |
40 | * @fcfont: the `PangoFcFont` to query. |
41 | * |
42 | * Generates an `FcCharSet` of supported characters for the @fcfont |
43 | * given. |
44 | * |
45 | * The returned `FcCharSet` will be a reference to an |
46 | * internal value stored by the `PangoFcDecoder` and must not |
47 | * be modified or freed. |
48 | * |
49 | * Returns: (transfer none): the `FcCharset` for @fcfont; must not |
50 | * be modified or freed. |
51 | * |
52 | * Since: 1.6 |
53 | **/ |
54 | FcCharSet * |
55 | pango_fc_decoder_get_charset (PangoFcDecoder *decoder, |
56 | PangoFcFont *fcfont) |
57 | { |
58 | g_return_val_if_fail (PANGO_IS_FC_DECODER (decoder), NULL); |
59 | |
60 | return PANGO_FC_DECODER_GET_CLASS (decoder)->get_charset (decoder, fcfont); |
61 | } |
62 | |
63 | /** |
64 | * pango_fc_decoder_get_glyph: |
65 | * @decoder: a `PangoFcDecoder` |
66 | * @fcfont: a `PangoFcFont` to query. |
67 | * @wc: the Unicode code point to convert to a single `PangoGlyph`. |
68 | * |
69 | * Generates a `PangoGlyph` for the given Unicode point using the |
70 | * custom decoder. |
71 | * |
72 | * For complex scripts where there can be multiple |
73 | * glyphs for a single character, the decoder will return whatever |
74 | * glyph is most convenient for it. (Usually whatever glyph is directly |
75 | * in the fonts character map table.) |
76 | * |
77 | * Return value: the glyph index, or 0 if the glyph isn't |
78 | * covered by the font. |
79 | * |
80 | * Since: 1.6 |
81 | **/ |
82 | PangoGlyph |
83 | pango_fc_decoder_get_glyph (PangoFcDecoder *decoder, |
84 | PangoFcFont *fcfont, |
85 | guint32 wc) |
86 | { |
87 | g_return_val_if_fail (PANGO_IS_FC_DECODER (decoder), 0); |
88 | |
89 | return PANGO_FC_DECODER_GET_CLASS (decoder)->get_glyph (decoder, fcfont, wc); |
90 | } |
91 | |