mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 18:13:53 +01:00
[layout] Fix comparison of GlyphID and hb_codepoint_t
Before, the IntType::cmp functions providing this and was truncating the hb_codepoint_t to 16bits before comparison. I have no idea how this was never discovered, and I'm too lazy to try to reproduce this with Pango (which uses non-16bit codepoint numbers for missing glyphs).
This commit is contained in:
1 parent
7cce809cb1
commit
5175300fba
1 file changed
+4
-1
@@ -660,7 +660,10 @@ struct Tag : ULONG
|
||||
DEFINE_NULL_DATA (Tag, " ");
|
||||
|
||||
/* Glyph index number, same as uint16 (length = 16 bits) */
|
||||
typedef USHORT GlyphID;
|
||||
struct GlyphID : USHORT {
|
||||
static inline int cmp (const GlyphID *a, const GlyphID *b) { return b->USHORT::cmp (*a); }
|
||||
inline int cmp (hb_codepoint_t a) const { return (int) a - (int) *this; }
|
||||
};
|
||||
|
||||
/* Script/language-system/feature index */
|
||||
struct Index : USHORT {
|
||||
|
||||
Reference in new issue
Block a user