update for HEAD-2003050101
[reactos.git] / lib / freetype / src / base / ftwinfnt.c
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftwinfnt.c                                                             */
4 /*                                                                         */
5 /*    FreeType API for accessing Windows FNT specific info (body).         */
6 /*                                                                         */
7 /*  Copyright 2002 by                                                      */
8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9 /*                                                                         */
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      */
12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
13 /*  this file you indicate that you have read the license and              */
14 /*  understand and accept it fully.                                        */
15 /*                                                                         */
16 /***************************************************************************/
17
18
19 #include <ft2build.h>
20 #include FT_WINFONTS_H
21 #include FT_INTERNAL_FNT_TYPES_H
22 #include FT_INTERNAL_OBJECTS_H
23
24
25   FT_EXPORT_DEF( FT_Error )
26   FT_Get_WinFNT_Header( FT_Face              face,
27                         FT_WinFNT_HeaderRec *header )
28   {
29     FT_Error     error;
30
31     error = FT_Err_Invalid_Argument;
32
33     if ( face != NULL && face->driver != NULL )
34     {
35       FT_Module  driver = (FT_Module) face->driver;
36
37
38       if ( driver->clazz && driver->clazz->module_name              &&
39            ft_strcmp( driver->clazz->module_name, "winfonts" ) == 0 )
40       {
41         FNT_Size  size = (FNT_Size)face->size;
42         FNT_Font  font = size->font;
43
44         if (font)
45         {
46           FT_MEM_COPY( header, &font->header, sizeof(*header) );
47           error    = 0;
48         }
49       }
50     }
51     return error;
52   }
53
54
55 /* END */