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