// Copyright (c) 2018 The OTS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
#include"layout.h"
#include"fvar.h"
// OpenType Variations Common Table Formats
#define TABLE_NAME "Variations"// XXX: use individual table names
if (wordDeltaCount > *regionIndexCount) { return OTS_FAILURE_MSG("Bad word delta count");
}
for (unsigned i = 0; i < *regionIndexCount; i++) {
uint16_t regionIndex; if (!subtable.ReadU16(®ionIndex) || regionIndex >= regionCount) { return OTS_FAILURE_MSG("Bad region index");
}
}
if (!subtable.Skip(valueSize * size_t(itemCount) * (size_t(wordDeltaCount) + size_t(*regionIndexCount)))) { return OTS_FAILURE_MSG("Failed to read delta data");
}
if (!subtable.ReadU16(&format) ||
!subtable.ReadU32(&variationRegionListOffset) ||
!subtable.ReadU16(&itemVariationDataCount)) { return OTS_FAILURE_MSG("Failed to read item variation store header");
}
if (format != 1) { return OTS_FAILURE_MSG("Unknown item variation store format");
}
if (variationRegionListOffset < subtable.offset() + 4 * itemVariationDataCount ||
variationRegionListOffset > length) { return OTS_FAILURE_MSG("Invalid variation region list offset");
}
uint16_t regionCount; if (!ParseVariationRegionList(font,
data + variationRegionListOffset,
length - variationRegionListOffset,
®ionCount)) { return OTS_FAILURE_MSG("Failed to parse variation region list");
}
for (unsigned i = 0; i < itemVariationDataCount; i++) {
uint32_t offset; if (!subtable.ReadU32(&offset)) { return OTS_FAILURE_MSG("Failed to read variation data subtable offset");
} if (offset >= length) { return OTS_FAILURE_MSG("Bad offset to variation data subtable");
}
uint16_t regionIndexCount = 0; if (!ParseVariationDataSubtable(font, data + offset, length - offset,
regionCount,
®ionIndexCount)) { return OTS_FAILURE_MSG("Failed to parse variation data subtable");
} if (regionIndexCounts) {
regionIndexCounts->push_back(regionIndexCount);
}
}
if (!(tupleIndex & EMBEDDED_PEAK_TUPLE)) {
tupleIndex &= TUPLE_INDEX_MASK; if (tupleIndex >= sharedTupleCount) { return OTS_FAILURE_MSG("Tuple index out of range");
}
}
}
// TODO: we don't attempt to interpret the serialized data block
returntrue;
}
} // namespace ots
#undef TABLE_NAME
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.