| Index: third_party/ots/src/vdmx.cc
|
| diff --git a/third_party/ots/src/vdmx.cc b/third_party/ots/src/vdmx.cc
|
| index 4853d631a439c454af9133e72ff4a0dd11d7ed6f..cd80946aee50b1965a4d9e1882a23a9159383712 100644
|
| --- a/third_party/ots/src/vdmx.cc
|
| +++ b/third_party/ots/src/vdmx.cc
|
| @@ -11,18 +11,18 @@
|
|
|
| #define DROP_THIS_TABLE(...) \
|
| do { \
|
| - OTS_FAILURE_MSG_(file, TABLE_NAME ": " __VA_ARGS__); \
|
| + OTS_FAILURE_MSG_(font->file, TABLE_NAME ": " __VA_ARGS__); \
|
| OTS_FAILURE_MSG("Table discarded"); \
|
| - delete file->vdmx; \
|
| - file->vdmx = 0; \
|
| + delete font->vdmx; \
|
| + font->vdmx = 0; \
|
| } while (0)
|
|
|
| namespace ots {
|
|
|
| -bool ots_vdmx_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
|
| +bool ots_vdmx_parse(Font *font, const uint8_t *data, size_t length) {
|
| Buffer table(data, length);
|
| - file->vdmx = new OpenTypeVDMX;
|
| - OpenTypeVDMX * const vdmx = file->vdmx;
|
| + font->vdmx = new OpenTypeVDMX;
|
| + OpenTypeVDMX * const vdmx = font->vdmx;
|
|
|
| if (!table.ReadU16(&vdmx->version) ||
|
| !table.ReadU16(&vdmx->num_recs) ||
|
| @@ -121,13 +121,13 @@ bool ots_vdmx_parse(OpenTypeFile *file, const uint8_t *data, size_t length) {
|
| return true;
|
| }
|
|
|
| -bool ots_vdmx_should_serialise(OpenTypeFile *file) {
|
| - if (!file->glyf) return false; // this table is not for CFF fonts.
|
| - return file->vdmx != NULL;
|
| +bool ots_vdmx_should_serialise(Font *font) {
|
| + if (!font->glyf) return false; // this table is not for CFF fonts.
|
| + return font->vdmx != NULL;
|
| }
|
|
|
| -bool ots_vdmx_serialise(OTSStream *out, OpenTypeFile *file) {
|
| - OpenTypeVDMX * const vdmx = file->vdmx;
|
| +bool ots_vdmx_serialise(OTSStream *out, Font *font) {
|
| + OpenTypeVDMX * const vdmx = font->vdmx;
|
|
|
| if (!out->WriteU16(vdmx->version) ||
|
| !out->WriteU16(vdmx->num_recs) ||
|
| @@ -171,8 +171,13 @@ bool ots_vdmx_serialise(OTSStream *out, OpenTypeFile *file) {
|
| return true;
|
| }
|
|
|
| -void ots_vdmx_free(OpenTypeFile *file) {
|
| - delete file->vdmx;
|
| +void ots_vdmx_reuse(Font *font, Font *other) {
|
| + font->vdmx = other->vdmx;
|
| + font->vdmx_reused = true;
|
| +}
|
| +
|
| +void ots_vdmx_free(Font *font) {
|
| + delete font->vdmx;
|
| }
|
|
|
| } // namespace ots
|
|
|