Home | History | Annotate | Download | only in src
      1 /*
      2  * Copyright (C) 1998-2004  David Turner and Werner Lemberg
      3  * Copyright (C) 2006  Behdad Esfahbod
      4  *
      5  * This is part of HarfBuzz, an OpenType Layout engine library.
      6  *
      7  * Permission is hereby granted, without written agreement and without
      8  * license or royalty fees, to use, copy, modify, and distribute this
      9  * software and its documentation for any purpose, provided that the
     10  * above copyright notice and the following two paragraphs appear in
     11  * all copies of this software.
     12  *
     13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
     14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
     15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
     16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
     17  * DAMAGE.
     18  *
     19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
     20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
     21  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
     22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
     23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
     24  */
     25 
     26 #ifndef HARFBUZZ_GDEF_PRIVATE_H
     27 #define HARFBUZZ_GDEF_PRIVATE_H
     28 
     29 #include "harfbuzz-impl.h"
     30 #include "harfbuzz-stream-private.h"
     31 #include "harfbuzz-buffer-private.h"
     32 #include "harfbuzz-gdef.h"
     33 
     34 HB_BEGIN_HEADER
     35 
     36 
     37 #ifdef HB_USE_PACKED_STRUCTS
     38 #pragma pack(push, 1)
     39 #endif
     40 
     41 /* Attachment related structures */
     42 
     43 struct  HB_AttachPoint_
     44 {
     45   HB_UShort*  PointIndex;             /* array of contour points      */
     46   HB_UShort   PointCount;             /* size of the PointIndex array */
     47 };
     48 
     49 /* Ligature Caret related structures */
     50 
     51 struct  HB_CaretValueFormat1_
     52 {
     53   HB_Short  Coordinate;               /* x or y value (in design units) */
     54 };
     55 
     56 typedef struct HB_CaretValueFormat1_  HB_CaretValueFormat1;
     57 
     58 
     59 struct  HB_CaretValueFormat2_
     60 {
     61   HB_UShort  CaretValuePoint;         /* contour point index on glyph */
     62 };
     63 
     64 typedef struct HB_CaretValueFormat2_  HB_CaretValueFormat2;
     65 
     66 
     67 struct  HB_CaretValueFormat3_
     68 {
     69   HB_Device*  Device;                 /* Device table for x or y value  */
     70   HB_Short    Coordinate;             /* x or y value (in design units) */
     71 };
     72 
     73 typedef struct HB_CaretValueFormat3_  HB_CaretValueFormat3;
     74 
     75 
     76 #ifdef HB_SUPPORT_MULTIPLE_MASTER
     77 struct  HB_CaretValueFormat4_
     78 {
     79   HB_UShort  IdCaretValue;            /* metric ID */
     80 };
     81 
     82 typedef struct HB_CaretValueFormat4_  HB_CaretValueFormat4;
     83 #endif
     84 
     85 
     86 struct  HB_CaretValue_
     87 {
     88   union
     89   {
     90     HB_CaretValueFormat1  cvf1;
     91     HB_CaretValueFormat2  cvf2;
     92     HB_CaretValueFormat3  cvf3;
     93 #ifdef HB_SUPPORT_MULTIPLE_MASTER
     94     HB_CaretValueFormat4  cvf4;
     95 #endif
     96   } cvf;
     97 
     98   HB_Byte  CaretValueFormat;          /* 1, 2, 3, or 4 */
     99 };
    100 
    101 typedef struct HB_CaretValue_  HB_CaretValue;
    102 
    103 
    104 struct  HB_LigGlyph_
    105 {
    106   HB_CaretValue*  CaretValue;        /* array of caret values  */
    107   HB_UShort        CaretCount;        /* number of caret values */
    108   HB_Bool          loaded;
    109 };
    110 
    111 
    112 HB_INTERNAL HB_Error
    113 _HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef,
    114 				       HB_UShort        glyphID,
    115 				       HB_UShort        property );
    116 
    117 HB_INTERNAL HB_Error
    118 _HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
    119 				   HB_GlyphItem    item,
    120 				   HB_UShort        flags,
    121 				   HB_UShort*       property );
    122 
    123 HB_INTERNAL HB_Error
    124 _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef,
    125 						  HB_Stream      input,
    126 						  HB_Lookup*     lo,
    127 						  HB_UShort      num_lookups );
    128 
    129 #ifdef HB_USE_PACKED_STRUCTS
    130 #pragma pack(pop)
    131 #endif
    132 
    133 HB_END_HEADER
    134 
    135 #endif /* HARFBUZZ_GDEF_PRIVATE_H */
    136