Add woff2 encoder/decoder support for overlapSimpleBitmap.

overlapSimpleBitmap is a new field in the transformed glyf table (https://www.w3.org/TR/WOFF2/#glyf_table_format). It allows the overlap simple flag set on glyphs in the original font to be saved into the woff2 encoding.
This commit is contained in:
Garret Rieger
2022-03-29 13:49:27 -07:00
parent a0d0ed7da2
commit 62ae7a4c1e
12 changed files with 105 additions and 59 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ struct WOFF2Params {
// Returns an upper bound on the size of the compressed file.
size_t MaxWOFF2CompressedSize(const uint8_t* data, size_t length);
size_t MaxWOFF2CompressedSize(const uint8_t* data, size_t length,
const std::string& extended_metadata);
size_t MaxWOFF2CompressedSize(const uint8_t *data, size_t length,
const std::string &extended_metadata);
// Compresses the font into the target buffer. *result_length should be at least
// the value returned by MaxWOFF2CompressedSize(), upon return, it is set to the
+2 -2
View File
@@ -51,7 +51,7 @@ class WOFF2StringOut : public WOFF2Out {
// Create a writer that writes its data to buf.
// buf->size() will grow to at most max_size
// buf may be sized (e.g. using EstimateWOFF2FinalSize) or empty.
explicit WOFF2StringOut(std::string* buf);
explicit WOFF2StringOut(std::string *buf);
bool Write(const void *buf, size_t n) override;
bool Write(const void *buf, size_t offset, size_t n) override;
@@ -59,7 +59,7 @@ class WOFF2StringOut : public WOFF2Out {
size_t MaxSize() { return max_size_; }
void SetMaxSize(size_t max_size);
private:
std::string* buf_;
std::string *buf_;
size_t max_size_;
size_t offset_;
};