2
* FTGL - OpenGL font library
4
* Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
6
* Permission is hereby granted, free of charge, to any person obtaining
7
* a copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation the rights to use, copy, modify, merge, publish,
10
* distribute, sublicense, and/or sell copies of the Software, and to
11
* permit persons to whom the Software is furnished to do so, subject to
12
* the following conditions:
14
* The above copyright notice and this permission notice shall be
15
* included in all copies or substantial portions of the Software.
17
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
# warning Please use <FTGL/ftgl.h> instead of <FTBufferFont.h>.
28
# include <FTGL/ftgl.h>
31
#ifndef __FTBufferFont__
32
#define __FTBufferFont__
38
* FTBufferFont is a specialisation of the FTFont class for handling
39
* memory buffer fonts.
43
class FTGL_EXPORT FTBufferFont : public FTFont
47
* Open and read a font file. Sets Error flag.
49
* @param fontFilePath font file path.
51
FTBufferFont(const char* fontFilePath);
54
* Open and read a font from a buffer in memory. Sets Error flag.
55
* The buffer is owned by the client and is NOT copied by FTGL. The
56
* pointer must be valid while using FTGL.
58
* @param pBufferBytes the in-memory buffer
59
* @param bufferSizeInBytes the length of the buffer in bytes
61
FTBufferFont(const unsigned char *pBufferBytes,
62
size_t bufferSizeInBytes);
71
* Construct a glyph of the correct type.
73
* Clients must override the function and return their specialised
76
* @param slot A FreeType glyph slot.
77
* @return An FT****Glyph or <code>null</code> on failure.
79
virtual FTGlyph* MakeGlyph(FT_GlyphSlot slot);
87
* Create a specialised FTGLfont object for handling memory buffer fonts.
89
* @param file The font file name.
90
* @return An FTGLfont* object.
94
FTGL_EXPORT FTGLfont *ftglCreateBufferFont(const char *file);
98
#endif // __FTBufferFont__