chromium/third_party/pdfium/core/fxge/cfx_font.cpp

// Copyright 2014 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#include "core/fxge/cfx_font.h"

#include <stdint.h>

#include <algorithm>
#include <limits>
#include <memory>
#include <utility>

#include "build/build_config.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/data_vector.h"
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/fx_stream.h"
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/cfx_fontcache.h"
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_glyphcache.h"
#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/scoped_font_transform.h"

namespace {

const CFX_Font::CharsetFontMap kDefaultTTFMap[] =;

FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {}

FX_RECT ScaledFXRectFromFTPos(FT_Pos left,
                              FT_Pos top,
                              FT_Pos right,
                              FT_Pos bottom,
                              int x_scale,
                              int y_scale) {}

#ifdef PDF_ENABLE_XFA
unsigned long FTStreamRead(FXFT_StreamRec* stream,
                           unsigned long offset,
                           unsigned char* buffer,
                           unsigned long count) {}

void FTStreamClose(FXFT_StreamRec* stream) {}
#endif  // PDF_ENABLE_XFA

bool ShouldAppendStyle(const ByteString& style) {}

}  // namespace

// static
const char CFX_Font::kUntitledFontName[] =;

// static
const char CFX_Font::kDefaultAnsiFontName[] =;

// static
const char CFX_Font::kUniversalDefaultFontName[] =;

// static
pdfium::span<const CFX_Font::CharsetFontMap> CFX_Font::GetDefaultTTFMapSpan() {}

// static
ByteString CFX_Font::GetDefaultFontNameByCharset(FX_Charset nCharset) {}

// static
FX_Charset CFX_Font::GetCharSetFromUnicode(uint16_t word) {}

CFX_Font::CFX_Font() = default;

int CFX_Font::GetSubstFontItalicAngle() const {}

#ifdef PDF_ENABLE_XFA
bool CFX_Font::LoadFile(RetainPtr<IFX_SeekableReadStream> pFile,
                        int nFaceIndex) {}

#if !BUILDFLAG(IS_WIN)
void CFX_Font::SetFace(RetainPtr<CFX_Face> face) {}

void CFX_Font::SetSubstFont(std::unique_ptr<CFX_SubstFont> subst) {}
#endif  // !BUILDFLAG(IS_WIN)
#endif  // PDF_ENABLE_XFA

CFX_Font::~CFX_Font() {}

void CFX_Font::LoadSubst(const ByteString& face_name,
                         bool bTrueType,
                         uint32_t flags,
                         int weight,
                         int italic_angle,
                         FX_CodePage code_page,
                         bool bVertical) {}

int CFX_Font::GetGlyphWidth(uint32_t glyph_index) const {}

int CFX_Font::GetGlyphWidth(uint32_t glyph_index,
                            int dest_width,
                            int weight) const {}

int CFX_Font::GetGlyphWidthImpl(uint32_t glyph_index,
                                int dest_width,
                                int weight) const {}

bool CFX_Font::LoadEmbedded(pdfium::span<const uint8_t> src_span,
                            bool force_vertical,
                            uint64_t object_tag) {}

bool CFX_Font::IsTTFont() const {}

int CFX_Font::GetAscent() const {}

int CFX_Font::GetDescent() const {}

std::optional<FX_RECT> CFX_Font::GetGlyphBBox(uint32_t glyph_index) {}

bool CFX_Font::IsItalic() const {}

bool CFX_Font::IsBold() const {}

bool CFX_Font::IsFixedWidth() const {}

#if defined(PDF_USE_SKIA)
bool CFX_Font::IsSubstFontBold() const {}
#endif

ByteString CFX_Font::GetPsName() const {}

ByteString CFX_Font::GetFamilyName() const {}

ByteString CFX_Font::GetFamilyNameOrUntitled() const {}

ByteString CFX_Font::GetBaseFontName() const {}

std::optional<FX_RECT> CFX_Font::GetRawBBox() const {}

std::optional<FX_RECT> CFX_Font::GetBBox() const {}

RetainPtr<CFX_GlyphCache> CFX_Font::GetOrCreateGlyphCache() const {}

void CFX_Font::ClearGlyphCache() {}

std::unique_ptr<CFX_Path> CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index,
                                                      int dest_width) const {}

const CFX_GlyphBitmap* CFX_Font::LoadGlyphBitmap(
    uint32_t glyph_index,
    bool bFontStyle,
    const CFX_Matrix& matrix,
    int dest_width,
    int anti_alias,
    CFX_TextRenderOptions* text_options) const {}

const CFX_Path* CFX_Font::LoadGlyphPath(uint32_t glyph_index,
                                        int dest_width) const {}

#if defined(PDF_USE_SKIA)
CFX_TypeFace* CFX_Font::GetDeviceCache() const {}
#endif