1 /*
   2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3  *
   4  * This code is free software; you can redistribute it and/or modify it
   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 // This file is available under and governed by the GNU General Public
  26 // License version 2 only, as published by the Free Software Foundation.
  27 // However, the following notice accompanied the original version of this
  28 // file:
  29 //
  30 /*
  31  * Copyright © 2015  Mozilla Foundation.
  32  * Copyright © 2015  Google, Inc.
  33  *
  34  *  This is part of HarfBuzz, a text shaping library.
  35  *
  36  * Permission is hereby granted, without written agreement and without
  37  * license or royalty fees, to use, copy, modify, and distribute this
  38  * software and its documentation for any purpose, provided that the
  39  * above copyright notice and the following two paragraphs appear in
  40  * all copies of this software.
  41  *
  42  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
  43  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  44  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
  45  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  46  * DAMAGE.
  47  *
  48  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
  49  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  50  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  51  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
  52  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  53  *
  54  * Mozilla Author(s): Jonathan Kew
  55  * Google Author(s): Behdad Esfahbod
  56  */
  57 
  58 #ifndef HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH
  59 #define HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH
  60 
  61 #include "hb-private.hh"
  62 
  63 
  64 #include "hb-ot-shape-complex-private.hh"
  65 
  66 
  67 #define USE_TABLE_ELEMENT_TYPE uint8_t
  68 
  69 /* Cateories used in the Universal Shaping Engine spec:
  70  * https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm
  71  */
  72 /* Note: This enum is duplicated in the -machine.rl source file.
  73  * Not sure how to avoid duplication. */
  74 enum use_category_t {
  75   USE_O         = 0,    /* OTHER */
  76 
  77   USE_B         = 1,    /* BASE */
  78   USE_IV        = 2,    /* BASE_VOWEL */
  79   USE_IND       = 3,    /* BASE_IND */
  80   USE_N         = 4,    /* BASE_NUM */
  81   USE_GB        = 5,    /* BASE_OTHER */
  82   USE_CGJ       = 6,    /* CGJ */
  83 //  USE_F               = 7,    /* CONS_FINAL */
  84   USE_FM        = 8,    /* CONS_FINAL_MOD */
  85 //  USE_M               = 9,    /* CONS_MED */
  86 //  USE_CM      = 10,   /* CONS_MOD */
  87   USE_SUB       = 11,   /* CONS_SUB */
  88   USE_H         = 12,   /* HALANT */
  89 
  90   USE_HN        = 13,   /* HALANT_NUM */
  91   USE_ZWNJ      = 14,   /* Zero width non-joiner */
  92   USE_ZWJ       = 15,   /* Zero width joiner */
  93   USE_WJ        = 16,   /* Word joiner */
  94   USE_Rsv       = 17,   /* Reserved characters */
  95   USE_R         = 18,   /* REPHA */
  96   USE_S         = 19,   /* SYM */
  97 //  USE_SM      = 20,   /* SYM_MOD */
  98   USE_VS        = 21,   /* VARIATION_SELECTOR */
  99 //  USE_V       = 36,   /* VOWEL */
 100 //  USE_VM      = 40,   /* VOWEL_MOD */
 101 
 102   USE_FAbv      = 24,   /* CONS_FINAL_ABOVE */
 103   USE_FBlw      = 25,   /* CONS_FINAL_BELOW */
 104   USE_FPst      = 26,   /* CONS_FINAL_POST */
 105   USE_MAbv      = 27,   /* CONS_MED_ABOVE */
 106   USE_MBlw      = 28,   /* CONS_MED_BELOW */
 107   USE_MPst      = 29,   /* CONS_MED_POST */
 108   USE_MPre      = 30,   /* CONS_MED_PRE */
 109   USE_CMAbv     = 31,   /* CONS_MOD_ABOVE */
 110   USE_CMBlw     = 32,   /* CONS_MOD_BELOW */
 111   USE_VAbv      = 33,   /* VOWEL_ABOVE / VOWEL_ABOVE_BELOW / VOWEL_ABOVE_BELOW_POST / VOWEL_ABOVE_POST */
 112   USE_VBlw      = 34,   /* VOWEL_BELOW / VOWEL_BELOW_POST */
 113   USE_VPst      = 35,   /* VOWEL_POST   UIPC = Right */
 114   USE_VPre      = 22,   /* VOWEL_PRE / VOWEL_PRE_ABOVE / VOWEL_PRE_ABOVE_POST / VOWEL_PRE_POST */
 115   USE_VMAbv     = 37,   /* VOWEL_MOD_ABOVE */
 116   USE_VMBlw     = 38,   /* VOWEL_MOD_BELOW */
 117   USE_VMPst     = 39,   /* VOWEL_MOD_POST */
 118   USE_VMPre     = 23,   /* VOWEL_MOD_PRE */
 119   USE_SMAbv     = 41,   /* SYM_MOD_ABOVE */
 120   USE_SMBlw     = 42    /* SYM_MOD_BELOW */
 121 };
 122 
 123 HB_INTERNAL USE_TABLE_ELEMENT_TYPE
 124 hb_use_get_categories (hb_codepoint_t u);
 125 
 126 #endif /* HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH */