~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/intl/ctl/src/pangoLite/shape.c

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 
2
 * Pango
 
3
 * shape.c: Convert characters into glyphs.
 
4
 *
 
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/
 
9
 * 
 
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.
 
14
 * 
 
15
 * The Original Code is the Pango Library (www.pango.org) 
 
16
 * 
 
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.
 
19
 * 
 
20
 * Contributor(s): 
 
21
 * 
 
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
 
32
 * LGPL.
 
33
*/
 
34
 
 
35
#include "pango-glyph.h"
 
36
#include "pango-engine.h"
 
37
 
 
38
/**
 
39
 * pangolite_shape:
 
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
 
44
 *
 
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().
 
49
 */
 
50
void pangolite_shape(const gunichar2  *text, 
 
51
                 gint             length, 
 
52
                 PangoliteAnalysis    *analysis,
 
53
                 PangoliteGlyphString *glyphs)
 
54
{
 
55
  if (analysis->shape_engine)
 
56
    analysis->shape_engine->script_shape(analysis->fontCharset, text, length, 
 
57
                                         analysis, glyphs);
 
58
  else {
 
59
    pangolite_glyph_string_set_size (glyphs, 1);
 
60
    
 
61
    glyphs->glyphs[0].glyph = 0;
 
62
    glyphs->log_clusters[0] = 0;
 
63
  }
 
64
  
 
65
  g_assert (glyphs->num_glyphs > 0);
 
66
}