root/trunk/orca/gl/res_font.h
| Revision 1, 2.0 kB (checked in by krobillard, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | #ifndef RES_FONT_H |
| 2 | #define RES_FONT_H |
| 3 | /*============================================================================ |
| 4 | Font Resource |
| 5 | Copyright (C) 2005 Karl Robillard |
| 6 | |
| 7 | This library is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation; either |
| 10 | version 2.1 of the License, or (at your option) any later version. |
| 11 | |
| 12 | This library is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with this library; if not, write to the Free Software |
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | ===========================================================================*/ |
| 21 | |
| 22 | |
| 23 | typedef struct |
| 24 | { |
| 25 | unsigned short c; /* Potentially support 16-bit glyphs. */ |
| 26 | unsigned char width; |
| 27 | unsigned char height; |
| 28 | signed char xoffset; |
| 29 | signed char yoffset; |
| 30 | signed char advance; |
| 31 | char dummy; /* Space holder for alignment reasons. */ |
| 32 | short x; |
| 33 | short y; |
| 34 | short kern_index; |
| 35 | } |
| 36 | TexGlyphInfo; |
| 37 | |
| 38 | |
| 39 | typedef struct |
| 40 | { |
| 41 | short tex_width; |
| 42 | short tex_height; |
| 43 | short max_ascent; |
| 44 | short max_descent; |
| 45 | int num_glyphs; |
| 46 | TexGlyphInfo* tgi; |
| 47 | |
| 48 | short min_glyph; |
| 49 | short table_size; |
| 50 | TexGlyphInfo** table; |
| 51 | unsigned char* kerning; |
| 52 | } |
| 53 | TexFont; |
| 54 | |
| 55 | |
| 56 | typedef struct |
| 57 | { |
| 58 | Resource res; |
| 59 | //char* name; |
| 60 | OIndex imgHold; |
| 61 | GLuint glTexId; |
| 62 | TexFont tfont; |
| 63 | } |
| 64 | FontResource; |
| 65 | |
| 66 | |
| 67 | #ifdef __cplusplus |
| 68 | extern "C" { |
| 69 | #endif |
| 70 | |
| 71 | void makeTexfontNative( OValue* a1 ); |
| 72 | TexGlyphInfo* txf_glyph( const TexFont*, int c ); |
| 73 | int txf_kerning( const TexFont*, const TexGlyphInfo* left, |
| 74 | const TexGlyphInfo* right ); |
| 75 | |
| 76 | #ifdef __cplusplus |
| 77 | } |
| 78 | #endif |
| 79 | |
| 80 | |
| 81 | #endif /* RES_FONT_H */ |
Note: See TracBrowser
for help on using the browser.
