| 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 |
This program is free software; you can redistribute it and/or modify |
| 7 |
it under the terms of the GNU General Public License as published by |
| 8 |
the Free Software Foundation; either version 2 of the License, or |
| 9 |
(at your option) any later version. |
| 10 |
|
| 11 |
This program is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
GNU General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU General Public License |
| 17 |
along with this program; if not, write to the Free Software |
| 18 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef _TT_GSUB_H_ |
| 22 |
#define _TT_GSUB_H_ |
| 23 |
|
| 24 |
#include "sfnt.h" |
| 25 |
#include "otl_opt.h" |
| 26 |
#include "cmap.h" |
| 27 |
|
| 28 |
typedef struct otl_gsub otl_gsub; |
| 29 |
|
| 30 |
/* LookupType for GSUB */ |
| 31 |
#define OTL_GSUB_TYPE_SINGLE 1 |
| 32 |
#define OTL_GSUB_TYPE_MULTIPLE 2 |
| 33 |
#define OTL_GSUB_TYPE_ALTERNATE 3 |
| 34 |
#define OTL_GSUB_TYPE_LIGATURE 4 |
| 35 |
#define OTL_GSUB_TYPE_CONTEXT 5 |
| 36 |
#define OTL_GSUB_TYPE_CCONTEXT 6 |
| 37 |
#define OTL_GSUB_TYPE_ESUBST 7 |
| 38 |
|
| 39 |
extern otl_gsub *otl_gsub_new (void); |
| 40 |
extern void otl_gsub_release (otl_gsub *gsub_list); |
| 41 |
|
| 42 |
extern int otl_gsub_select (otl_gsub *gsub_list, |
| 43 |
const char *script, |
| 44 |
const char *language, |
| 45 |
const char *feature); |
| 46 |
extern int otl_gsub_add_feat (otl_gsub *gsub_list, |
| 47 |
const char *script, |
| 48 |
const char *language, |
| 49 |
const char *feature, |
| 50 |
sfnt *sfont); |
| 51 |
extern int otl_gsub_apply (otl_gsub *gsub_list, USHORT *gid); |
| 52 |
extern int otl_gsub_apply_alt (otl_gsub *gsub_list, USHORT alt_idx, USHORT *gid); |
| 53 |
extern int otl_gsub_apply_lig (otl_gsub *gsub_list, |
| 54 |
USHORT *gid_in, USHORT num_gids, |
| 55 |
USHORT *gid_out); |
| 56 |
|
| 57 |
/* Handle a list of OTL features */ |
| 58 |
extern int otl_gsub_add_feat_list (otl_gsub *gsub_list, |
| 59 |
const char *otl_tags, sfnt *sfont); |
| 60 |
extern int otl_gsub_set_chain (otl_gsub *gsub_list, const char *otl_tags); |
| 61 |
extern int otl_gsub_apply_chain (otl_gsub *gsub_list, USHORT *gid); |
| 62 |
|
| 63 |
extern int otl_gsub_add_ToUnicode (CMap *cmap, char *used_chars, |
| 64 |
int32_t *map_base, int32_t *map_sub, USHORT num_glyphs, |
| 65 |
uint16_t *GIDToCIDMap, sfnt *sfont); |
| 66 |
#endif /* _TT_GSUB_H_ */ |