chromium/third_party/ots/src/src/gsub.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 "gsub.h"

#include <limits>
#include <vector>

#include "layout.h"
#include "maxp.h"

// GSUB - The Glyph Substitution Table
// http://www.microsoft.com/typography/otspec/gsub.htm

#define TABLE_NAME

namespace {

// The GSUB header size for table version 1.0
const size_t kGsubHeaderSize_1_0 =;
// GSUB header size v1.1
const size_t kGsubHeaderSize_1_1 =;

enum GSUB_TYPE {};

// Lookup type parsers.
bool ParseSingleSubstitution(const ots::Font *font,
                             const uint8_t *data, const size_t length);
bool ParseMutipleSubstitution(const ots::Font *font,
                              const uint8_t *data, const size_t length);
bool ParseAlternateSubstitution(const ots::Font *font,
                                const uint8_t *data, const size_t length);
bool ParseLigatureSubstitution(const ots::Font *font,
      const uint8_t *data, const size_t length);
bool ParseContextSubstitution(const ots::Font *font,
                              const uint8_t *data, const size_t length);
bool ParseChainingContextSubstitution(const ots::Font *font,
                                      const uint8_t *data,
                                      const size_t length);
bool ParseExtensionSubstitution(const ots::Font *font,
                                const uint8_t *data, const size_t length);
bool ParseReverseChainingContextSingleSubstitution(
    const ots::Font *font, const uint8_t *data, const size_t length);

const ots::LookupSubtableParser::TypeParser kGsubTypeParsers[] =;

const ots::LookupSubtableParser kGsubLookupSubtableParser =;

// Lookup Type 1:
// Single Substitution Subtable
bool ParseSingleSubstitution(const ots::Font *font,
                             const uint8_t *data, const size_t length) {}

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

// Lookup Type 2:
// Multiple Substitution Subtable
bool ParseMutipleSubstitution(const ots::Font *font,
                              const uint8_t *data, const size_t length) {}

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

// Lookup Type 3:
// Alternate Substitution Subtable
bool ParseAlternateSubstitution(const ots::Font *font,
                                const uint8_t *data, const size_t length) {}

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

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

// Lookup Type 4:
// Ligature Substitution Subtable
bool ParseLigatureSubstitution(const ots::Font *font,
                               const uint8_t *data, const size_t length) {}

// Lookup Type 5:
// Contextual Substitution Subtable
bool ParseContextSubstitution(const ots::Font *font,
                              const uint8_t *data, const size_t length) {}

// Lookup Type 6:
// Chaining Contextual Substitution Subtable
bool ParseChainingContextSubstitution(const ots::Font *font,
                                      const uint8_t *data,
                                      const size_t length) {}

// Lookup Type 7:
// Extension Substition
bool ParseExtensionSubstitution(const ots::Font *font,
                                const uint8_t *data, const size_t length) {}

// Lookup Type 8:
// Reverse Chaining Contexual Single Substitution Subtable
bool ParseReverseChainingContextSingleSubstitution(
    const ots::Font *font, const uint8_t *data, const size_t length) {}

}  // namespace

namespace ots {

bool OpenTypeGSUB::Parse(const uint8_t *data, size_t length) {}

bool OpenTypeGSUB::Serialize(OTSStream *out) {}

}  // namespace ots

#undef TABLE_NAME