/*
*
- * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
+ * (C) Copyright IBM Corp. and others 1998-2014 - All Rights Reserved
*
*/
/**
* A type used for signed, 32-bit integers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef int32_t le_int32;
/**
* A type used for unsigned, 32-bit integers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef uint32_t le_uint32;
/**
* A type used for signed, 16-bit integers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef int16_t le_int16;
/**
* A type used for unsigned, 16-bit integers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef uint16_t le_uint16;
/**
* A type used for signed, 8-bit integers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef int8_t le_int8;
/**
* A type used for unsigned, 8-bit integers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef uint8_t le_uint8;
/**
* A type used for boolean values.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef UBool le_bool;
/**
* Used to represent empty pointers.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define NULL 0
#endif
/**
* Used for four character tags.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef le_uint32 LETag;
* Used for 16-bit glyph indices as they're represented
* in TrueType font tables.
*
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef le_uint16 TTGlyphID;
* order 8 bits are client defined. The LayoutEngine
* will never change or look at the client defined bits.
*
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef le_uint32 LEGlyphID;
* Used to mask off the glyph ID part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_GLYPH_MASK 0x0000FFFF
* into the low-order bits.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_GLYPH_SHIFT 0
* Used to mask off the sub-font ID part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_SUB_FONT_MASK 0x00FF0000
* into the low-order bits.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_SUB_FONT_SHIFT 16
* Used to mask off the client-defined part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_CLIENT_MASK 0xFF000000
* into the low-order bits.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_CLIENT_SHIFT 24
* A convenience macro to get the Glyph ID part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_GET_GLYPH(gid) ((gid & LE_GLYPH_MASK) >> LE_GLYPH_SHIFT)
* A convenience macro to get the sub-font ID part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_GET_SUB_FONT(gid) ((gid & LE_SUB_FONT_MASK) >> LE_SUB_FONT_SHIFT)
* A convenience macro to get the client-defined part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_GET_CLIENT(gid) ((gid & LE_CLIENT_MASK) >> LE_CLIENT_SHIFT)
* A convenience macro to set the Glyph ID part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_SET_GLYPH(gid, glyph) ((gid & ~LE_GLYPH_MASK) | ((glyph << LE_GLYPH_SHIFT) & LE_GLYPH_MASK))
* A convenience macro to set the sub-font ID part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_SET_SUB_FONT(gid, font) ((gid & ~LE_SUB_FONT_MASK) | ((font << LE_SUB_FONT_SHIFT) & LE_SUB_FONT_MASK))
* A convenience macro to set the client-defined part of an LEGlyphID.
*
* @see LEGlyphID
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_SET_CLIENT(gid, client) ((gid & ~LE_CLIENT_MASK) | ((client << LE_CLIENT_SHIFT) & LE_CLIENT_MASK))
/**
* Used to represent 16-bit Unicode code points.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef UChar LEUnicode16;
/**
* Used to represent 32-bit Unicode code points.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef UChar32 LEUnicode32;
/**
* Used to represent 16-bit Unicode code points.
*
- * @deprecated since ICU 2.4. Use LEUnicode16 instead
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef UChar LEUnicode;
#endif /* U_HIDE_DEPRECATED_API */
/**
* Used to hold a pair of (x, y) values which represent a point.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
struct LEPoint
{
/**
* The x coordinate of the point.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
float fX;
/**
* The y coordinate of the point.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
float fY;
};
/**
* Used to hold a pair of (x, y) values which represent a point.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef struct LEPoint LEPoint;
#endif
#ifndef U_HIDE_INTERNAL_API
+
+/**
+ * \def
+ * @internal
+ */
+#ifndef LE_ASSERT_BAD_FONT
+#define LE_ASSERT_BAD_FONT 0
+#endif
+
+/**
+ * \def LE_DEBUG_BAD_FONT
+ * @internal
+ */
+#if LE_ASSERT_BAD_FONT
+#include <stdio.h>
+#define LE_DEBUG_BAD_FONT(x) fprintf(stderr,"%s:%d: BAD FONT: %s\n", __FILE__, __LINE__, (x));
+#else
+#define LE_DEBUG_BAD_FONT(x)
+#endif
+
+/**
+ * \def LE_UINTPTR_MAX
+ * Max value representable by a uintptr
+ */
+
+#ifndef UINT32_MAX
+#define LE_UINT32_MAX 0xFFFFFFFFU
+#else
+#define LE_UINT32_MAX UINT32_MAX
+#endif
+
+#ifndef UINTPTR_MAX
+#define LE_UINTPTR_MAX LE_UINT32_MAX
+#else
+#define LE_UINTPTR_MAX UINTPTR_MAX
+#endif
+
+/**
+ * Range check for overflow
+ */
+#define LE_RANGE_CHECK(type, count, ptrfn) (( (LE_UINTPTR_MAX / sizeof(type)) < (size_t)count ) ? NULL : (ptrfn))
/**
* A convenience macro to get the length of an array.
*
*
* @internal
*/
-#define LE_NEW_ARRAY(type, count) (type *) uprv_malloc((count) * sizeof(type))
+#define LE_NEW_ARRAY(type, count) (type *) LE_RANGE_CHECK(type,count,uprv_malloc((count) * sizeof(type)))
/**
* Re-allocate an array of basic types. This is used to isolate the rest of
*
* @internal
*/
-#define LE_NEW_ARRAY(type, count) (type *) malloc((count) * sizeof(type))
+#define LE_NEW_ARRAY(type, count) LE_RANGE_CHECK(type,count,(type *) malloc((count) * sizeof(type)))
/**
* Re-allocate an array of basic types. This is used to isolate the rest of
* WARNING: THIS MACRO WILL ONLY WORK CORRECTLY IF
* THE ARGUMENT CHARACTERS ARE ASCII.
*
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_MAKE_TAG(a, b, c, d) \
(((le_uint32)(a) << 24) | \
* This enumeration defines constants for the standard
* TrueType, OpenType and AAT table tags.
*
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
enum LETableTags {
LE_ACNT_TABLE_TAG = 0x61636E74UL, /**< 'acnt' */
* This enumeration defines constants for all
* the common OpenType feature tags.
*
- * @stable ICU 3.2
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
enum LEFeatureTags {
LE_AALT_FEATURE_TAG = 0x61616C74UL, /**< 'aalt' */
* @}
*/
+#define LE_DEFAULT_FEATURE_FLAG (LE_Kerning_FEATURE_FLAG | LE_Ligatures_FEATURE_FLAG) /**< default features */
+
/**
* Error codes returned by the LayoutEngine.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
enum LEErrorCode {
/* informational */
/**
* Error codes returned by the LayoutEngine.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
typedef enum LEErrorCode LEErrorCode;
#endif
/**
* A convenience macro to test for the success of a LayoutEngine call.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_SUCCESS(code) (U_SUCCESS((UErrorCode)code))
/**
* A convenience macro to test for the failure of a LayoutEngine call.
*
- * @stable ICU 2.4
+ * @deprecated ICU 54. See {@link icu::LayoutEngine}
*/
#define LE_FAILURE(code) (U_FAILURE((UErrorCode)code))
+
#endif