#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h"
#include <hb.h>
#include <hb-cplusplus.hh>
#include <hb-ot.h>
#include <memory>
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/font_global_context.h"
#include "third_party/blink/renderer/platform/fonts/font_platform_data.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/variation_selector_mode.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h"
#include "third_party/blink/renderer/platform/fonts/unicode_range_set.h"
#include "third_party/blink/renderer/platform/resolution_units.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/text/character.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/thread_specific.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkPoint.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkTypeface.h"
namespace blink {
HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data,
uint64_t unique_id)
: … { … }
void HarfBuzzFace::Trace(Visitor* visitor) const { … }
VariationSelectorMode& GetIgnoreVariationSelectorModeRef() { … }
VariationSelectorMode HarfBuzzFace::GetVariationSelectorMode() { … }
void HarfBuzzFace::SetVariationSelectorMode(VariationSelectorMode value) { … }
bool& GetIsSystemFallbackStageRef() { … }
bool HarfBuzzFace::GetIsSystemFallbackStage() { … }
void HarfBuzzFace::SetIsSystemFallbackStage(bool value) { … }
static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font,
void* font_data,
hb_codepoint_t unicode,
hb_codepoint_t variation_selector,
hb_codepoint_t* glyph,
void* user_data) { … }
static hb_bool_t HarfBuzzGetNominalGlyph(hb_font_t* hb_font,
void* font_data,
hb_codepoint_t unicode,
hb_codepoint_t* glyph,
void* user_data) { … }
static hb_position_t HarfBuzzGetGlyphHorizontalAdvance(hb_font_t* hb_font,
void* font_data,
hb_codepoint_t glyph,
void* user_data) { … }
static void HarfBuzzGetGlyphHorizontalAdvances(
hb_font_t* font,
void* font_data,
unsigned count,
const hb_codepoint_t* first_glyph,
unsigned int glyph_stride,
hb_position_t* first_advance,
unsigned int advance_stride,
void* user_data) { … }
static hb_bool_t HarfBuzzGetGlyphVerticalOrigin(hb_font_t* hb_font,
void* font_data,
hb_codepoint_t glyph,
hb_position_t* x,
hb_position_t* y,
void* user_data) { … }
static hb_position_t HarfBuzzGetGlyphVerticalAdvance(hb_font_t* hb_font,
void* font_data,
hb_codepoint_t glyph,
void* user_data) { … }
static hb_bool_t HarfBuzzGetGlyphExtents(hb_font_t* hb_font,
void* font_data,
hb_codepoint_t glyph,
hb_glyph_extents_t* extents,
void* user_data) { … }
static inline bool TableHasSpace(hb_face_t* face,
hb_set_t* glyphs,
hb_tag_t tag,
hb_codepoint_t space) { … }
static bool GetSpaceGlyph(hb_font_t* font, hb_codepoint_t& space) { … }
bool HarfBuzzFace::HasSpaceInLigaturesOrKerning(TypesettingFeatures features) { … }
unsigned HarfBuzzFace::UnitsPerEmFromHeadTable() { … }
Glyph HarfBuzzFace::HbGlyphForCharacter(UChar32 character) { … }
hb_codepoint_t HarfBuzzFace::HarfBuzzGetGlyphForTesting(
UChar32 character,
UChar32 variation_selector) { … }
bool HarfBuzzFace::ShouldSubpixelPosition() { … }
class HarfBuzzSkiaFontFuncs final { … };
static hb_blob_t* HarfBuzzSkiaGetTable(hb_face_t* face,
hb_tag_t tag,
void* user_data) { … }
static hb::unique_ptr<hb_face_t> CreateFace(
const FontPlatformData* platform_data) { … }
namespace {
HarfBuzzFontData* CreateHarfBuzzFontData(hb_face_t* face,
SkTypeface* typeface) { … }
}
HarfBuzzFontData* HarfBuzzFontCache::GetOrCreate(
uint64_t unique_id,
const FontPlatformData* platform_data) { … }
static_assert …;
const OpenTypeVerticalData& HarfBuzzFace::VerticalData() const { … }
hb_font_t* HarfBuzzFace::GetScaledFont(const UnicodeRangeSet* range_set,
VerticalLayoutCallbacks vertical_layout,
float specified_size) const { … }
hb_font_t* HarfBuzzFace::GetScaledFont() const { … }
void HarfBuzzFace::Init() { … }
}