chromium/third_party/ots/src/src/layout.cc

// Copyright (c) 2011-2017 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 <limits>
#include <vector>

#include "fvar.h"
#include "gdef.h"

// OpenType Layout Common Table Formats
// http://www.microsoft.com/typography/otspec/chapter2.htm

#define TABLE_NAME

namespace {

// The 'DFLT' tag of script table.
const uint32_t kScriptTableTagDflt =;
// The value which represents there is no required feature index.
const uint16_t kNoRequiredFeatureIndexDefined =;
// The lookup flag bit which indicates existence of MarkFilteringSet.
const uint16_t kUseMarkFilteringSetBit =;
// The maximum type number of format for device tables.
const uint16_t kMaxDeltaFormatType =;
// In variation fonts, Device Tables are replaced by VariationIndex tables,
// indicated by this flag in the deltaFormat field.
const uint16_t kVariationIndex =;

struct ScriptRecord {};

struct LangSysRecord {};

struct FeatureRecord {};

bool ParseLangSysTable(const ots::Font *font,
                       ots::Buffer *subtable, const uint32_t tag,
                       const uint16_t num_features) {}

bool ParseScriptTable(const ots::Font *font,
                      const uint8_t *data, const size_t length,
                      const uint32_t tag, const uint16_t num_features) {}

bool ParseFeatureTable(const ots::Font *font,
                       const uint8_t *data, const size_t length,
                       const uint16_t num_lookups) {}

bool ParseLookupTable(ots::Font *font, const uint8_t *data,
                      const size_t length,
                      const ots::LookupSubtableParser* parser) {}

bool ParseClassDefFormat1(const ots::Font *font,
                          const uint8_t *data, size_t length,
                          const uint16_t num_glyphs,
                          const uint16_t num_classes) {}

bool ParseClassDefFormat2(const ots::Font *font,
                          const uint8_t *data, size_t length,
                          const uint16_t num_glyphs,
                          const uint16_t num_classes) {}

bool ParseCoverageFormat1(const ots::Font *font,
                          const uint8_t *data, size_t length,
                          const uint16_t num_glyphs,
                          const uint16_t expected_num_glyphs) {}

bool ParseCoverageFormat2(const ots::Font *font,
                          const uint8_t *data, size_t length,
                          const uint16_t num_glyphs,
                          const uint16_t expected_num_glyphs) {}

// Parsers for Contextual subtables in GSUB/GPOS tables.

bool ParseLookupRecord(const ots::Font *font,
                       ots::Buffer *subtable, const uint16_t num_glyphs,
                       const uint16_t num_lookups) {}

bool ParseRuleSubtable(const ots::Font *font,
                       const uint8_t *data, const size_t length,
                       const uint16_t num_glyphs,
                       const uint16_t num_lookups) {}

bool ParseRuleSetTable(const ots::Font *font,
                       const uint8_t *data, const size_t length,
                       const uint16_t num_glyphs,
                       const uint16_t num_lookups) {}

bool ParseContextFormat1(const ots::Font *font,
                         const uint8_t *data, const size_t length,
                         const uint16_t num_glyphs,
                         const uint16_t num_lookups) {}

bool ParseClassRuleTable(const ots::Font *font,
                         const uint8_t *data, const size_t length,
                         const uint16_t num_glyphs,
                         const uint16_t num_lookups) {}

bool ParseClassSetTable(const ots::Font *font,
                        const uint8_t *data, const size_t length,
                        const uint16_t num_glyphs,
                        const uint16_t num_lookups) {}

bool ParseContextFormat2(const ots::Font *font,
                         const uint8_t *data, const size_t length,
                         const uint16_t num_glyphs,
                         const uint16_t num_lookups) {}

bool ParseContextFormat3(const ots::Font *font,
                         const uint8_t *data, const size_t length,
                         const uint16_t num_glyphs,
                         const uint16_t num_lookups) {}

// Parsers for Chaning Contextual subtables in GSUB/GPOS tables.

bool ParseChainRuleSubtable(const ots::Font *font,
                            const uint8_t *data, const size_t length,
                            const uint16_t num_glyphs,
                            const uint16_t num_lookups) {}

bool ParseChainRuleSetTable(const ots::Font *font,
                            const uint8_t *data, const size_t length,
                            const uint16_t num_glyphs,
                            const uint16_t num_lookups) {}

bool ParseChainContextFormat1(const ots::Font *font,
                              const uint8_t *data, const size_t length,
                              const uint16_t num_glyphs,
                              const uint16_t num_lookups) {}

bool ParseChainClassRuleSubtable(const ots::Font *font,
                                 const uint8_t *data, const size_t length,
                                 const uint16_t num_glyphs,
                                 const uint16_t num_lookups) {}

bool ParseChainClassSetTable(const ots::Font *font,
                             const uint8_t *data, const size_t length,
                             const uint16_t num_glyphs,
                             const uint16_t num_lookups) {}

bool ParseChainContextFormat2(const ots::Font *font,
                              const uint8_t *data, const size_t length,
                              const uint16_t num_glyphs,
                              const uint16_t num_lookups) {}

bool ParseChainContextFormat3(const ots::Font *font,
                              const uint8_t *data, const size_t length,
                              const uint16_t num_glyphs,
                              const uint16_t num_lookups) {}

}  // namespace

namespace ots {

bool LookupSubtableParser::Parse(const Font *font, const uint8_t *data,
                                 const size_t length,
                                 const uint16_t lookup_type) const {}

// Parsing ScriptListTable requires number of features so we need to
// parse FeatureListTable before calling this function.
bool ParseScriptListTable(const ots::Font *font,
                          const uint8_t *data, const size_t length,
                          const uint16_t num_features) {}

// Parsing FeatureListTable requires number of lookups so we need to parse
// LookupListTable before calling this function.
bool ParseFeatureListTable(const ots::Font *font,
                           const uint8_t *data, const size_t length,
                           const uint16_t num_lookups,
                           uint16_t* num_features) {}

// For parsing GPOS/GSUB tables, this function should be called at first to
// obtain the number of lookups because parsing FeatureTableList requires
// the number.
bool ParseLookupListTable(Font *font, const uint8_t *data,
                          const size_t length,
                          const LookupSubtableParser* parser,
                          uint16_t *num_lookups) {}

bool ParseClassDefTable(const ots::Font *font,
                        const uint8_t *data, size_t length,
                        const uint16_t num_glyphs,
                        const uint16_t num_classes) {}

bool ParseCoverageTable(const ots::Font *font,
                        const uint8_t *data, size_t length,
                        const uint16_t num_glyphs,
                        const uint16_t expected_num_glyphs) {}

bool ParseDeviceTable(const ots::Font *font,
                      const uint8_t *data, size_t length) {}

bool ParseContextSubtable(const ots::Font *font,
                          const uint8_t *data, const size_t length,
                          const uint16_t num_glyphs,
                          const uint16_t num_lookups) {}

bool ParseChainingContextSubtable(const ots::Font *font,
                                  const uint8_t *data, const size_t length,
                                  const uint16_t num_glyphs,
                                  const uint16_t num_lookups) {}

bool ParseExtensionSubtable(const Font *font,
                            const uint8_t *data, const size_t length,
                            const LookupSubtableParser* parser) {}

bool ParseConditionTable(const Font *font,
                         const uint8_t *data, const size_t length,
                         const uint16_t axis_count) {}

bool ParseConditionSetTable(const Font *font,
                            const uint8_t *data, const size_t length,
                            const uint16_t axis_count) {}

bool ParseFeatureTableSubstitutionTable(const Font *font,
                                        const uint8_t *data, const size_t length,
                                        const uint16_t num_lookups) {}

bool ParseFeatureVariationsTable(const Font *font,
                                 const uint8_t *data, const size_t length,
                                 const uint16_t num_lookups) {}

}  // namespace ots

#undef TABLE_NAME