chromium/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc

// Copyright 2016 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/skia/skia_text_metrics.h"

#include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/skia/include/core/SkFont.h"
#include "third_party/skia/include/core/SkPath.h"

namespace blink {

namespace {

template <class T>
T* advance_by_byte_size(T* p, unsigned byte_size) {}

template <class T>
const T* advance_by_byte_size(const T* p, unsigned byte_size) {}

}  // namespace

void SkFontGetGlyphWidthForHarfBuzz(const SkFont& font,
                                    hb_codepoint_t codepoint,
                                    hb_position_t* width) {}

void SkFontGetGlyphWidthForHarfBuzz(const SkFont& font,
                                    unsigned count,
                                    const hb_codepoint_t* glyphs,
                                    const unsigned glyph_stride,
                                    hb_position_t* advances,
                                    unsigned advance_stride) {}

// HarfBuzz callback to retrieve glyph extents, mainly used by HarfBuzz for
// fallback mark positioning, i.e. the situation when the font does not have
// mark anchors or other mark positioning rules, but instead HarfBuzz is
// supposed to heuristically place combining marks around base glyphs. HarfBuzz
// does this by measuring "ink boxes" of glyphs, and placing them according to
// Unicode mark classes. Above, below, centered or left or right, etc.
void SkFontGetGlyphExtentsForHarfBuzz(const SkFont& font,
                                      hb_codepoint_t codepoint,
                                      hb_glyph_extents_t* extents) {}

void SkFontGetBoundsForGlyph(const SkFont& font, Glyph glyph, SkRect* bounds) {}

void SkFontGetBoundsForGlyphs(const SkFont& font,
                              const Vector<Glyph, 256>& glyphs,
                              SkRect* bounds) {}

float SkFontGetWidthForGlyph(const SkFont& font, Glyph glyph) {}

hb_position_t SkiaScalarToHarfBuzzPosition(SkScalar value) {}

}  // namespace blink