~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to PsychSourceGL/Cohorts/FTGLTextRenderer/FTGL/FTGLPolygonFont.h

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * FTGL - OpenGL font library
 
3
 *
 
4
 * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
 
5
 * Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
 
6
 * Copyright (c) 2008 Sean Morrison <learner@brlcad.org>
 
7
 *
 
8
 * Permission is hereby granted, free of charge, to any person obtaining
 
9
 * a copy of this software and associated documentation files (the
 
10
 * "Software"), to deal in the Software without restriction, including
 
11
 * without limitation the rights to use, copy, modify, merge, publish,
 
12
 * distribute, sublicense, and/or sell copies of the Software, and to
 
13
 * permit persons to whom the Software is furnished to do so, subject to
 
14
 * the following conditions:
 
15
 *
 
16
 * The above copyright notice and this permission notice shall be
 
17
 * included in all copies or substantial portions of the Software.
 
18
 *
 
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
20
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
21
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
22
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 
23
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 
24
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 
25
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
26
 */
 
27
 
 
28
#ifndef __ftgl__
 
29
#   warning This header is deprecated. Please use <FTGL/ftgl.h> from now.
 
30
#   include <FTGL/ftgl.h>
 
31
#endif
 
32
 
 
33
#ifndef __FTPolygonFont__
 
34
#define __FTPolygonFont__
 
35
 
 
36
#ifdef __cplusplus
 
37
 
 
38
 
 
39
/**
 
40
 * FTPolygonFont is a specialisation of the FTFont class for handling
 
41
 * tesselated Polygon Mesh fonts
 
42
 *
 
43
 * @see     FTFont
 
44
 */
 
45
class FTGL_EXPORT FTPolygonFont : public FTFont
 
46
{
 
47
    public:
 
48
        /**
 
49
         * Open and read a font file. Sets Error flag.
 
50
         *
 
51
         * @param fontFilePath  font file path.
 
52
         */
 
53
        FTPolygonFont(const char* fontFilePath);
 
54
 
 
55
        /**
 
56
         * Open and read a font from a buffer in memory. Sets Error flag.
 
57
         * The buffer is owned by the client and is NOT copied by FTGL. The
 
58
         * pointer must be valid while using FTGL.
 
59
         *
 
60
         * @param pBufferBytes  the in-memory buffer
 
61
         * @param bufferSizeInBytes  the length of the buffer in bytes
 
62
         */
 
63
        FTPolygonFont(const unsigned char *pBufferBytes,
 
64
                      size_t bufferSizeInBytes);
 
65
 
 
66
        /**
 
67
         * Destructor
 
68
         */
 
69
        ~FTPolygonFont();
 
70
 
 
71
    protected:
 
72
        /**
 
73
         * Construct a glyph of the correct type.
 
74
         *
 
75
         * Clients must override the function and return their specialised
 
76
         * FTGlyph.
 
77
         *
 
78
         * @param slot  A FreeType glyph slot.
 
79
         * @return  An FT****Glyph or <code>null</code> on failure.
 
80
         */
 
81
        virtual FTGlyph* MakeGlyph(FT_GlyphSlot slot);
 
82
};
 
83
 
 
84
#define FTGLPolygonFont FTPolygonFont
 
85
 
 
86
#endif //__cplusplus
 
87
 
 
88
FTGL_BEGIN_C_DECLS
 
89
 
 
90
/**
 
91
 * Create a specialised FTGLfont object for handling tesselated polygon
 
92
 * mesh fonts.
 
93
 *
 
94
 * @param file  The font file name.
 
95
 * @return  An FTGLfont* object.
 
96
 *
 
97
 * @see  FTGLfont
 
98
 */
 
99
FTGL_EXPORT FTGLfont *ftglCreatePolygonFont(const char *file);
 
100
 
 
101
FTGL_END_C_DECLS
 
102
 
 
103
#endif  //  __FTPolygonFont__
 
104