1f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 2f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Copyright © 2014 Google, Inc. 3f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 4f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * This is part of HarfBuzz, a text shaping library. 5f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 6f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Permission is hereby granted, without written agreement and without 7f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this 8f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * software and its documentation for any purpose, provided that the 9f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * above copyright notice and the following two paragraphs appear in 10f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * all copies of this software. 11f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 12f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * DAMAGE. 17f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 18f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 24f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Google Author(s): Behdad Esfahbod 25f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 26f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 27f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_WIN1256_HH 28f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 29f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 30f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 31f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * The macros in the first part of this file are generic macros that can 32f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * be used to define the bytes for OpenType table data in code in a 33f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * readable manner. We can move the macros to reside with their respective 34f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * struct types, but since we only use these to define one data table, the 35f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Windows-1256 Arabic shaping table in this file, we keep them here. 36f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 37f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 38f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 39f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* First we measure, then we cut. */ 40f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#ifndef OT_MEASURE 41f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_MEASURE 421789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_TABLE_START static const struct TABLE_NAME { 431789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_TABLE_END } 441789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LABEL_START(Name) unsigned char Name[ 451789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LABEL_END ]; 461789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_BYTE(u8) +1/*byte*/ 47f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_USHORT(u16) +2/*bytes*/ 48f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#else 49f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#undef OT_MEASURE 501789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_TABLE_START TABLE_NAME = { 511789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_TABLE_END }; 521789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LABEL_START(Name) { 531789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LABEL_END }, 541789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_BYTE(u8) (u8), 551789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_USHORT(u16) (unsigned char)((u16)>>8), (unsigned char)((u16)&0xFFu), 561789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_COUNT(Name, ItemSize) ((unsigned int) sizeof(((struct TABLE_NAME*)0)->Name) \ 571789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod / (unsigned int)(ItemSize) \ 581789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod /* OT_ASSERT it's divisible (and positive). */) 591789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_DISTANCE(From,To) ((unsigned int) \ 601789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod ((char*)(&((struct TABLE_NAME*)0)->To) - \ 611789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod (char*)(&((struct TABLE_NAME*)0)->From)) \ 621789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod /* OT_ASSERT it's positive. */) 63f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#endif 64f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 65f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 661789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LABEL(Name) \ 671789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END \ 681789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) 691789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod 70f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* Whenever we receive an argument that is a list, it will expand to 71f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * contain commas. That cannot be passed to another macro because the 72f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * commas will throw off the preprocessor. The solution is to wrap 73f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * the passed-in argument in OT_LIST() before passing to the next macro. 74f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Unfortunately this trick requires vararg macros. */ 751789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LIST(...) __VA_ARGS__ 76f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 77f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 78f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 79f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Basic Types 80f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 81f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 821789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_TAG(a,b,c,d) \ 831789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_BYTE(a) OT_BYTE(b) OT_BYTE(c) OT_BYTE(d) 84f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 851789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_OFFSET(From, To) /* Offset from From to To in bytes */ \ 861789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_USHORT(OT_DISTANCE(From, To)) 87f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 881789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_GLYPHID /* GlyphID */ \ 891789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_USHORT 90f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 91f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_UARRAY(Name, Items) \ 921789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) \ 931789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_USHORT(OT_COUNT(Name##Data, 2)) \ 94f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_LABEL(Name##Data) \ 95f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod Items \ 961789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END 97f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 98f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_UHEADLESSARRAY(Name, Items) \ 991789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) \ 1001789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_USHORT(OT_COUNT(Name##Data, 2) + 1) \ 101f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_LABEL(Name##Data) \ 102f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod Items \ 1031789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END 104f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 105f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 106f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 107f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Common Types 108f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 109f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 1101789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LOOKUP_FLAG_IGNORE_MARKS 0x08u 1111789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod 112f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_LOOKUP(Name, LookupType, LookupFlag, SubLookupOffsets) \ 1131789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) \ 114f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_USHORT(LookupType) \ 115f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_USHORT(LookupFlag) \ 1161789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END \ 117f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_UARRAY(Name##SubLookupOffsetsArray, OT_LIST(SubLookupOffsets)) 118f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 119f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_SUBLOOKUP(Name, SubFormat, Items) \ 1201789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) \ 121f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_USHORT(SubFormat) \ 122f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod Items 123f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 124f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_COVERAGE1(Name, Items) \ 1251789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) \ 126f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_USHORT(1) \ 1271789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END \ 128f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_UARRAY(Name##Glyphs, OT_LIST(Items)) 129f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 130f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 131f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 132f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * GSUB 133f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 134f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 1351789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LOOKUP_TYPE_SUBST_SINGLE 1u 1361789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define OT_LOOKUP_TYPE_SUBST_LIGATURE 4u 1371789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod 138f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_SUBLOOKUP_SINGLE_SUBST_FORMAT2(Name, FromGlyphs, ToGlyphs) \ 139f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_SUBLOOKUP(Name, 2, \ 140f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(Name, Name##Coverage) \ 1411789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END \ 142f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_UARRAY(Name##Substitute, OT_LIST(ToGlyphs)) \ 143f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod ) \ 144f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_COVERAGE1(Name##Coverage, OT_LIST(FromGlyphs)) \ 145d6adca9fbbbd6fc7c8906121b50c3930fbe2de8eBehdad Esfahbod /* ASSERT_STATIC_EXPR_ZERO (len(FromGlyphs) == len(ToGlyphs)) */ 146f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 147f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_SUBLOOKUP_LIGATURE_SUBST_FORMAT1(Name, FirstGlyphs, LigatureSetOffsets) \ 148f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_SUBLOOKUP(Name, 1, \ 149f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(Name, Name##Coverage) \ 1501789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END \ 151f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_UARRAY(Name##LigatureSetOffsetsArray, OT_LIST(LigatureSetOffsets)) \ 152f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod ) \ 153f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_COVERAGE1(Name##Coverage, OT_LIST(FirstGlyphs)) \ 154d6adca9fbbbd6fc7c8906121b50c3930fbe2de8eBehdad Esfahbod /* ASSERT_STATIC_EXPR_ZERO (len(FirstGlyphs) == len(LigatureSetOffsets)) */ 155f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 156f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_LIGATURE_SET(Name, LigatureSetOffsets) \ 1571789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_UARRAY(Name, OT_LIST(LigatureSetOffsets)) 158f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 159f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define OT_LIGATURE(Name, Components, LigGlyph) \ 1601789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(Name) \ 161f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod LigGlyph \ 1621789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END \ 163f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_UHEADLESSARRAY(Name##ComponentsArray, OT_LIST(Components)) 164f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 165f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 166f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 167f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Start of Windows-1256 shaping table. 168f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * 169f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 170f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 171f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* Table name. */ 172f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define TABLE_NAME arabic_win1256_gsub_lookups 173f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 174f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* Table manifest. */ 175f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define MANIFEST(Items) \ 1761789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_START(manifest) \ 1771789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_USHORT(OT_COUNT(manifestData, 6)) \ 178f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_LABEL(manifestData) \ 179f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod Items \ 1801789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod OT_LABEL_END 181f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 1821789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#define MANIFEST_LOOKUP(Tag, Name) \ 1831789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod Tag \ 184f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(manifest, Name) 185f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 186f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* Shorthand. */ 187f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define G OT_GLYPHID 188f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 189f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 190f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Table Start 191f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 192f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_TABLE_START 193f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 194f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 195f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 196f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Manifest 197f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 198f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodMANIFEST( 199abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod MANIFEST_LOOKUP(OT_TAG('r','l','i','g'), rligLookup) 2001789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod MANIFEST_LOOKUP(OT_TAG('i','n','i','t'), initLookup) 2011789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod MANIFEST_LOOKUP(OT_TAG('m','e','d','i'), mediLookup) 2021789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod MANIFEST_LOOKUP(OT_TAG('f','i','n','a'), finaLookup) 2031789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod MANIFEST_LOOKUP(OT_TAG('r','l','i','g'), rligMarksLookup) 204f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 205f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 206f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 207f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Lookups 208f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 2091789ccb1dd56af6117eac00e633eff94860ba252Behdad EsfahbodOT_LOOKUP(initLookup, OT_LOOKUP_TYPE_SUBST_SINGLE, OT_LOOKUP_FLAG_IGNORE_MARKS, 210f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(initLookup, initmediSubLookup) 211f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(initLookup, initSubLookup) 212f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 2131789ccb1dd56af6117eac00e633eff94860ba252Behdad EsfahbodOT_LOOKUP(mediLookup, OT_LOOKUP_TYPE_SUBST_SINGLE, OT_LOOKUP_FLAG_IGNORE_MARKS, 214f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(mediLookup, initmediSubLookup) 215f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(mediLookup, mediSubLookup) 216abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod OT_OFFSET(mediLookup, medifinaLamAlefSubLookup) 217f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 2181789ccb1dd56af6117eac00e633eff94860ba252Behdad EsfahbodOT_LOOKUP(finaLookup, OT_LOOKUP_TYPE_SUBST_SINGLE, OT_LOOKUP_FLAG_IGNORE_MARKS, 219f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(finaLookup, finaSubLookup) 220abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod /* We don't need this one currently as the sequence inherits masks 221abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod * from the first item. Just in case we change that in the future 222abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod * to be smart about Arabic masks when ligating... */ 223abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod OT_OFFSET(finaLookup, medifinaLamAlefSubLookup) 224f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 2251789ccb1dd56af6117eac00e633eff94860ba252Behdad EsfahbodOT_LOOKUP(rligLookup, OT_LOOKUP_TYPE_SUBST_LIGATURE, OT_LOOKUP_FLAG_IGNORE_MARKS, 226f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(rligLookup, lamAlefLigaturesSubLookup) 227f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 2281789ccb1dd56af6117eac00e633eff94860ba252Behdad EsfahbodOT_LOOKUP(rligMarksLookup, OT_LOOKUP_TYPE_SUBST_LIGATURE, 0, 229f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(rligMarksLookup, shaddaLigaturesSubLookup) 230f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 231f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 232f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 233f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * init/medi/fina forms 234f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 235f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_SUBLOOKUP_SINGLE_SUBST_FORMAT2(initmediSubLookup, 236a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(198) G(200) G(201) G(202) G(203) G(204) G(205) G(206) G(211) 237a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(212) G(213) G(214) G(223) G(225) G(227) G(228) G(236) G(237), 238a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(162) G(4) G(5) G(5) G(6) G(7) G(9) G(11) G(13) 239a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(14) G(15) G(26) G(140) G(141) G(142) G(143) G(154) G(154) 240f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 241f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_SUBLOOKUP_SINGLE_SUBST_FORMAT2(initSubLookup, 242a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(218) G(219) G(221) G(222) G(229), 243a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(27) G(30) G(128) G(131) G(144) 244f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 245f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_SUBLOOKUP_SINGLE_SUBST_FORMAT2(mediSubLookup, 246a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(218) G(219) G(221) G(222) G(229), 247a2de193220ee2839125594bd1a60b5b66ab4598eBehdad Esfahbod G(28) G(31) G(129) G(138) G(149) 248f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 249f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_SUBLOOKUP_SINGLE_SUBST_FORMAT2(finaSubLookup, 250e839e2523e64fd0cf21929f6a45e2facd59c7917Behdad Esfahbod G(194) G(195) G(197) G(198) G(199) G(201) G(204) G(205) G(206) 251e839e2523e64fd0cf21929f6a45e2facd59c7917Behdad Esfahbod G(218) G(219) G(229) G(236) G(237), 252e839e2523e64fd0cf21929f6a45e2facd59c7917Behdad Esfahbod G(2) G(1) G(3) G(181) G(0) G(159) G(8) G(10) G(12) 253e839e2523e64fd0cf21929f6a45e2facd59c7917Behdad Esfahbod G(29) G(127) G(152) G(160) G(156) 254f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 255abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad EsfahbodOT_SUBLOOKUP_SINGLE_SUBST_FORMAT2(medifinaLamAlefSubLookup, 256abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod G(165) G(178) G(180) G(252), 257abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod G(170) G(179) G(185) G(255) 258f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 259f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 260f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 261f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Lam+Alef ligatures 262f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 263f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_SUBLOOKUP_LIGATURE_SUBST_FORMAT1(lamAlefLigaturesSubLookup, 264abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad Esfahbod G(225), 265f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(lamAlefLigaturesSubLookup, lamLigatureSet) 266f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 267f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_LIGATURE_SET(lamLigatureSet, 268f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(lamLigatureSet, lamInitLigature1) 269f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(lamLigatureSet, lamInitLigature2) 270f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(lamLigatureSet, lamInitLigature3) 271f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(lamLigatureSet, lamInitLigature4) 272f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 273abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad EsfahbodOT_LIGATURE(lamInitLigature1, G(199), G(165)) 274abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad EsfahbodOT_LIGATURE(lamInitLigature2, G(195), G(178)) 275abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad EsfahbodOT_LIGATURE(lamInitLigature3, G(194), G(180)) 276abfa4252cce1c56c472693dcd8400cd97ededd2fBehdad EsfahbodOT_LIGATURE(lamInitLigature4, G(197), G(252)) 277f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 278f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 279f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Shadda ligatures 280f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 281f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_SUBLOOKUP_LIGATURE_SUBST_FORMAT1(shaddaLigaturesSubLookup, 282f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod G(248), 283f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(shaddaLigaturesSubLookup, shaddaLigatureSet) 284f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 285f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_LIGATURE_SET(shaddaLigatureSet, 286f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(shaddaLigatureSet, shaddaLigature1) 287f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(shaddaLigatureSet, shaddaLigature2) 288f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod OT_OFFSET(shaddaLigatureSet, shaddaLigature3) 289f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod) 290f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_LIGATURE(shaddaLigature1, G(243), G(172)) 291f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_LIGATURE(shaddaLigature2, G(245), G(173)) 292f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_LIGATURE(shaddaLigature3, G(246), G(175)) 293f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 294f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 295f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Table end 296f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 297f28b1c823db2ad56fed356ef864a7508d23048b8Behdad EsfahbodOT_TABLE_END 298f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 299f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 300f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 301f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Clean up 302f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 303f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#undef OT_TABLE_START 304f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#undef OT_TABLE_END 3051789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#undef OT_LABEL_START 3061789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#undef OT_LABEL_END 3071789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#undef OT_BYTE 308f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#undef OT_USHORT 309f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#undef OT_DISTANCE 3101789ccb1dd56af6117eac00e633eff94860ba252Behdad Esfahbod#undef OT_COUNT 311f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 312f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod/* 313f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod * Include a second time to get the table data... 314f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod */ 31522f0de5025aeeef4c8b3ca876d291d4c8e558d94Behdad Esfahbod#if 0 31622f0de5025aeeef4c8b3ca876d291d4c8e558d94Behdad Esfahbod#include "hb-private.hh" /* Make check-includes.sh happy. */ 31722f0de5025aeeef4c8b3ca876d291d4c8e558d94Behdad Esfahbod#endif 318f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#ifdef OT_MEASURE 319d457e3f0ff9b27616a34e4cc110d3edbf8796841Behdad Esfahbod#include "hb-ot-shape-complex-arabic-win1256.hh" 320f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#endif 321f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod 322f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#define HB_OT_SHAPE_COMPLEX_ARABIC_WIN1256_HH 323f28b1c823db2ad56fed356ef864a7508d23048b8Behdad Esfahbod#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_WIN1256_HH */ 324