#include "components/services/font/font_service_app.h"
#include <utility>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/services/font/fontconfig_matching.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "pdf/buildflags.h"
#include "skia/ext/skia_utils_base.h"
#include "ui/gfx/font_fallback_linux.h"
#include "ui/gfx/font_render_params.h"
#if BUILDFLAG(ENABLE_PDF)
#include "components/services/font/pdf_fontconfig_matching.h"
#endif
static_assert …;
static_assert …;
static_assert …;
namespace {
base::File GetFileForPath(const base::FilePath& path) { … }
int ConvertHinting(gfx::FontRenderParams::Hinting hinting) { … }
font_service::mojom::RenderStyleSwitch ConvertSubpixelRendering(
gfx::FontRenderParams::SubpixelRendering rendering) { … }
constexpr int kCacheFontFamilyMaxSize = …;
}
namespace font_service {
FontServiceApp::FontServiceApp() : … { … }
FontServiceApp::~FontServiceApp() = default;
void FontServiceApp::BindReceiver(
mojo::PendingReceiver<mojom::FontService> receiver) { … }
void FontServiceApp::MatchFamilyName(const std::string& family_name,
mojom::TypefaceStylePtr requested_style,
MatchFamilyNameCallback callback) { … }
void FontServiceApp::OpenStream(uint32_t id_number,
OpenStreamCallback callback) { … }
void FontServiceApp::FallbackFontForCharacter(
uint32_t character,
const std::string& locale,
FallbackFontForCharacterCallback callback) { … }
void FontServiceApp::FontRenderStyleForStrike(
const std::string& family,
uint32_t size,
bool is_bold,
bool is_italic,
float device_scale_factor,
FontRenderStyleForStrikeCallback callback) { … }
void FontServiceApp::MatchFontByPostscriptNameOrFullFontName(
const std::string& family,
MatchFontByPostscriptNameOrFullFontNameCallback callback) { … }
#if BUILDFLAG(ENABLE_PDF)
void FontServiceApp::MatchFontWithFallback(
const std::string& family,
bool is_bold,
bool is_italic,
uint32_t charset,
uint32_t fallbackFamilyType,
MatchFontWithFallbackCallback callback) { … }
#endif
size_t FontServiceApp::FindOrAddPath(const base::FilePath& path) { … }
FontServiceApp::MatchCacheValue::MatchCacheValue() = default;
FontServiceApp::MatchCacheValue::~MatchCacheValue() = default;
FontServiceApp::MatchCacheValue::MatchCacheValue(MatchCacheValue&&) = default;
}