~ubuntu-branches/ubuntu/trusty/pango1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to pango/opentype/hb-ot-layout-gpos-private.hh

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-02-23 10:42:39 UTC
  • mfrom: (1.6.2 upstream) (63.3.16 lucid)
  • Revision ID: james.westby@ubuntu.com-20100223104239-yt4u4nop2nqtw65f
Tags: 1.27.1-1
* New upstream development release:
  + debian/rules:
    - Include check-dist.mk to prevent accidental uploads to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
typedef SHORT Value;
37
37
 
38
 
typedef Value ValueRecord[0];
39
 
ASSERT_SIZE (ValueRecord, 0);
 
38
typedef Value ValueRecord[VAR];
 
39
ASSERT_SIZE_VAR (ValueRecord, 0, Value);
40
40
 
41
41
struct ValueFormat : USHORT
42
42
{
259
259
  private:
260
260
  union {
261
261
  USHORT                format;         /* Format identifier */
262
 
  AnchorFormat1         format1[];
263
 
  AnchorFormat2         format2[];
264
 
  AnchorFormat3         format3[];
 
262
  AnchorFormat1         format1[VAR];
 
263
  AnchorFormat2         format2[VAR];
 
264
  AnchorFormat3         format3[VAR];
265
265
  } u;
266
266
};
267
 
ASSERT_SIZE (Anchor, 2);
268
267
 
269
268
 
270
269
struct AnchorMatrix
287
286
  USHORT        rows;                   /* Number of rows */
288
287
  private:
289
288
  OffsetTo<Anchor>
290
 
                matrix[];               /* Matrix of offsets to Anchor tables--
 
289
                matrix[VAR];            /* Matrix of offsets to Anchor tables--
291
290
                                         * from beginning of AnchorMatrix table */
292
291
};
293
 
ASSERT_SIZE (AnchorMatrix, 2);
 
292
ASSERT_SIZE_VAR (AnchorMatrix, 2, OffsetTo<Anchor>);
294
293
 
295
294
 
296
295
struct MarkRecord
389
388
                                         * value(s)--applied to all glyphs in
390
389
                                         * the Coverage table */
391
390
};
392
 
ASSERT_SIZE (SinglePosFormat1, 6);
 
391
ASSERT_SIZE_VAR (SinglePosFormat1, 6, ValueRecord);
393
392
 
394
393
struct SinglePosFormat2
395
394
{
431
430
  ValueRecord   values;                 /* Array of ValueRecords--positioning
432
431
                                         * values applied to glyphs */
433
432
};
434
 
ASSERT_SIZE (SinglePosFormat2, 8);
 
433
ASSERT_SIZE_VAR (SinglePosFormat2, 8, ValueRecord);
435
434
 
436
435
struct SinglePos
437
436
{
461
460
  private:
462
461
  union {
463
462
  USHORT                format;         /* Format identifier */
464
 
  SinglePosFormat1      format1[];
465
 
  SinglePosFormat2      format2[];
 
463
  SinglePosFormat1      format1[VAR];
 
464
  SinglePosFormat2      format2[VAR];
466
465
  } u;
467
466
};
468
 
ASSERT_SIZE (SinglePos, 2);
469
467
 
470
468
 
471
469
struct PairValueRecord
479
477
  ValueRecord   values;                 /* Positioning data for the first glyph
480
478
                                         * followed by for second glyph */
481
479
};
482
 
ASSERT_SIZE (PairValueRecord, 2);
 
480
ASSERT_SIZE_VAR (PairValueRecord, 2, ValueRecord);
483
481
 
484
482
struct PairSet
485
483
{
495
493
  private:
496
494
  USHORT        len;                    /* Number of PairValueRecords */
497
495
  PairValueRecord
498
 
                array[];                /* Array of PairValueRecords--ordered
 
496
                array[VAR];             /* Array of PairValueRecords--ordered
499
497
                                         * by GlyphID of the second glyph */
500
498
};
501
 
ASSERT_SIZE (PairSet, 2);
 
499
ASSERT_SIZE_VAR (PairSet, 2, PairValueRecord);
502
500
 
503
501
struct PairPosFormat1
504
502
{
654
652
                                         * class1-major, class2-minor,
655
653
                                         * Each entry has value1 and value2 */
656
654
};
657
 
ASSERT_SIZE (PairPosFormat2, 16);
 
655
ASSERT_SIZE_VAR (PairPosFormat2, 16, ValueRecord);
658
656
 
659
657
struct PairPos
660
658
{
684
682
  private:
685
683
  union {
686
684
  USHORT                format;         /* Format identifier */
687
 
  PairPosFormat1        format1[];
688
 
  PairPosFormat2        format2[];
 
685
  PairPosFormat1        format1[VAR];
 
686
  PairPosFormat2        format2[VAR];
689
687
  } u;
690
688
};
691
 
ASSERT_SIZE (PairPos, 2);
692
689
 
693
690
 
694
691
struct EntryExitRecord
931
928
  private:
932
929
  union {
933
930
  USHORT                format;         /* Format identifier */
934
 
  CursivePosFormat1     format1[];
 
931
  CursivePosFormat1     format1[VAR];
935
932
  } u;
936
933
};
937
 
ASSERT_SIZE (CursivePos, 2);
938
934
 
939
935
 
940
936
typedef AnchorMatrix BaseArray;         /* base-major--
941
937
                                         * in order of BaseCoverage Index--,
942
938
                                         * mark-minor--
943
939
                                         * ordered by class--zero-based. */
944
 
ASSERT_SIZE (BaseArray, 2);
945
940
 
946
941
struct MarkBasePosFormat1
947
942
{
1027
1022
  private:
1028
1023
  union {
1029
1024
  USHORT                format;         /* Format identifier */
1030
 
  MarkBasePosFormat1    format1[];
 
1025
  MarkBasePosFormat1    format1[VAR];
1031
1026
  } u;
1032
1027
};
1033
 
ASSERT_SIZE (MarkBasePos, 2);
1034
1028
 
1035
1029
 
1036
1030
typedef AnchorMatrix LigatureAttach;    /* component-major--
1037
1031
                                         * in order of writing direction--,
1038
1032
                                         * mark-minor--
1039
1033
                                         * ordered by class--zero-based. */
1040
 
ASSERT_SIZE (LigatureAttach, 2);
1041
1034
 
1042
1035
typedef OffsetListOf<LigatureAttach> LigatureArray;
1043
1036
                                        /* Array of LigatureAttach
1044
1037
                                         * tables ordered by
1045
1038
                                         * LigatureCoverage Index */
1046
 
ASSERT_SIZE (LigatureArray, 2);
1047
1039
 
1048
1040
struct MarkLigPosFormat1
1049
1041
{
1088
1080
     * is identical to the ligature ID of the found ligature.  If yes, we
1089
1081
     * can directly use the component index.  If not, we attach the mark
1090
1082
     * glyph to the last component of the ligature. */
1091
 
    if (IN_LIGID (j) == IN_LIGID (buffer->in_pos))
 
1083
    if (IN_LIGID (j) && IN_LIGID (j) == IN_LIGID (buffer->in_pos) && IN_COMPONENT (buffer->in_pos))
1092
1084
    {
1093
 
      comp_index = IN_COMPONENT (buffer->in_pos);
 
1085
      comp_index = IN_COMPONENT (buffer->in_pos) - 1;
1094
1086
      if (comp_index >= comp_count)
1095
1087
        comp_index = comp_count - 1;
1096
1088
    }
1152
1144
  private:
1153
1145
  union {
1154
1146
  USHORT                format;         /* Format identifier */
1155
 
  MarkLigPosFormat1     format1[];
 
1147
  MarkLigPosFormat1     format1[VAR];
1156
1148
  } u;
1157
1149
};
1158
 
ASSERT_SIZE (MarkLigPos, 2);
1159
1150
 
1160
1151
 
1161
1152
typedef AnchorMatrix Mark2Array;        /* mark2-major--
1162
1153
                                         * in order of Mark2Coverage Index--,
1163
1154
                                         * mark1-minor--
1164
1155
                                         * ordered by class--zero-based. */
1165
 
ASSERT_SIZE (Mark2Array, 2);
1166
1156
 
1167
1157
struct MarkMarkPosFormat1
1168
1158
{
1189
1179
      return false;
1190
1180
 
1191
1181
    /* Two marks match only if they belong to the same base, or same component
1192
 
     * of the same ligature. */
1193
 
    if (IN_LIGID (j) != IN_LIGID (buffer->in_pos) ||
1194
 
        IN_COMPONENT (j) != IN_COMPONENT (buffer->in_pos))
 
1182
     * of the same ligature.  That is, the component numbers must match, and
 
1183
     * if those are non-zero, the ligid number should also match. */
 
1184
    if ((IN_COMPONENT (j) != IN_COMPONENT (buffer->in_pos)) ||
 
1185
        (IN_COMPONENT (j) && IN_LIGID (j) != IN_LIGID (buffer->in_pos)))
1195
1186
      return false;
1196
1187
 
1197
1188
    unsigned int mark2_index = (this+mark2Coverage) (IN_GLYPH (j));
1253
1244
  private:
1254
1245
  union {
1255
1246
  USHORT                format;         /* Format identifier */
1256
 
  MarkMarkPosFormat1    format1[];
 
1247
  MarkMarkPosFormat1    format1[VAR];
1257
1248
  } u;
1258
1249
};
1259
 
ASSERT_SIZE (MarkMarkPos, 2);
1260
1250
 
1261
1251
 
1262
1252
static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
1272
1262
    return Context::apply (APPLY_ARG, position_lookup);
1273
1263
  }
1274
1264
};
1275
 
ASSERT_SIZE (ContextPos, 2);
1276
1265
 
1277
1266
struct ChainContextPos : ChainContext
1278
1267
{
1285
1274
    return ChainContext::apply (APPLY_ARG, position_lookup);
1286
1275
  }
1287
1276
};
1288
 
ASSERT_SIZE (ChainContextPos, 2);
1289
1277
 
1290
1278
 
1291
1279
struct ExtensionPos : Extension
1300
1288
 
1301
1289
  inline bool sanitize (SANITIZE_ARG_DEF);
1302
1290
};
1303
 
ASSERT_SIZE (ExtensionPos, 2);
1304
1291
 
1305
1292
 
1306
1293
 
1362
1349
  private:
1363
1350
  union {
1364
1351
  USHORT                format;
1365
 
  SinglePos             single[];
1366
 
  PairPos               pair[];
1367
 
  CursivePos            cursive[];
1368
 
  MarkBasePos           markBase[];
1369
 
  MarkLigPos            markLig[];
1370
 
  MarkMarkPos           markMark[];
1371
 
  ContextPos            context[];
1372
 
  ChainContextPos       chainContext[];
1373
 
  ExtensionPos          extension[];
 
1352
  SinglePos             single[VAR];
 
1353
  PairPos               pair[VAR];
 
1354
  CursivePos            cursive[VAR];
 
1355
  MarkBasePos           markBase[VAR];
 
1356
  MarkLigPos            markLig[VAR];
 
1357
  MarkMarkPos           markMark[VAR];
 
1358
  ContextPos            context[VAR];
 
1359
  ChainContextPos       chainContext[VAR];
 
1360
  ExtensionPos          extension[VAR];
1374
1361
  } u;
1375
1362
};
1376
 
ASSERT_SIZE (PosLookupSubTable, 2);
1377
1363
 
1378
1364
 
1379
1365
struct PosLookup : Lookup
1462
1448
    return SANITIZE_THIS (list);
1463
1449
  }
1464
1450
};
1465
 
ASSERT_SIZE (PosLookup, 6);
1466
1451
 
1467
1452
typedef OffsetListOf<PosLookup> PosLookupList;
1468
1453
ASSERT_SIZE (PosLookupList, 2);