#include "pdf/pdfium/pdfium_font_linux.h"
#include <stddef.h>
#include <stdint.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <limits>
#include <memory>
#include <string>
#include "base/check_op.h"
#include "base/containers/heap_array.h"
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/i18n/encoding_detection.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/no_destructor.h"
#include "base/numerics/byte_conversions.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
#include "base/sequence_checker.h"
#include "base/strings/string_util.h"
#include "components/services/font/public/cpp/font_loader.h"
#include "pdf/pdfium/pdfium_engine.h"
#include "pdf/pdfium/pdfium_font_helpers.h"
#include "third_party/blink/public/platform/web_font_description.h"
#include "third_party/pdfium/public/fpdf_sysfontinfo.h"
namespace chrome_pdf {
namespace {
bool GetFontTable(int fd,
uint32_t table_tag,
uint8_t* output,
size_t* output_length) { … }
class BlinkFontMapper { … };
BlinkFontMapper& GetBlinkFontMapper() { … }
void EnumFonts(FPDF_SYSFONTINFO* sysfontinfo, void* mapper) { … }
void* MapFont(FPDF_SYSFONTINFO*,
int weight,
int italic,
int charset,
int pitch_family,
const char* face,
int* exact) { … }
unsigned long GetFontData(FPDF_SYSFONTINFO*,
void* font_id,
unsigned int table,
unsigned char* buffer,
unsigned long buf_size) { … }
void DeleteFont(FPDF_SYSFONTINFO*, void* font_id) { … }
FPDF_SYSFONTINFO g_font_info = …;
}
void InitializeLinuxFontMapper() { … }
}