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