| 1 |
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. |
| 2 |
|
| 3 |
Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata, |
| 4 |
the dvipdfmx project team. |
| 5 |
|
| 6 |
Copyright (C) 1998, 1999 by Mark A. Wicks <[email protected]> |
| 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 _FONTMAP_H_ |
| 24 |
#define _FONTMAP_H_ |
| 25 |
|
| 26 |
#define FONTMAP_RMODE_REPLACE 0 |
| 27 |
#define FONTMAP_RMODE_APPEND '+' |
| 28 |
#define FONTMAP_RMODE_REMOVE '-' |
| 29 |
|
| 30 |
#define FONTMAP_OPT_NOEMBED (1 << 1) |
| 31 |
#define FONTMAP_OPT_VERT (1 << 2) |
| 32 |
|
| 33 |
#define FONTMAP_STYLE_NONE 0 |
| 34 |
#define FONTMAP_STYLE_BOLD 1 |
| 35 |
#define FONTMAP_STYLE_ITALIC 2 |
| 36 |
#define FONTMAP_STYLE_BOLDITALIC 3 |
| 37 |
|
| 38 |
/* Options */ |
| 39 |
typedef struct fontmap_opt { |
| 40 |
/* Synthetic font */ |
| 41 |
double slant, extend, bold; |
| 42 |
/* comaptibility and other flags */ |
| 43 |
int mapc, flags; |
| 44 |
|
| 45 |
char *otl_tags; |
| 46 |
char *tounicode; /* not implemented yet */ |
| 47 |
|
| 48 |
double design_size; /* unused */ |
| 49 |
|
| 50 |
char *charcoll; /* Adobe-Japan1-4, etc. */ |
| 51 |
uint32_t index; /* TTC index */ |
| 52 |
int style; /* ,Bold, etc. */ |
| 53 |
int stemv; /* StemV value especially for CJK fonts */ |
| 54 |
int use_glyph_encoding; /* XeTeX support */ |
| 55 |
} fontmap_opt; |
| 56 |
|
| 57 |
typedef struct fontmap_rec { |
| 58 |
char *map_name; |
| 59 |
|
| 60 |
char *font_name; |
| 61 |
char *enc_name; |
| 62 |
|
| 63 |
/* Subfont mapping: translate 8-bit charcode to 16-bit charcode |
| 64 |
* via SFD. |
| 65 |
*/ |
| 66 |
struct { |
| 67 |
char *sfd_name; |
| 68 |
char *subfont_id; |
| 69 |
} charmap; |
| 70 |
|
| 71 |
fontmap_opt opt; |
| 72 |
} fontmap_rec; |
| 73 |
|
| 74 |
extern void pdf_init_fontmaps (void); |
| 75 |
#if 0 |
| 76 |
extern void pdf_clear_fontmaps (void); |
| 77 |
#endif |
| 78 |
extern void pdf_close_fontmaps (void); |
| 79 |
|
| 80 |
extern void pdf_init_fontmap_record (fontmap_rec *mrec); |
| 81 |
extern void pdf_clear_fontmap_record (fontmap_rec *mrec); |
| 82 |
|
| 83 |
extern int pdf_load_fontmap_file (const char *filename, int mode); |
| 84 |
extern int pdf_read_fontmap_line (fontmap_rec *mrec, const char *mline, int mline_strlen, int format); |
| 85 |
|
| 86 |
extern int pdf_append_fontmap_record (const char *kp, const fontmap_rec *mrec); |
| 87 |
extern int pdf_remove_fontmap_record (const char *kp); |
| 88 |
extern fontmap_rec *pdf_insert_fontmap_record (const char *kp, const fontmap_rec *mrec); |
| 89 |
extern fontmap_rec *pdf_lookup_fontmap_record (const char *kp); |
| 90 |
|
| 91 |
extern int is_pdfm_mapline (const char *mline); |
| 92 |
|
| 93 |
extern fontmap_rec *pdf_insert_native_fontmap_record (const char *filename, uint32_t index, |
| 94 |
int layout_dir, int extend, int slant, int embolden); |
| 95 |
|
| 96 |
#endif /* _FONTMAP_H_ */ |