Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CFX_Font Class Reference

#include <cfx_font.h>

+ Collaboration diagram for CFX_Font:

Classes

struct  CharsetFontMap
 

Public Types

enum class  FontType { kUnknown , kCIDTrueType }
 

Public Member Functions

 CFX_Font ()
 
 ~CFX_Font ()
 
void LoadSubst (const ByteString &face_name, bool bTrueType, uint32_t flags, int weight, int italic_angle, FX_CodePage code_page, bool bVertical)
 
bool LoadEmbedded (pdfium::span< const uint8_t > src_span, bool force_vertical, uint64_t object_tag)
 
RetainPtr< CFX_FaceGetFace () const
 
FXFT_FaceRecGetFaceRec () const
 
CFX_SubstFontGetSubstFont () const
 
int GetSubstFontItalicAngle () const
 
const CFX_GlyphBitmapLoadGlyphBitmap (uint32_t glyph_index, bool bFontStyle, const CFX_Matrix &matrix, int dest_width, int anti_alias, CFX_TextRenderOptions *text_options) const
 
const CFX_PathLoadGlyphPath (uint32_t glyph_index, int dest_width) const
 
int GetGlyphWidth (uint32_t glyph_index) const
 
int GetGlyphWidth (uint32_t glyph_index, int dest_width, int weight) const
 
int GetAscent () const
 
int GetDescent () const
 
absl::optional< FX_RECTGetGlyphBBox (uint32_t glyph_index)
 
bool IsItalic () const
 
bool IsBold () const
 
bool IsFixedWidth () const
 
bool IsVertical () const
 
ByteString GetPsName () const
 
ByteString GetFamilyName () const
 
ByteString GetFaceName () const
 
ByteString GetBaseFontName () const
 
bool IsTTFont () const
 
absl::optional< FX_RECTGetRawBBox () const
 
absl::optional< FX_RECTGetBBox () const
 
bool IsEmbedded () const
 
FontType GetFontType () const
 
void SetFontType (FontType type)
 
uint64_t GetObjectTag () const
 
pdfium::span< uint8_t > GetFontSpan () const
 
std::unique_ptr< CFX_PathLoadGlyphPathImpl (uint32_t glyph_index, int dest_width) const
 
int GetGlyphWidthImpl (uint32_t glyph_index, int dest_width, int weight) const
 

Static Public Member Functions

static ByteString GetDefaultFontNameByCharset (FX_Charset nCharset)
 
static FX_Charset GetCharSetFromUnicode (uint16_t word)
 

Static Public Attributes

static const CharsetFontMap kDefaultTTFMap []
 
static const char kUntitledFontName [] = "Untitled"
 
static const char kDefaultAnsiFontName [] = "Helvetica"
 
static const char kUniversalDefaultFontName [] = "Arial Unicode MS"
 

Detailed Description

Definition at line 37 of file cfx_font.h.

Member Enumeration Documentation

◆ FontType

enum class CFX_Font::FontType
strong
Enumerator
kUnknown 
kCIDTrueType 

Definition at line 45 of file cfx_font.h.

Constructor & Destructor Documentation

◆ CFX_Font()

CFX_Font::CFX_Font ( )
default

◆ ~CFX_Font()

CFX_Font::~CFX_Font ( )

Definition at line 211 of file cfx_font.cpp.

Member Function Documentation

◆ GetAscent()

int CFX_Font::GetAscent ( ) const

Definition at line 277 of file cfx_font.cpp.

◆ GetBaseFontName()

ByteString CFX_Font::GetBaseFontName ( ) const

Definition at line 394 of file cfx_font.cpp.

References fxcrt::ByteString::ByteString(), GetPsName(), fxcrt::ByteString::IsEmpty(), IsTTFont(), kUntitledFontName, fxcrt::ByteString::operator!=(), fxcrt::operator+(), and fxcrt::ByteString::operator+=().

+ Here is the call graph for this function:

◆ GetBBox()

absl::optional< FX_RECT > CFX_Font::GetBBox ( ) const

Definition at line 418 of file cfx_font.cpp.

References FX_RECT::bottom, FX_RECT::left, FX_RECT::right, and FX_RECT::top.

◆ GetCharSetFromUnicode()

FX_Charset CFX_Font::GetCharSetFromUnicode ( uint16_t word)
static

Definition at line 112 of file cfx_font.cpp.

References kANSI, kChineseSimplified, kHangul, kMSWin_Arabic, kMSWin_Cyrillic, kMSWin_EasternEuropean, kMSWin_Greek, kMSWin_Hebrew, kMSWin_Vietnamese, kShiftJIS, and kThai.

Referenced by CPDF_BAFontMap::CharSetFromUnicode().

+ Here is the caller graph for this function:

◆ GetDefaultFontNameByCharset()

ByteString CFX_Font::GetDefaultFontNameByCharset ( FX_Charset nCharset)
static

Definition at line 103 of file cfx_font.cpp.

References kDefaultTTFMap, and kUniversalDefaultFontName.

◆ GetDescent()

int CFX_Font::GetDescent ( ) const

Definition at line 281 of file cfx_font.cpp.

Referenced by CBC_OneDimWriter::CalcTextInfo().

+ Here is the caller graph for this function:

◆ GetFace()

RetainPtr< CFX_Face > CFX_Font::GetFace ( ) const
inline

Definition at line 78 of file cfx_font.h.

◆ GetFaceName()

ByteString CFX_Font::GetFaceName ( ) const

Definition at line 381 of file cfx_font.cpp.

References fxcrt::ByteString::ByteString(), fxcrt::operator+(), and fxcrt::ByteString::operator+=().

+ Here is the call graph for this function:

◆ GetFaceRec()

FXFT_FaceRec * CFX_Font::GetFaceRec ( ) const
inline

Definition at line 79 of file cfx_font.h.

Referenced by CFX_RenderDevice::DrawNormalText().

+ Here is the caller graph for this function:

◆ GetFamilyName()

ByteString CFX_Font::GetFamilyName ( ) const

Definition at line 368 of file cfx_font.cpp.

References fxcrt::ByteString::ByteString().

Referenced by FPDFFont_GetFontName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFontSpan()

pdfium::span< uint8_t > CFX_Font::GetFontSpan ( ) const
inline

Definition at line 128 of file cfx_font.h.

◆ GetFontType()

FontType CFX_Font::GetFontType ( ) const
inline

Definition at line 125 of file cfx_font.h.

◆ GetGlyphBBox()

absl::optional< FX_RECT > CFX_Font::GetGlyphBBox ( uint32_t glyph_index)

Definition at line 285 of file cfx_font.cpp.

◆ GetGlyphWidth() [1/2]

int CFX_Font::GetGlyphWidth ( uint32_t glyph_index) const

Definition at line 239 of file cfx_font.cpp.

References GetGlyphWidth().

Referenced by CBC_OneDimWriter::CalcTextInfo(), and GetCharPosList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGlyphWidth() [2/2]

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

Definition at line 243 of file cfx_font.cpp.

Referenced by GetGlyphWidth().

+ Here is the caller graph for this function:

◆ GetGlyphWidthImpl()

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

Definition at line 250 of file cfx_font.cpp.

◆ GetObjectTag()

uint64_t CFX_Font::GetObjectTag ( ) const
inline

Definition at line 127 of file cfx_font.h.

Referenced by CFX_PSFontTracker::AddFontObject(), and CFX_PSFontTracker::SeenFontObject().

+ Here is the caller graph for this function:

◆ GetPsName()

ByteString CFX_Font::GetPsName ( ) const

Definition at line 358 of file cfx_font.cpp.

References fxcrt::ByteString::ByteString(), fxcrt::ByteString::IsEmpty(), kUntitledFontName, and fxcrt::ByteString::operator=().

Referenced by GetBaseFontName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRawBBox()

absl::optional< FX_RECT > CFX_Font::GetRawBBox ( ) const

Definition at line 412 of file cfx_font.cpp.

◆ GetSubstFont()

CFX_SubstFont * CFX_Font::GetSubstFont ( ) const
inline

Definition at line 82 of file cfx_font.h.

Referenced by GetSubstFontItalicAngle(), CFX_GlyphCache::LoadGlyphPath(), and CFX_Face::RenderGlyph().

+ Here is the caller graph for this function:

◆ GetSubstFontItalicAngle()

int CFX_Font::GetSubstFontItalicAngle ( ) const

Definition at line 164 of file cfx_font.cpp.

References GetSubstFont(), and CFX_SubstFont::m_ItalicAngle.

Referenced by CFX_SkiaDeviceDriver::DrawDeviceText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsBold()

bool CFX_Font::IsBold ( ) const

Definition at line 343 of file cfx_font.cpp.

◆ IsEmbedded()

bool CFX_Font::IsEmbedded ( ) const
inline

Definition at line 124 of file cfx_font.h.

Referenced by CTextOnlyPrinterDriver::DrawDeviceText().

+ Here is the caller graph for this function:

◆ IsFixedWidth()

bool CFX_Font::IsFixedWidth ( ) const

Definition at line 347 of file cfx_font.cpp.

◆ IsItalic()

bool CFX_Font::IsItalic ( ) const

Definition at line 331 of file cfx_font.cpp.

References fxcrt::ByteString::MakeLower().

+ Here is the call graph for this function:

◆ IsTTFont()

bool CFX_Font::IsTTFont ( ) const

Definition at line 273 of file cfx_font.cpp.

Referenced by CTextOnlyPrinterDriver::DrawDeviceText(), and GetBaseFontName().

+ Here is the caller graph for this function:

◆ IsVertical()

bool CFX_Font::IsVertical ( ) const
inline

Definition at line 111 of file cfx_font.h.

Referenced by CFX_GlyphCache::LoadGlyphPath(), and CFX_Face::RenderGlyph().

+ Here is the caller graph for this function:

◆ LoadEmbedded()

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

Definition at line 260 of file cfx_font.cpp.

◆ LoadGlyphBitmap()

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

Definition at line 453 of file cfx_font.cpp.

Referenced by CFX_RenderDevice::DrawNormalText().

+ Here is the caller graph for this function:

◆ LoadGlyphPath()

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

Definition at line 465 of file cfx_font.cpp.

Referenced by FPDFFont_GetGlyphPath().

+ Here is the caller graph for this function:

◆ LoadGlyphPathImpl()

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

Definition at line 444 of file cfx_font.cpp.

◆ LoadSubst()

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

Definition at line 220 of file cfx_font.cpp.

◆ SetFontType()

void CFX_Font::SetFontType ( FontType type)
inline

Definition at line 126 of file cfx_font.h.

Member Data Documentation

◆ kDefaultAnsiFontName

const char CFX_Font::kDefaultAnsiFontName = "Helvetica"
static

Definition at line 58 of file cfx_font.h.

Referenced by CPDF_BAFontMap::CPDF_BAFontMap().

◆ kDefaultTTFMap

const CFX_Font::CharsetFontMap CFX_Font::kDefaultTTFMap
static
Initial value:
= {
{static_cast<int>(FX_Charset::kChineseSimplified), "SimSun"},
{static_cast<int>(FX_Charset::kChineseTraditional), "MingLiU"},
{static_cast<int>(FX_Charset::kShiftJIS), "MS Gothic"},
{static_cast<int>(FX_Charset::kHangul), "Batang"},
{static_cast<int>(FX_Charset::kMSWin_Cyrillic), "Arial"},
{static_cast<int>(FX_Charset::kMSWin_EasternEuropean), "Arial"},
{static_cast<int>(FX_Charset::kMSWin_Arabic), "Arial"},
{-1, nullptr}}
static const char kDefaultAnsiFontName[]
Definition cfx_font.h:58
@ kChineseTraditional
@ kMSWin_EasternEuropean
@ kChineseSimplified

Definition at line 78 of file cfx_font.h.

Referenced by FPDF_GetDefaultTTFMap(), and GetDefaultFontNameByCharset().

◆ kUniversalDefaultFontName

const char CFX_Font::kUniversalDefaultFontName = "Arial Unicode MS"
static

Definition at line 59 of file cfx_font.h.

Referenced by GetDefaultFontNameByCharset(), and CPDF_BAFontMap::GetWordFontIndex().

◆ kUntitledFontName

const char CFX_Font::kUntitledFontName = "Untitled"
static

Definition at line 56 of file cfx_font.h.

Referenced by GetBaseFontName(), and GetPsName().


The documentation for this class was generated from the following files: