#include "third_party/blink/renderer/core/html/canvas/text_metrics.h"
#include "base/numerics/checked_math.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_baselines.h"
#include "third_party/blink/renderer/core/geometry/dom_rect_read_only.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/fonts/character_range.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/font_metrics.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/text/bidi_paragraph.h"
namespace blink {
constexpr int kHangingAsPercentOfAscent = …;
float TextMetrics::GetFontBaseline(const TextBaseline& text_baseline,
const SimpleFontData& font_data) { … }
void TextMetrics::Trace(Visitor* visitor) const { … }
TextMetrics::TextMetrics() : … { … }
TextMetrics::TextMetrics(const Font& font,
const TextDirection& direction,
const TextBaseline& baseline,
const TextAlign& align,
const String& text)
: … { … }
namespace {
const ShapeResult* ShapeWord(const TextRun& word_run, const Font& font) { … }
}
void TextMetrics::Update(const Font& font,
const TextDirection& direction,
const TextBaseline& baseline,
const TextAlign& align,
const String& text) { … }
void TextMetrics::ShapeTextIfNeeded() { … }
const HeapVector<Member<DOMRectReadOnly>> TextMetrics::getSelectionRects(
uint32_t start,
uint32_t end,
ExceptionState& exception_state) { … }
const DOMRectReadOnly* TextMetrics::getActualBoundingBox(
uint32_t start,
uint32_t end,
ExceptionState& exception_state) { … }
unsigned TextMetrics::caretPositionFromPoint(double x) { … }
}