Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2009 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * Contributor(s): Blender Foundation. 00022 * 00023 * ***** END GPL LICENSE BLOCK ***** 00024 */ 00025 00031 #ifndef BLF_INTERNAL_H 00032 #define BLF_INTERNAL_H 00033 00034 struct FontBLF; 00035 struct GlyphBLF; 00036 struct GlyphCacheBLF; 00037 struct rctf; 00038 00039 unsigned int blf_next_p2(unsigned int x); 00040 unsigned int blf_hash(unsigned int val); 00041 00042 char *blf_dir_search(const char *file); 00043 char *blf_dir_metrics_search(const char *filename); 00044 // int blf_dir_split(const char *str, char *file, int *size); // UNUSED 00045 00046 int blf_font_init(void); 00047 void blf_font_exit(void); 00048 00049 struct FontBLF *blf_font_new(const char *name, const char *filename); 00050 struct FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size); 00051 void blf_font_attach_from_mem(struct FontBLF *font, const unsigned char *mem, int mem_size); 00052 00053 void blf_font_size(struct FontBLF *font, int size, int dpi); 00054 void blf_font_draw(struct FontBLF *font, const char *str, unsigned int len); 00055 void blf_font_draw_ascii(struct FontBLF *font, const char *str, unsigned int len); 00056 void blf_font_buffer(struct FontBLF *font, const char *str); 00057 void blf_font_boundbox(struct FontBLF *font, const char *str, struct rctf *box); 00058 void blf_font_width_and_height(struct FontBLF *font, const char *str, float *width, float *height); 00059 float blf_font_width(struct FontBLF *font, const char *str); 00060 float blf_font_height(struct FontBLF *font, const char *str); 00061 float blf_font_fixed_width(struct FontBLF *font); 00062 void blf_font_free(struct FontBLF *font); 00063 00064 struct GlyphCacheBLF *blf_glyph_cache_find(struct FontBLF *font, int size, int dpi); 00065 struct GlyphCacheBLF *blf_glyph_cache_new(struct FontBLF *font); 00066 void blf_glyph_cache_clear(struct FontBLF *font); 00067 void blf_glyph_cache_free(struct GlyphCacheBLF *gc); 00068 00069 struct GlyphBLF *blf_glyph_search(struct GlyphCacheBLF *gc, unsigned int c); 00070 struct GlyphBLF *blf_glyph_add(struct FontBLF *font, unsigned int index, unsigned int c); 00071 00072 void blf_glyph_free(struct GlyphBLF *g); 00073 int blf_glyph_render(struct FontBLF *font, struct GlyphBLF *g, float x, float y); 00074 00075 #endif /* BLF_INTERNAL_H */