提交 74ca7b58 编写于 作者: B Behdad Esfahbod

[OT] Implement operator[] for Coverage and ClassDef

上级 6c548b66
...@@ -66,7 +66,6 @@ namespace OT { ...@@ -66,7 +66,6 @@ namespace OT {
#define NOT_COVERED ((unsigned int) -1) #define NOT_COVERED ((unsigned int) -1)
/* /*
* *
* OpenType Layout Common Table Formats * OpenType Layout Common Table Formats
...@@ -1037,6 +1036,9 @@ struct CoverageFormat2 ...@@ -1037,6 +1036,9 @@ struct CoverageFormat2
struct Coverage struct Coverage
{ {
enum { SENTINEL = NOT_COVERED };
unsigned int operator[] (hb_codepoint_t glyph_id) { return get_coverage (glyph_id); }
unsigned int get_coverage (hb_codepoint_t glyph_id) const unsigned int get_coverage (hb_codepoint_t glyph_id) const
{ {
switch (u.format) { switch (u.format) {
...@@ -1484,6 +1486,9 @@ struct ClassDefFormat2 ...@@ -1484,6 +1486,9 @@ struct ClassDefFormat2
struct ClassDef struct ClassDef
{ {
enum { SENTINEL = 0 };
unsigned int operator[] (hb_codepoint_t glyph_id) { return get_class (glyph_id); }
unsigned int get_class (hb_codepoint_t glyph_id) const unsigned int get_class (hb_codepoint_t glyph_id) const
{ {
switch (u.format) { switch (u.format) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册