Haru Free PDF Library
hpdf_font.h
Go to the documentation of this file.
1 /*
2  * << Haru Free PDF Library >> -- hpdf_font.h
3  *
4  * URL: http://libharu.org
5  *
6  * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
7  * Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
8  *
9  * Permission to use, copy, modify, distribute and sell this software
10  * and its documentation for any purpose is hereby granted without fee,
11  * provided that the above copyright notice appear in all copies and
12  * that both that copyright notice and this permission notice appear
13  * in supporting documentation.
14  * It is provided "as is" without express or implied warranty.
15  *
16  */
17 
18 #ifndef _HPDF_FONT_H
19 #define _HPDF_FONT_H
20 
21 #include "hpdf_fontdef.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 
28 /*----------------------------------------------------------------------------*/
29 /*----- Writing Mode ---------------------------------------------------------*/
30 
31 typedef enum _HPDF_FontType {
41 
42 
44 
45 
48  const HPDF_BYTE *text,
49  HPDF_UINT len);
50 
51 
52 typedef HPDF_UINT
54  const HPDF_BYTE *text,
55  HPDF_UINT len,
56  HPDF_REAL width,
57  HPDF_REAL fontsize,
58  HPDF_REAL charspace,
59  HPDF_REAL wordspace,
60  HPDF_BOOL wordwrap,
61  HPDF_REAL *real_width);
62 
63 
65 
66 typedef struct _HPDF_FontAttr_Rec {
73 
74  /* if the encoding-type is HPDF_ENCODER_TYPE_SINGLE_BYTE, the width of
75  * each characters are cashed in 'widths'.
76  * when HPDF_ENCODER_TYPE_DOUBLE_BYTE the width is calculate each time.
77  */
80 
86 
87 
90  HPDF_FontDef fontdef,
91  HPDF_Encoder encoder,
92  HPDF_Xref xref);
93 
96  HPDF_FontDef fontdef,
97  HPDF_Encoder encoder,
98  HPDF_Xref xref);
99 
100 HPDF_Font
102  HPDF_FontDef fontdef,
103  HPDF_Encoder encoder,
104  HPDF_Xref xref);
105 
106 
107 HPDF_BOOL
109 
110 #ifdef __cplusplus
111 }
112 #endif /* __cplusplus */
113 
114 #endif /* _HPDF_FONT_H */
115 
struct _HPDF_FontAttr_Rec HPDF_FontAttr_Rec
HPDF_BOOL HPDF_Font_Validate(HPDF_Font font)
HPDF_Font HPDF_Type0Font_New(HPDF_MMgr mmgr, HPDF_FontDef fontdef, HPDF_Encoder encoder, HPDF_Xref xref)
HPDF_TextWidth(* HPDF_Font_TextWidths_Func)(HPDF_Font font, const HPDF_BYTE *text, HPDF_UINT len)
Definition: hpdf_font.h:47
struct _HPDF_FontAttr_Rec * HPDF_FontAttr
Definition: hpdf_font.h:64
HPDF_UINT(* HPDF_Font_MeasureText_Func)(HPDF_Font font, const HPDF_BYTE *text, HPDF_UINT len, HPDF_REAL width, HPDF_REAL fontsize, HPDF_REAL charspace, HPDF_REAL wordspace, HPDF_BOOL wordwrap, HPDF_REAL *real_width)
Definition: hpdf_font.h:53
HPDF_Font HPDF_Type1Font_New(HPDF_MMgr mmgr, HPDF_FontDef fontdef, HPDF_Encoder encoder, HPDF_Xref xref)
HPDF_Font HPDF_TTFont_New(HPDF_MMgr mmgr, HPDF_FontDef fontdef, HPDF_Encoder encoder, HPDF_Xref xref)
HPDF_Dict HPDF_Font
Definition: hpdf_font.h:43
enum _HPDF_FontType HPDF_FontType
_HPDF_FontType
Definition: hpdf_font.h:31
@ HPDF_FONT_MMTYPE1
Definition: hpdf_font.h:39
@ HPDF_FONT_CID_TYPE0
Definition: hpdf_font.h:37
@ HPDF_FONT_TRUETYPE
Definition: hpdf_font.h:33
@ HPDF_FONT_CID_TYPE2
Definition: hpdf_font.h:38
@ HPDF_FONT_TYPE0_TT
Definition: hpdf_font.h:36
@ HPDF_FONT_TYPE0_CID
Definition: hpdf_font.h:35
@ HPDF_FONT_TYPE3
Definition: hpdf_font.h:34
@ HPDF_FONT_TYPE1
Definition: hpdf_font.h:32
signed int HPDF_BOOL
Definition: hpdf_types.h:89
unsigned int HPDF_UINT
Definition: hpdf_types.h:45
float HPDF_REAL
Definition: hpdf_types.h:79
unsigned char HPDF_BYTE
Definition: hpdf_types.h:74
struct _HPDF_TextWidth HPDF_TextWidth
signed short HPDF_INT16
Definition: hpdf_types.h:62
enum _HPDF_WritingMode HPDF_WritingMode
Definition: hpdf_objects.h:421
Definition: hpdf_encoder.h:115
Definition: hpdf_font.h:66
HPDF_Dict map_stream
Definition: hpdf_font.h:83
HPDF_Font descendant_font
Definition: hpdf_font.h:82
HPDF_Xref xref
Definition: hpdf_font.h:81
HPDF_Font_MeasureText_Func measure_text_fn
Definition: hpdf_font.h:70
HPDF_WritingMode writing_mode
Definition: hpdf_font.h:68
HPDF_FontDef fontdef
Definition: hpdf_font.h:71
HPDF_Font_TextWidths_Func text_width_fn
Definition: hpdf_font.h:69
HPDF_Dict cmap_stream
Definition: hpdf_font.h:84
HPDF_INT16 * widths
Definition: hpdf_font.h:78
HPDF_FontType type
Definition: hpdf_font.h:67
HPDF_Encoder encoder
Definition: hpdf_font.h:72
HPDF_BYTE * used
Definition: hpdf_font.h:79
Definition: hpdf_fontdef.h:87
Definition: hpdf_mmgr.h:40
Definition: hpdf_objects.h:542