forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hpdf_fontdef.c
59 lines (48 loc) · 1.36 KB
/
hpdf_fontdef.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* << Haru Free PDF Library >> -- hpdf_fontdef.c
*
* URL: http://libharu.org
*
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
* It is provided "as is" without express or implied warranty.
*
*/
#include "hpdf_conf.h"
#include "hpdf_utils.h"
#include "hpdf_fontdef.h"
void
HPDF_FontDef_Cleanup (HPDF_FontDef fontdef)
{
if (!fontdef)
return;
HPDF_PTRACE ((" HPDF_FontDef_Cleanup\n"));
if (fontdef->clean_fn)
fontdef->clean_fn (fontdef);
fontdef->descriptor = NULL;
}
void
HPDF_FontDef_Free (HPDF_FontDef fontdef)
{
if (!fontdef)
return;
HPDF_PTRACE ((" HPDF_FontDef_Free\n"));
if (fontdef->free_fn)
fontdef->free_fn (fontdef);
HPDF_FreeMem (fontdef->mmgr, fontdef);
}
HPDF_BOOL
HPDF_FontDef_Validate (HPDF_FontDef fontdef)
{
HPDF_PTRACE ((" HPDF_FontDef_Validate\n"));
if (!fontdef || fontdef->sig_bytes != HPDF_FONTDEF_SIG_BYTES)
return HPDF_FALSE;
else
return HPDF_TRUE;
}