1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
* shape.c: Convert characters into glyphs.
5
* The contents of this file are subject to the Mozilla Public
6
* License Version 1.1 (the "License"); you may not use this file
7
* except in compliance with the License. You may obtain a copy of
8
* the License at http://www.mozilla.org/MPL/
10
* Software distributed under the License is distributed on an "AS
11
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
12
* implied. See the License for the specific language governing
13
* rights and limitations under the License.
15
* The Original Code is the Pango Library (www.pango.org)
17
* The Initial Developer of the Original Code is Red Hat Software
18
* Portions created by Red Hat are Copyright (C) 1999 Red Hat Software.
22
* Alternatively, the contents of this file may be used under the
23
* terms of the GNU Lessor General Public License Version 2 (the
24
* "LGPL"), in which case the provisions of the LGPL are applicable
25
* instead of those above. If you wish to allow use of your
26
* version of this file only under the terms of the LGPL and not to
27
* allow others to use your version of this file under the MPL,
28
* indicate your decision by deleting the provisions above and
29
* replace them with the notice and other provisions required by
30
* the LGPL. If you do not delete the provisions above, a recipient
31
* may use your version of this file under either the MPL or the
35
#include "pango-glyph.h"
36
#include "pango-engine.h"
40
* @text: the text to process
41
* @length: the length (in bytes) of @text
42
* @analysis: #PangoliteAnalysis structure from PangoliteItemize
43
* @glyphs: glyph string in which to store results
45
* Given a segment of text and the corresponding
46
* #PangoliteAnalysis structure returned from pangolite_itemize(),
47
* convert the characters into glyphs. You may also pass
48
* in only a substring of the item from pangolite_itemize().
50
void pangolite_shape(const gunichar2 *text,
52
PangoliteAnalysis *analysis,
53
PangoliteGlyphString *glyphs)
55
if (analysis->shape_engine)
56
analysis->shape_engine->script_shape(analysis->fontCharset, text, length,
59
pangolite_glyph_string_set_size (glyphs, 1);
61
glyphs->glyphs[0].glyph = 0;
62
glyphs->log_clusters[0] = 0;
65
g_assert (glyphs->num_glyphs > 0);