OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ftwinfnt.c */ | 3 /* ftwinfnt.c */ |
4 /* */ | 4 /* */ |
5 /* FreeType API for accessing Windows FNT specific info (body). */ | 5 /* FreeType API for accessing Windows FNT specific info (body). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2003, 2004 by */ | 7 /* Copyright 2003, 2004, 2014 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
18 | 18 |
19 #include "../../include/ft2build.h" | 19 #include <ft2build.h> |
20 #include "../../include/freetype/ftwinfnt.h" | 20 #include FT_INTERNAL_DEBUG_H |
21 #include "../../include/freetype/internal/ftobjs.h" | 21 #include FT_WINFONTS_H |
22 #include "../../include/freetype/internal/services/svwinfnt.h" | 22 #include FT_INTERNAL_OBJECTS_H |
| 23 #include FT_SERVICE_WINFNT_H |
23 | 24 |
24 | 25 |
25 /* documentation is in ftwinfnt.h */ | 26 /* documentation is in ftwinfnt.h */ |
26 | 27 |
27 FT_EXPORT_DEF( FT_Error ) | 28 FT_EXPORT_DEF( FT_Error ) |
28 FT_Get_WinFNT_Header( FT_Face face, | 29 FT_Get_WinFNT_Header( FT_Face face, |
29 FT_WinFNT_HeaderRec *header ) | 30 FT_WinFNT_HeaderRec *header ) |
30 { | 31 { |
31 FT_Service_WinFnt service; | 32 FT_Service_WinFnt service; |
32 FT_Error error; | 33 FT_Error error; |
33 | 34 |
34 | 35 |
35 error = FT_ERR( Invalid_Argument ); | 36 if ( !face ) |
| 37 return FT_THROW( Invalid_Face_Handle ); |
36 | 38 |
37 if ( face != NULL ) | 39 if ( !header ) |
38 { | 40 return FT_THROW( Invalid_Argument ); |
39 FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); | |
40 | 41 |
41 if ( service != NULL ) | 42 FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); |
42 { | 43 |
43 error = service->get_header( face, header ); | 44 if ( service ) |
44 } | 45 error = service->get_header( face, header ); |
45 } | 46 else |
| 47 error = FT_THROW( Invalid_Argument ); |
46 | 48 |
47 return error; | 49 return error; |
48 } | 50 } |
49 | 51 |
50 | 52 |
51 /* END */ | 53 /* END */ |
OLD | NEW |