[CBDT] Implement Format18 get_extens
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 30 Oct 2018 20:16:07 +0000 (13:16 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 30 Oct 2018 20:16:07 +0000 (13:16 -0700)
Part of https://github.com/harfbuzz/harfbuzz/issues/1327

src/hb-ot-color-cbdt-table.hh

index f1b1196..614cc80 100644 (file)
@@ -437,8 +437,16 @@ struct CBDT
            const GlyphBitmapDataFormat17& glyphFormat17 =
                StructAtOffset<GlyphBitmapDataFormat17> (this->cbdt, image_offset);
            glyphFormat17.glyphMetrics.get_extents (extents);
+           break;
+         }
+         case 18: {
+           if (unlikely (image_length < GlyphBitmapDataFormat18::min_size))
+             return false;
+           const GlyphBitmapDataFormat18& glyphFormat18 =
+               StructAtOffset<GlyphBitmapDataFormat18> (this->cbdt, image_offset);
+           glyphFormat18.glyphMetrics.get_extents (extents);
+           break;
          }
-         break;
          default:
            // TODO: Support other image formats.
            return false;