home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libwmf / font.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-02-16  |  3.5 KB  |  137 lines

  1. /* libwmf (<libwmf/font.h>): library for wmf conversion
  2.    Copyright (C) 2001 Francis James Franklin
  3.  
  4.    The libwmf Library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public License as
  6.    published by the Free Software Foundation; either version 2 of the
  7.    License, or (at your option) any later version.
  8.  
  9.    The libwmf Library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public
  15.    License along with the libwmf Library; see the file COPYING.  If not,
  16.    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.    Boston, MA 02111-1307, USA.  */
  18.  
  19.  
  20. #ifndef LIBWMF_FONT_H
  21. #define LIBWMF_FONT_H
  22.  
  23. #include <libwmf/ipa.h>
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. typedef struct _wmfFT_Mapping          wmfFT_Mapping;
  30. typedef struct _wmfFT_CacheEntry       wmfFT_CacheEntry;
  31.  
  32. typedef struct _wmfGS_FontData         wmfGS_FontData;
  33. typedef struct _wmfGS_FontInfo         wmfGS_FontInfo;
  34.  
  35. typedef struct _wmfXML_FontData        wmfXML_FontData;
  36. typedef struct _wmfXML_FontInfo        wmfXML_FontInfo;
  37.  
  38. typedef struct _wmfFontmapData         wmfFontmapData;
  39.  
  40. typedef struct _wmfIPAFont             wmfIPAFont;
  41.  
  42. typedef void  (*wmfCharDrawer)  (wmfAPI*,wmfDrawText_t*);
  43.  
  44. extern void  wmf_ipa_font_init (wmfAPI*,wmfAPI_Options*);
  45. extern void  wmf_ipa_font_map_gs (wmfAPI*,wmfGS_FontData*,char*);
  46. extern void  wmf_ipa_font_map_xml (wmfAPI*,wmfXML_FontData*,char*);
  47. extern void  wmf_ipa_font_map_set (wmfAPI*,wmfMap);
  48. extern void  wmf_ipa_font_map (wmfAPI*,wmfFont*);
  49. extern void  wmf_ipa_font_dir (wmfAPI*,char*);
  50. extern float wmf_ipa_font_stringwidth (wmfAPI*,wmfFont*,char*);
  51. extern char* wmf_ipa_font_lookup (wmfAPI*,char*);
  52.  
  53. extern void wmf_ipa_draw_text (wmfAPI*,wmfDrawText_t*,wmfCharDrawer);
  54.  
  55. struct _wmfFT_Mapping
  56. {    char* name;
  57.     char* mapping;
  58.  
  59.     FT_Encoding encoding;
  60.     FT_Face     face;
  61. };
  62.  
  63. struct _wmfFT_CacheEntry
  64. {    char* name;
  65.     char* path;
  66.  
  67.     FT_Face face;
  68. };
  69.  
  70. struct _wmfGS_FontData
  71. {    unsigned int max;
  72.     unsigned int len;
  73.  
  74.     wmfGS_FontInfo* FI;
  75. };
  76.  
  77. struct _wmfGS_FontInfo
  78. {    char* name;
  79.     char* alias;
  80. };
  81.  
  82. struct _wmfXML_FontData
  83. {    unsigned int max;
  84.     unsigned int len;
  85.  
  86.     wmfXML_FontInfo* FI;
  87. };
  88.  
  89. struct _wmfXML_FontInfo
  90. {    char* format;
  91.     char* metrics;
  92.     char* glyphs;
  93.     char* name;
  94.     char* fullname;
  95.     char* familyname;
  96.     char* weight;
  97.     char* version;
  98.     char* alias;
  99. };
  100.  
  101. struct _wmfFontmapData
  102. {    char** fontdirs;
  103.  
  104.     wmfFontMap*    wmf; /* {0,*}-terminated list: wmf-font-name -> ps-font-name */
  105.     wmfMapping*    sub; /* {0,*}-terminated list: wmf-font-name substring equiv */
  106.     wmfFT_Mapping* ps;  /* {0,*}-terminated list: ps-font-name -> pfb-file-root */
  107.  
  108.     wmfFT_CacheEntry* cache; /* {0,*}-terminated list: path / font-face cache */
  109.  
  110.     wmfGS_FontData  GS; /* structure for ghostscript font info */
  111.     wmfXML_FontData FD; /* structure for system font info */
  112.  
  113.     FT_Library Library;
  114. };
  115.  
  116. struct _wmfIPAFont
  117. {    char* ps_name;
  118.  
  119.     FT_Face ft_face;
  120. };
  121.  
  122. /**
  123.  * WMF_FONT_PSNAME(wmfFont* F) -> (char*) font name to use in postscript output
  124.  */
  125. #define WMF_FONT_PSNAME(F)      ((F)->user_data ? ((wmfIPAFont*) (F)->user_data)->ps_name : 0)
  126.  
  127. /**
  128.  * WMF_FONT_FTFACE(wmfFont* F) -> (FT_Face) freetype(2) font face
  129.  */
  130. #define WMF_FONT_FTFACE(F)      ((F)->user_data ? ((wmfIPAFont*) (F)->user_data)->ft_face : 0)
  131.  
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135.  
  136. #endif /* ! LIBWMF_FONT_H */
  137.