Add 'head' table
[profile/ivi/org.tizen.video-player.git] / src / hb-ot-head-private.hh
1 /*\r
2  * Copyright (C) 2010  Red Hat, Inc.\r
3  *\r
4  *  This is part of HarfBuzz, a text shaping library.\r
5  *\r
6  * Permission is hereby granted, without written agreement and without\r
7  * license or royalty fees, to use, copy, modify, and distribute this\r
8  * software and its documentation for any purpose, provided that the\r
9  * above copyright notice and the following two paragraphs appear in\r
10  * all copies of this software.\r
11  *\r
12  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\r
13  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\r
14  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN\r
15  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
16  * DAMAGE.\r
17  *\r
18  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\r
19  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\r
20  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS\r
21  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO\r
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\r
23  *\r
24  * Red Hat Author(s): Behdad Esfahbod\r
25  */\r
26 \r
27 #ifndef HB_OT_HEAD_PRIVATE_HH\r
28 #define HB_OT_HEAD_PRIVATE_HH\r
29 \r
30 #include "hb-open-type-private.hh"\r
31 \r
32 /*\r
33  * head\r
34  */\r
35 \r
36 #define HB_OT_TAG_head HB_TAG('h','e','a','d')\r
37 \r
38 struct head\r
39 {\r
40   static const hb_tag_t Tag     = HB_OT_TAG_head;\r
41 \r
42   inline bool sanitize (hb_sanitize_context_t *c) {\r
43     TRACE_SANITIZE ();\r
44     /* Shall we check for magicNumber here?  Who cares? */\r
45     return c->check_struct (this) && likely (version.major == 1);\r
46   }\r
47 \r
48   FixedVersion  version;                /* Version of the head table--currently\r
49                                          * 0x00010000 for version 1.0. */\r
50   FixedVersion  fontRevision;           /* Set by font manufacturer. */\r
51   ULONG         checkSumAdjustment;     /* To compute: set it to 0, sum the\r
52                                          * entire font as ULONG, then store\r
53                                          * 0xB1B0AFBA - sum. */\r
54   ULONG         magicNumber;            /* Set to 0x5F0F3CF5. */\r
55   USHORT        flags;                  /* Bit 0: Baseline for font at y=0;\r
56                                          * Bit 1: Left sidebearing point at x=0;\r
57                                          * Bit 2: Instructions may depend on point size;\r
58                                          * Bit 3: Force ppem to integer values for all\r
59                                          *   internal scaler math; may use fractional\r
60                                          *   ppem sizes if this bit is clear;\r
61                                          * Bit 4: Instructions may alter advance width\r
62                                          *   (the advance widths might not scale linearly);\r
63 \r
64                                          * Bits 5-10: These should be set according to\r
65                                          *   Apple's specification. However, they are not\r
66                                          *   implemented in OpenType.\r
67                                          * Bit 5: This bit should be set in fonts that are\r
68                                          *   intended to e laid out vertically, and in\r
69                                          *   which the glyphs have been drawn such that an\r
70                                          *   x-coordinate of 0 corresponds to the desired\r
71                                          *   vertical baseline.\r
72                                          * Bit 6: This bit must be set to zero.\r
73                                          * Bit 7: This bit should be set if the font\r
74                                          *   requires layout for correct linguistic\r
75                                          *   rendering (e.g. Arabic fonts).\r
76                                          * Bit 8: This bit should be set for a GX font\r
77                                          *   which has one or more metamorphosis effects\r
78                                          *   designated as happening by default.\r
79                                          * Bit 9: This bit should be set if the font\r
80                                          *   contains any strong right-to-left glyphs.\r
81                                          * Bit 10: This bit should be set if the font\r
82                                          *   contains Indic-style rearrangement effects.\r
83 \r
84                                          * Bit 11: Font data is 'lossless,' as a result\r
85                                          *   of having been compressed and decompressed\r
86                                          *   with the Agfa MicroType Express engine.\r
87                                          * Bit 12: Font converted (produce compatible metrics)\r
88                                          * Bit 13: Font optimized for ClearType™.\r
89                                          *   Note, fonts that rely on embedded bitmaps (EBDT)\r
90                                          *   for rendering should not be considered optimized\r
91                                          *   for ClearType, and therefore should keep this bit\r
92                                          *   cleared.\r
93                                          * Bit 14: Reserved, set to 0\r
94                                          * Bit 15: Reserved, set to 0. */\r
95   USHORT        unitsPerEm;             /* Valid range is from 16 to 16384. This value\r
96                                          * should be a power of 2 for fonts that have\r
97                                          * TrueType outlines. */\r
98   LONGDATETIME  created;                /* Number of seconds since 12:00 midnight,\r
99                                            January 1, 1904. 64-bit integer */\r
100   LONGDATETIME  modified;               /* Number of seconds since 12:00 midnight,\r
101                                            January 1, 1904. 64-bit integer */\r
102   SHORT         xMin;                   /* For all glyph bounding boxes. */\r
103   SHORT         yMin;                   /* For all glyph bounding boxes. */\r
104   SHORT         xMax;                   /* For all glyph bounding boxes. */\r
105   SHORT         yMax;                   /* For all glyph bounding boxes. */\r
106   USHORT        macStyle;               /* Bit 0: Bold (if set to 1);\r
107                                          * Bit 1: Italic (if set to 1)\r
108                                          * Bit 2: Underline (if set to 1)\r
109                                          * Bit 3: Outline (if set to 1)\r
110                                          * Bit 4: Shadow (if set to 1)\r
111                                          * Bit 5: Condensed (if set to 1)\r
112                                          * Bit 6: Extended (if set to 1)\r
113                                          * Bits 7-15: Reserved (set to 0). */\r
114   USHORT        lowestRecPPEM;          /* Smallest readable size in pixels. */\r
115   SHORT         fontDirectionHint;      /* Deprecated (Set to 2).\r
116                                          * 0: Fully mixed directional glyphs;\r
117                                          * 1: Only strongly left to right;\r
118                                          * 2: Like 1 but also contains neutrals;\r
119                                          * -1: Only strongly right to left;\r
120                                          * -2: Like -1 but also contains neutrals. */\r
121   SHORT         indexToLocFormat;       /* 0 for short offsets, 1 for long. */\r
122   SHORT         glyphDataFormat;        /* 0 for current format. */\r
123   public:\r
124   DEFINE_SIZE_STATIC (54);\r
125 };\r
126 \r
127 \r
128 #endif /* HB_OT_HEAD_PRIVATE_HH */\r