• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  *
3  * winfnt.h
4  *
5  *   FreeType font driver for Windows FNT/FON files
6  *
7  * Copyright 1996-2018 by
8  * David Turner, Robert Wilhelm, and Werner Lemberg.
9  * Copyright 2007 Dmitry Timoshkov for Codeweavers
10  *
11  * This file is part of the FreeType project, and may only be used,
12  * modified, and distributed under the terms of the FreeType project
13  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
14  * this file you indicate that you have read the license and
15  * understand and accept it fully.
16  *
17  */
18 
19 
20 #ifndef WINFNT_H_
21 #define WINFNT_H_
22 
23 
24 #include <ft2build.h>
25 #include FT_WINFONTS_H
26 #include FT_INTERNAL_DRIVER_H
27 
28 
29 FT_BEGIN_HEADER
30 
31 
32   typedef struct  WinMZ_HeaderRec_
33   {
34     FT_UShort  magic;
35     /* skipped content */
36     FT_UShort  lfanew;
37 
38   } WinMZ_HeaderRec;
39 
40 
41   typedef struct  WinNE_HeaderRec_
42   {
43     FT_UShort  magic;
44     /* skipped content */
45     FT_UShort  resource_tab_offset;
46     FT_UShort  rname_tab_offset;
47 
48   } WinNE_HeaderRec;
49 
50 
51   typedef struct  WinPE32_HeaderRec_
52   {
53     FT_ULong   magic;
54     FT_UShort  machine;
55     FT_UShort  number_of_sections;
56     /* skipped content */
57     FT_UShort  size_of_optional_header;
58     /* skipped content */
59     FT_UShort  magic32;
60     /* skipped content */
61     FT_ULong   rsrc_virtual_address;
62     FT_ULong   rsrc_size;
63     /* skipped content */
64 
65   } WinPE32_HeaderRec;
66 
67 
68   typedef struct  WinPE32_SectionRec_
69   {
70     FT_Byte   name[8];
71     /* skipped content */
72     FT_ULong  virtual_address;
73     FT_ULong  size_of_raw_data;
74     FT_ULong  pointer_to_raw_data;
75     /* skipped content */
76 
77   } WinPE32_SectionRec;
78 
79 
80   typedef struct  WinPE_RsrcDirRec_
81   {
82     FT_ULong   characteristics;
83     FT_ULong   time_date_stamp;
84     FT_UShort  major_version;
85     FT_UShort  minor_version;
86     FT_UShort  number_of_named_entries;
87     FT_UShort  number_of_id_entries;
88 
89   } WinPE_RsrcDirRec;
90 
91 
92   typedef struct  WinPE_RsrcDirEntryRec_
93   {
94     FT_ULong  name;
95     FT_ULong  offset;
96 
97   } WinPE_RsrcDirEntryRec;
98 
99 
100   typedef struct  WinPE_RsrcDataEntryRec_
101   {
102     FT_ULong  offset_to_data;
103     FT_ULong  size;
104     FT_ULong  code_page;
105     FT_ULong  reserved;
106 
107   } WinPE_RsrcDataEntryRec;
108 
109 
110   typedef struct  WinNameInfoRec_
111   {
112     FT_UShort  offset;
113     FT_UShort  length;
114     FT_UShort  flags;
115     FT_UShort  id;
116     FT_UShort  handle;
117     FT_UShort  usage;
118 
119   } WinNameInfoRec;
120 
121 
122   typedef struct  WinResourceInfoRec_
123   {
124     FT_UShort  type_id;
125     FT_UShort  count;
126 
127   } WinResourceInfoRec;
128 
129 
130 #define WINFNT_MZ_MAGIC  0x5A4D
131 #define WINFNT_NE_MAGIC  0x454E
132 #define WINFNT_PE_MAGIC  0x4550
133 
134 
135   typedef struct  FNT_FontRec_
136   {
137     FT_ULong             offset;
138 
139     FT_WinFNT_HeaderRec  header;
140 
141     FT_Byte*             fnt_frame;
142     FT_ULong             fnt_size;
143     FT_String*           family_name;
144 
145   } FNT_FontRec, *FNT_Font;
146 
147 
148   typedef struct  FNT_FaceRec_
149   {
150     FT_FaceRec     root;
151     FNT_Font       font;
152 
153     FT_CharMap     charmap_handle;
154     FT_CharMapRec  charmap;  /* a single charmap per face */
155 
156   } FNT_FaceRec, *FNT_Face;
157 
158 
159   FT_EXPORT_VAR( const FT_Driver_ClassRec )  winfnt_driver_class;
160 
161 
162 FT_END_HEADER
163 
164 
165 #endif /* WINFNT_H_ */
166 
167 
168 /* END */
169