Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:15:00

0001 /*
0002  * FTGL - OpenGL font library
0003  *
0004  * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
0005  * Copyright (c) 2008 Sam Hocevar <sam@hocevar.net>
0006  * Copyright (c) 2008 Sean Morrison <learner@brlcad.org>
0007  *
0008  * Permission is hereby granted, free of charge, to any person obtaining
0009  * a copy of this software and associated documentation files (the
0010  * "Software"), to deal in the Software without restriction, including
0011  * without limitation the rights to use, copy, modify, merge, publish,
0012  * distribute, sublicense, and/or sell copies of the Software, and to
0013  * permit persons to whom the Software is furnished to do so, subject to
0014  * the following conditions:
0015  *
0016  * The above copyright notice and this permission notice shall be
0017  * included in all copies or substantial portions of the Software.
0018  *
0019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0020  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0021  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
0022  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
0023  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
0024  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
0025  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0026  */
0027 
0028 #ifndef __ftgl__
0029 #   warning This header is deprecated. Please use <FTGL/ftgl.h> from now.
0030 #   include <FTGL/ftgl.h>
0031 #endif
0032 
0033 #ifndef __FTExtrudeFont__
0034 #define __FTExtrudeFont__
0035 
0036 #ifdef __cplusplus
0037 
0038 
0039 /**
0040  * FTExtrudeFont is a specialisation of the FTFont class for handling
0041  * extruded Polygon fonts
0042  *
0043  * @see FTFont
0044  * @see FTPolygonFont
0045  */
0046 class FTGL_EXPORT FTExtrudeFont : public FTFont
0047 {
0048     public:
0049         /**
0050          * Open and read a font file. Sets Error flag.
0051          *
0052          * @param fontFilePath  font file path.
0053          */
0054         FTExtrudeFont(const char* fontFilePath);
0055 
0056         /**
0057          * Open and read a font from a buffer in memory. Sets Error flag.
0058          * The buffer is owned by the client and is NOT copied by FTGL. The
0059          * pointer must be valid while using FTGL.
0060          *
0061          * @param pBufferBytes  the in-memory buffer
0062          * @param bufferSizeInBytes  the length of the buffer in bytes
0063          */
0064         FTExtrudeFont(const unsigned char *pBufferBytes,
0065                       size_t bufferSizeInBytes);
0066 
0067         /**
0068          * Destructor
0069          */
0070         ~FTExtrudeFont();
0071 
0072     protected:
0073         /**
0074          * Construct a glyph of the correct type.
0075          *
0076          * Clients must override the function and return their specialised
0077          * FTGlyph.
0078          *
0079          * @param slot  A FreeType glyph slot.
0080          * @return  An FT****Glyph or <code>null</code> on failure.
0081          */
0082         virtual FTGlyph* MakeGlyph(FT_GlyphSlot slot);
0083 };
0084 
0085 #define FTGLExtrdFont FTExtrudeFont
0086 
0087 #endif //__cplusplus
0088 
0089 FTGL_BEGIN_C_DECLS
0090 
0091 /**
0092  * Create a specialised FTGLfont object for handling extruded polygon fonts.
0093  *
0094  * @param file  The font file name.
0095  * @return  An FTGLfont* object.
0096  *
0097  * @see  FTGLfont
0098  * @see  ftglCreatePolygonFont
0099  */
0100 FTGL_EXPORT FTGLfont *ftglCreateExtrudeFont(const char *file);
0101 
0102 /**
0103  * Create a specialised FTGLfont object for handling extruded polygon fonts
0104  * from a buffer in memory. Sets Error flag. The buffer is owned by the client
0105  * and is NOT copied by FTGL. The pointer must be valid while using FTGL.
0106  *
0107  * @param bytes  the in-memory buffer
0108  * @param len  the length of the buffer in bytes
0109  * @return  An FTGLfont* object.
0110  */
0111 FTGL_EXPORT FTGLfont *ftglCreateExtrudeFontFromMem(const unsigned char *bytes,
0112                                                    size_t len);
0113 
0114 FTGL_END_C_DECLS
0115 
0116 #endif // __FTExtrudeFont__
0117