00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef liqfont_H
00026 #define liqfont_H
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 typedef struct
00033 {
00034
00035 int glyphindex;
00036 int glyphw;
00037 int glyphh;
00038 int glyphbaseline;
00039 char *glyphdata;
00040 } liqfontglyph;
00041
00042 liqfontglyph * liqfontglyph_alloc(int glyphindex,int width,int height);
00043
00044 void liqfontglyph_free(liqfontglyph *self);
00045
00046
00047
00048
00049
00050
00051
00052 typedef struct liqfont liqfont;
00053 typedef struct liqfontview liqfontview;
00054
00055 struct liqfontview
00056 {
00057 int usagecount;
00058 liqfont * font;
00059 float scalew;
00060 float scaleh;
00061 liqfontglyph *glyphbuffer[256];
00062 int pixelheight;
00063 void *ftface;
00064 };
00065
00066
00067
00068
00069
00070 liqfontview * liqfontview_newfromscale(liqfont *font,float scalew,float scaleh);
00071 liqfontview * liqfontview_new();
00072 liqfontview * liqfontview_hold(liqfontview *self);
00073 void liqfontview_release(liqfontview *self);
00074 void liqfontview_free(liqfontview *self);
00075 void liqfontview_close(liqfontview *self);
00076 liqfontglyph * liqfontview_getglyph(liqfontview *self,int glyphindex);
00077
00078
00079
00080
00081
00082
00083
00084
00085 struct liqfont
00086 {
00087 int usagecount;
00088 char * name;
00089 char * style;
00090 char * filename;
00091 int size;
00092 int rotation;
00093 liqfontview * viewcache[32];
00094 int viewcacheused;
00095 liqfontview * viewcachecurrent;
00096 };
00097
00098
00099 liqfont *liqfont_cache_getttf(char *name,int size,int rotation);
00100 void liqfont_cache_release(liqfont *self);
00101 liqfont * liqfont_newfromfilettf(char *name,int size,int rotation);
00102
00103 liqfont *liqfont_new();
00104 liqfont *liqfont_hold(liqfont *self);
00105 void liqfont_release(liqfont *self);
00106
00107 void liqfont_free(liqfont *self);
00108
00109 void liqfont_close(liqfont *self);
00110
00111
00112
00113 int liqfont_setview(liqfont *self,float scalew,float scaleh);
00114
00115 liqfontglyph *liqfont_getglyph(liqfont *self,int glyphindex);
00116 int liqfont_getglyphwidth(liqfont *self,int glyphindex);
00117
00118 int liqfont_textfitinside(liqfont *self,char *data,int availablewidth);
00119 int liqfont_textwidth(liqfont *self,char *data);
00120 int liqfont_textwidthn(liqfont *self,char *data,int datalen);
00121 int liqfont_textheight(liqfont *self);
00122
00123
00124 #ifdef __cplusplus
00125 }
00126 #endif
00127
00128 #endif