1 #ifndef COIN_FLW_H
2 #define COIN_FLW_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 /*
37   FLW is a Font Library Wrapper abstraction designed to allow any
38   number of underlying font libraries to be used through the same API.
39 
40   Functions and datatypes are loosely modeled on the FreeType font
41   library.
42 
43   Which underlying font library to use is currently determined at
44   compile time.
45 */
46 
47 /* ********************************************************************** */
48 
49 #ifndef COIN_INTERNAL
50 #error this is a private header file
51 #endif /* ! COIN_INTERNAL */
52 
53 /* ********************************************************************** */
54 
55 #include <Inventor/C/tidbits.h>
56 #include <Inventor/C/base/string.h>
57 #include <Inventor/C/base/list.h>
58 #include "fontspec.h"
59 
60 #include "common.h"
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66   void cc_flw_ref_font(int fontid);
67   void cc_flw_unref_font(int fontid);
68 
69   int cc_flw_get_font_id(const char * fontname, unsigned int sizey,
70                          float angle, float complexity);
71 
72   unsigned int cc_flw_get_glyph(int font, unsigned int charidx);
73   void cc_flw_done_glyph(int font, unsigned int glyphidx);
74 
75   struct cc_font_bitmap * cc_flw_get_bitmap(int font, unsigned int glyph);
76   struct cc_font_vector_glyph * cc_flw_get_vector_glyph(int font, unsigned int glyph);
77 
78   const float * cc_flw_get_vector_glyph_coords(struct cc_font_vector_glyph * vecglyph);
79   const int * cc_flw_get_vector_glyph_faceidx(struct cc_font_vector_glyph * vecglyph);
80   const int * cc_flw_get_vector_glyph_edgeidx(struct cc_font_vector_glyph * vecglyph);
81 
82   void cc_flw_get_bitmap_advance(int font, unsigned int glyph, int * x, int * y);
83   void cc_flw_get_bitmap_kerning(int font, unsigned int glyph1, unsigned int glyph2, int * x, int * y);
84 
85   void cc_flw_get_vector_advance(int font, unsigned int glyph, float * x, float * y);
86   void cc_flw_get_vector_kerning(int font, unsigned int glyph1, unsigned int glyph2, float * x, float * y);
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* !COIN_FLW_H */
93