chromium/third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.h"

// clang-format off
#include <hb.h>
#include <hb-ot.h>
// clang-format on

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"

namespace {
// HarfBuzz' hb_position_t is a 16.16 fixed-point value.
float HarfBuzzUnitsToFloat(hb_position_t value) {}

// Latin Modern, STIX Two, XITS, Asana, Deja Vu, Libertinus and TeX Gyre fonts
// provide at most 13 size variant and 5 assembly parts.
// See https://chromium-review.googlesource.com/c/chromium/src/+/2074678
constexpr unsigned kMaxHarfBuzzRecords =;

hb_direction_t HarfBuzzDirection(
    blink::OpenTypeMathStretchData::StretchAxis stretch_axis) {}

}  // namespace

namespace blink {

bool OpenTypeMathSupport::HasMathData(const HarfBuzzFace* harfbuzz_face) {}

std::optional<float> OpenTypeMathSupport::MathConstant(
    const HarfBuzzFace* harfbuzz_face,
    MathConstants constant) {}

std::optional<float> OpenTypeMathSupport::MathItalicCorrection(
    const HarfBuzzFace* harfbuzz_face,
    Glyph glyph) {}

GetHarfBuzzMathRecordGetter;

HarfBuzzMathRecordConverter;

template <typename HarfBuzzRecordType, typename RecordType>
Vector<RecordType> GetHarfBuzzMathRecord(
    const HarfBuzzFace* harfbuzz_face,
    Glyph base_glyph,
    OpenTypeMathStretchData::StretchAxis stretch_axis,
    GetHarfBuzzMathRecordGetter<HarfBuzzRecordType> getter,
    HarfBuzzMathRecordConverter<HarfBuzzRecordType, RecordType> converter,
    std::optional<RecordType> prepended_record) {}

Vector<OpenTypeMathStretchData::GlyphVariantRecord>
OpenTypeMathSupport::GetGlyphVariantRecords(
    const HarfBuzzFace* harfbuzz_face,
    Glyph base_glyph,
    OpenTypeMathStretchData::StretchAxis stretch_axis) {}

Vector<OpenTypeMathStretchData::GlyphPartRecord>
OpenTypeMathSupport::GetGlyphPartRecords(
    const HarfBuzzFace* harfbuzz_face,
    Glyph base_glyph,
    OpenTypeMathStretchData::StretchAxis stretch_axis,
    float* italic_correction) {}

}  // namespace blink