2012-09-17 12:40:10 +00:00
|
|
|
/*
|
|
|
|
* ffw.h : Fontforge Wrapper
|
|
|
|
*
|
|
|
|
* Processing fonts using Fontforge
|
|
|
|
*
|
|
|
|
* fontforge.h cannot be included in C++
|
|
|
|
* So this wrapper in C publishes several functions we need
|
|
|
|
*
|
|
|
|
* by WangLu
|
|
|
|
* 2012.09.03
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <cstdint>
|
|
|
|
namespace pdf2htmlEX {
|
|
|
|
extern "C" {
|
|
|
|
#else
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
2012-10-08 08:26:19 +00:00
|
|
|
////////////////////////
|
|
|
|
// global
|
2012-09-17 12:40:10 +00:00
|
|
|
void ffw_init(int debug);
|
2012-10-08 08:26:19 +00:00
|
|
|
void ffw_finalize(void);
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// load & save
|
2012-09-17 12:40:10 +00:00
|
|
|
void ffw_load_font(const char * filename);
|
2012-10-06 11:20:35 +00:00
|
|
|
void ffw_prepare_font(void);
|
2012-10-08 08:26:19 +00:00
|
|
|
|
|
|
|
void ffw_save(const char * filename);
|
|
|
|
void ffw_close(void);
|
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// encoding
|
2012-09-17 12:40:10 +00:00
|
|
|
void ffw_reencode_glyph_order(void);
|
|
|
|
void ffw_reencode_raw(int32_t * mapping, int mapping_len, int force);
|
|
|
|
void ffw_reencode_raw2(char ** mapping, int mapping_len, int force);
|
2012-10-08 08:26:19 +00:00
|
|
|
|
2012-09-17 12:40:10 +00:00
|
|
|
void ffw_cidflatten(void);
|
2012-10-08 08:26:19 +00:00
|
|
|
// get or create the char, and set the width
|
|
|
|
void ffw_make_char(int enc, int width);
|
2012-09-17 12:40:10 +00:00
|
|
|
|
2012-10-08 08:26:19 +00:00
|
|
|
////////////////////////
|
|
|
|
// metrics
|
2012-09-23 17:55:35 +00:00
|
|
|
int ffw_get_em_size(void);
|
2012-09-17 12:40:10 +00:00
|
|
|
// fix metrics and get them
|
2012-09-23 17:55:35 +00:00
|
|
|
void ffw_metric(double * ascent, double * descent);
|
2012-09-20 05:24:16 +00:00
|
|
|
|
2012-10-05 15:38:17 +00:00
|
|
|
void ffw_set_widths(int * width_list, int mapping_len,
|
|
|
|
int stretch_narrow, int squeeze_wide,
|
|
|
|
int remove_unused);
|
2012-09-17 12:40:10 +00:00
|
|
|
|
2012-10-08 08:26:19 +00:00
|
|
|
////////////////////////
|
|
|
|
// others
|
2012-09-20 15:40:44 +00:00
|
|
|
void ffw_auto_hint(void);
|
|
|
|
|
2012-09-17 12:40:10 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|