#include "ots.h"
#include <sys/types.h>
#include <zlib.h>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <map>
#include <vector>
#include <woff2/decode.h>
#include "avar.h"
#include "cff.h"
#include "cmap.h"
#include "cvar.h"
#include "cvt.h"
#include "fpgm.h"
#include "fvar.h"
#include "gasp.h"
#include "gdef.h"
#include "glyf.h"
#include "gpos.h"
#include "gsub.h"
#include "gvar.h"
#include "hdmx.h"
#include "head.h"
#include "hhea.h"
#include "hmtx.h"
#include "hvar.h"
#include "kern.h"
#include "loca.h"
#include "ltsh.h"
#include "math_.h"
#include "maxp.h"
#include "mvar.h"
#include "name.h"
#include "os2.h"
#include "ots.h"
#include "post.h"
#include "prep.h"
#include "stat.h"
#include "vdmx.h"
#include "vhea.h"
#include "vmtx.h"
#include "vorg.h"
#include "vvar.h"
#ifdef OTS_GRAPHITE
#include "feat.h"
#include "glat.h"
#include "gloc.h"
#include "sile.h"
#include "silf.h"
#include "sill.h"
#endif
namespace ots {
struct Arena { … };
bool CheckTag(uint32_t tag_value) { … }
};
namespace {
#define OTS_MSG_TAG_(level,otf_,msg_,tag_) …
#define OTS_FAILURE_MSG_TAG(msg_,tag_) …
#define OTS_FAILURE_MSG_HDR(...) …
#define OTS_WARNING_MSG_HDR(...) …
const struct { … } supported_tables[] = …;
bool ValidateVersionTag(ots::Font *font) { … }
bool ProcessGeneric(ots::FontFile *header,
ots::Font *font,
uint32_t signature,
ots::OTSStream *output,
const uint8_t *data, size_t length,
const std::vector<ots::TableEntry>& tables,
ots::Buffer& file);
bool ProcessTTF(ots::FontFile *header,
ots::Font *font,
ots::OTSStream *output, const uint8_t *data, size_t length,
uint32_t offset = 0) { … }
bool ProcessTTC(ots::FontFile *header,
ots::OTSStream *output,
const uint8_t *data,
size_t length,
uint32_t index) { … }
bool ProcessWOFF(ots::FontFile *header,
ots::Font *font,
ots::OTSStream *output, const uint8_t *data, size_t length) { … }
bool ProcessWOFF2(ots::FontFile *header,
ots::OTSStream *output,
const uint8_t *data,
size_t length,
uint32_t index) { … }
ots::TableAction GetTableAction(const ots::FontFile *header, uint32_t tag) { … }
bool GetTableData(const uint8_t *data,
const ots::TableEntry& table,
ots::Arena &arena,
size_t *table_length,
const uint8_t **table_data) { … }
bool ProcessGeneric(ots::FontFile *header,
ots::Font *font,
uint32_t signature,
ots::OTSStream *output,
const uint8_t *data, size_t length,
const std::vector<ots::TableEntry>& tables,
ots::Buffer& file) { … }
}
namespace ots {
FontFile::~FontFile() { … }
bool Font::ParseTable(const TableEntry& table_entry, const uint8_t* data,
Arena &arena) { … }
Table* Font::GetTable(uint32_t tag) const { … }
Table* Font::GetTypedTable(uint32_t tag) const { … }
void Font::DropGraphite() { … }
void Font::DropVariations() { … }
bool Table::ShouldSerialize() { … }
void Table::Message(int level, const char *format, va_list va) { … }
bool Table::Error(const char *format, ...) { … }
bool Table::Warning(const char *format, ...) { … }
bool Table::Drop(const char *format, ...) { … }
bool Table::DropGraphite(const char *format, ...) { … }
bool Table::DropVariations(const char *format, ...) { … }
bool TablePassthru::Parse(const uint8_t *data, size_t length) { … }
bool TablePassthru::Serialize(OTSStream *out) { … }
bool OTSContext::Process(OTSStream *output,
const uint8_t *data,
size_t length,
uint32_t index) { … }
}