00001 //======================================================================== 00002 // 00003 // BuiltinFont.h 00004 // 00005 // Copyright 2001-2003 Glyph & Cog, LLC 00006 // 00007 //======================================================================== 00008 00009 #ifndef BUILTINFONT_H 00010 #define BUILTINFONT_H 00011 00012 #include <aconf.h> 00013 00014 #ifdef USE_GCC_PRAGMAS 00015 #pragma interface 00016 #endif 00017 00018 #include "gtypes.h" 00019 00020 struct BuiltinFont; 00021 class BuiltinFontWidths; 00022 00023 //------------------------------------------------------------------------ 00024 00025 struct BuiltinFont { 00026 char *name; 00027 char **defaultBaseEnc; 00028 short ascent; 00029 short descent; 00030 short bbox[4]; 00031 BuiltinFontWidths *widths; 00032 }; 00033 00034 //------------------------------------------------------------------------ 00035 00036 struct BuiltinFontWidth { 00037 char *name; 00038 Gushort width; 00039 BuiltinFontWidth *next; 00040 }; 00041 00042 class BuiltinFontWidths { 00043 public: 00044 00045 BuiltinFontWidths(BuiltinFontWidth *widths, int sizeA); 00046 ~BuiltinFontWidths(); 00047 GBool getWidth(char *name, Gushort *width); 00048 00049 private: 00050 00051 int hash(char *name); 00052 00053 BuiltinFontWidth **tab; 00054 int size; 00055 }; 00056 00057 #endif