#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.h"
#include <hb.h>
#include <hb-ot.h>
#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 {
float HarfBuzzUnitsToFloat(hb_position_t value) { … }
constexpr unsigned kMaxHarfBuzzRecords = …;
hb_direction_t HarfBuzzDirection(
blink::OpenTypeMathStretchData::StretchAxis stretch_axis) { … }
}
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) { … }
}