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

#include <limits>
#include <vector>

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

// GPOS - The Glyph Positioning Table
// http://www.microsoft.com/typography/otspec/gpos.htm

#define TABLE_NAME

namespace {

enum GPOS_TYPE {};

// The size of gpos header, version 1.0.
const unsigned kGposHeaderSize_1_0 =;
// The size of gpos header, version 1.1.
const unsigned kGposHeaderSize_1_1 =;
// The maximum format number for anchor tables.
const uint16_t kMaxAnchorFormat =;

// Lookup type parsers.
bool ParseSingleAdjustment(const ots::Font *font,
                           const uint8_t *data, const size_t length);
bool ParsePairAdjustment(const ots::Font *font,
                         const uint8_t *data, const size_t length);
bool ParseCursiveAttachment(const ots::Font *font,
                            const uint8_t *data, const size_t length);
bool ParseMarkToBaseAttachment(const ots::Font *font,
                               const uint8_t *data, const size_t length);
bool ParseMarkToLigatureAttachment(const ots::Font *font,
                                   const uint8_t *data, const size_t length);
bool ParseMarkToMarkAttachment(const ots::Font *font,
                               const uint8_t *data, const size_t length);
bool ParseContextPositioning(const ots::Font *font,
                             const uint8_t *data, const size_t length);
bool ParseChainedContextPositioning(const ots::Font *font,
                                    const uint8_t *data, const size_t length);
bool ParseExtensionPositioning(const ots::Font *font,
                               const uint8_t *data, const size_t length);

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

const ots::LookupSubtableParser kGposLookupSubtableParser =;

// Shared Tables: ValueRecord, Anchor Table, and MarkArray

size_t CalcValueRecordSize(const uint16_t value_format) {}

bool ParseValueRecord(const ots::Font *font,
                      ots::Buffer* subtable,
                      const uint16_t value_format) {}

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

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

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

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

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

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

// Lookup Type 2:
// Pair Adjustment Positioning Subtable
bool ParsePairAdjustment(const ots::Font *font, const uint8_t *data,
                         const size_t length) {}

// Lookup Type 3
// Cursive Attachment Positioning Subtable
bool ParseCursiveAttachment(const ots::Font *font, const uint8_t *data,
                            const size_t length) {}

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

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

// Common parser for Lookup Type 4, 5 and 6.
bool ParseMarkToAttachmentSubtables(const ots::Font *font,
                                    const uint8_t *data, const size_t length,
                                    const GPOS_TYPE type) {}

// Lookup Type 4:
// MarkToBase Attachment Positioning Subtable
bool ParseMarkToBaseAttachment(const ots::Font *font,
                               const uint8_t *data, const size_t length) {}

// Lookup Type 5:
// MarkToLigature Attachment Positioning Subtable
bool ParseMarkToLigatureAttachment(const ots::Font *font,
                                   const uint8_t *data, const size_t length) {}

// Lookup Type 6:
// MarkToMark Attachment Positioning Subtable
bool ParseMarkToMarkAttachment(const ots::Font *font,
                               const uint8_t *data, const size_t length) {}

// Lookup Type 7:
// Contextual Positioning Subtables
bool ParseContextPositioning(const ots::Font *font,
                             const uint8_t *data, const size_t length) {}

// Lookup Type 8:
// Chaining Contexual Positioning Subtable
bool ParseChainedContextPositioning(const ots::Font *font,
                                    const uint8_t *data, const size_t length) {}

// Lookup Type 9:
// Extension Positioning
bool ParseExtensionPositioning(const ots::Font *font,
                               const uint8_t *data, const size_t length) {}

}  // namespace

namespace ots {

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

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

}  // namespace ots

#undef TABLE_NAME