1 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. 2 3 Copyright (C) 2002-2014 by Jin-Hwan Cho and Shunsaku Hirata, 4 the dvipdfmx project team. 5 6 Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 21 */ 22 23 #ifndef _PDFFONT_H_ 24 #define _PDFFONT_H_ 25 26 #include "pdfobj.h" 27 #include "fontmap.h" 28 #include "pdflimits.h" 29 30 #define PDF_FONT_FONTTYPE_TYPE1 0 31 #define PDF_FONT_FONTTYPE_TYPE1C 1 32 #define PDF_FONT_FONTTYPE_TYPE3 2 33 #define PDF_FONT_FONTTYPE_TRUETYPE 3 34 35 #define PDF_FONT_FONTTYPE_TYPE0 4 36 37 extern void pdf_font_set_verbose (void); 38 extern int pdf_font_get_verbose (void); 39 40 extern void pdf_font_set_dpi (int font_dpi); 41 42 #define PDF_FONT_FLAG_NOEMBED (1 << 0) 43 #define PDF_FONT_FLAG_COMPOSITE (1 << 1) 44 #define PDF_FONT_FLAG_BASEFONT (1 << 2) 45 46 #define PDF_FONT_PARAM_DESIGN_SIZE 1 47 #define PDF_FONT_PARAM_POINT_SIZE 2 48 49 typedef struct pdf_font pdf_font; 50 51 /* pdf_open_document() call them. */ 52 extern void pdf_init_fonts (void); 53 extern void pdf_close_fonts (void); 54 55 /* font_name is used when mrec is NULL. 56 * font_scale (point size) used by PK font. 57 * It might be necessary if dvipdfmx supports font format with 58 * various optical sizes supported in the future. 59 */ 60 extern int pdf_font_findresource (const char *font_name, 61 double font_scale, fontmap_rec *mrec); 62 63 extern int pdf_get_font_subtype (int font_id); 64 extern pdf_obj *pdf_get_font_reference (int font_id); 65 extern char *pdf_get_font_usedchars (int font_id); 66 67 #if 0 68 extern char *pdf_get_font_fontname (int font_id); /* without unique tag */ 69 #endif /* 0 */ 70 extern int pdf_get_font_encoding (int font_id); 71 extern int pdf_get_font_wmode (int font_id); 72 73 /* Each font drivers use the followings. */ 74 extern int pdf_font_is_in_use (pdf_font *font); 75 76 extern char *pdf_font_get_ident (pdf_font *font); 77 extern char *pdf_font_get_mapname (pdf_font *font); 78 extern char *pdf_font_get_fontname (pdf_font *font); /* without unique tag */ 79 extern char *pdf_font_get_uniqueTag (pdf_font *font); 80 81 extern pdf_obj *pdf_font_get_resource (pdf_font *font); 82 extern pdf_obj *pdf_font_get_descriptor (pdf_font *font); 83 84 extern char *pdf_font_get_usedchars (pdf_font *font); 85 extern int pdf_font_get_encoding (pdf_font *font); 86 87 extern int pdf_font_get_flag (pdf_font *font, int mask); 88 #if 0 89 extern int pdf_font_get_flags (pdf_font *font); 90 #endif /* 0 */ 91 extern double pdf_font_get_param (pdf_font *font, int type); 92 93 extern int pdf_font_get_index (pdf_font *font); 94 95 extern int pdf_font_set_fontname (pdf_font *font, const char *fontname); 96 extern int pdf_font_set_flags (pdf_font *font, int flags); 97 extern int pdf_font_set_subtype (pdf_font *font, int subtype); 98 99 extern void pdf_font_make_uniqueTag (char *tag); 100 101 #endif /* _PDFFONT_H_ */ 102