/*************************************************************************** font-parser.cpp (c) 2004-2006 - Daniel Campos Fernández Gtkmae "GTK+ made easy" classes Realizado para la Junta de Extremadura. Consejería de Educación Ciencia y Tecnología. Proyecto gnuLinEx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ #include #include #ifndef TRUE #define TRUE -1 #endif #ifndef FALSE #define FALSE 0 #endif static char *gb_font_pointers[8]; static char *gb_font_name; static int gb_font_strikeout; static int gb_font_underline; static int gb_font_italic; static int gb_font_bold; static int gb_font_size; static int gb_font_relative; int gb_fontparser_italic() { return gb_font_italic; } int gb_fontparser_bold() { return gb_font_bold; } int gb_fontparser_underline() { return gb_font_underline; } int gb_fontparser_strikeout() { return gb_font_strikeout; } int gb_fontparser_relative() { return gb_font_relative; } int gb_fontparser_size() { return gb_font_size; } char* gb_fontparser_name() { return gb_font_name; } void gb_font_trim() { int bc,lenptr; char *ptr; for (bc=0;bc<8;bc++) { if (gb_font_pointers[bc]==NULL) return; ptr=gb_font_pointers[bc]; while (ptr[0]==' ') { if (ptr[0]==0) break; if (ptr[0]==' ') gb_font_pointers[bc]++; ptr++; } lenptr=strlen(gb_font_pointers[bc])-1; ptr=gb_font_pointers[bc]; while (lenptr>=0) { if (ptr[lenptr]==' ') { ptr[lenptr]=0; } else { lenptr=0; } lenptr--; } } } int gb_font_is_size(char *str) { long bc,max; int rel=FALSE; int vl=0; int fact=1; if (!str) return TRUE; max=strlen(str); for(bc=0;bc