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
fx_font.h File Reference

(08e24b2ba6847221abd35e9b994206b764d6b322)

#include <stdint.h>
#include <vector>
#include "core/fxcrt/bytestring.h"
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/span.h"
Include dependency graph for fx_font.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FXFONT_FF_FIXEDPITCH   (1 << 0)
#define FXFONT_FF_ROMAN   (1 << 4)
#define FXFONT_FF_SCRIPT   (4 << 4)
#define FXFONT_FW_NORMAL   400
#define FXFONT_FW_BOLD   700
#define FXFONT_FW_BOLD_BOLD   900
#define FXFONT_NORMAL   (0)
#define FXFONT_FIXED_PITCH   (1 << 0)
#define FXFONT_SERIF   (1 << 1)
#define FXFONT_SYMBOLIC   (1 << 2)
#define FXFONT_SCRIPT   (1 << 3)
#define FXFONT_NONSYMBOLIC   (1 << 5)
#define FXFONT_ITALIC   (1 << 6)
#define FXFONT_ALLCAP   (1 << 16)
#define FXFONT_SMALLCAP   (1 << 17)
#define FXFONT_FORCE_BOLD   (1 << 18)
#define FXFONT_USEEXTERNATTR   0x80000

Functions

FX_RECT GetGlyphsBBox (const std::vector< TextGlyphPos > &glyphs, int anti_alias)
ByteString GetNameFromTT (pdfium::span< const uint8_t > name_table, uint32_t name)
size_t GetTTCIndex (pdfium::span< const uint8_t > pFontData, size_t font_offset)
bool FontStyleIsForceBold (uint32_t style)
bool FontStyleIsItalic (uint32_t style)
bool FontStyleIsFixedPitch (uint32_t style)
bool FontStyleIsSymbolic (uint32_t style)
bool FontStyleIsNonSymbolic (uint32_t style)
bool FontStyleIsAllCaps (uint32_t style)
bool FontStyleIsSerif (uint32_t style)
bool FontStyleIsScript (uint32_t style)
bool FontFamilyIsFixedPitch (uint32_t family)
bool FontFamilyIsRoman (uint32_t family)
bool FontFamilyIsScript (int32_t family)
wchar_t UnicodeFromAdobeName (const char *name)
ByteString AdobeNameFromUnicode (wchar_t unicode)
int NormalizeFontMetric (int64_t value, uint16_t upem)

Variables

constexpr uint16_t kNamePlatformAppleUnicode = 0
constexpr uint16_t kNamePlatformMac = 1
constexpr uint16_t kNamePlatformWindows = 3

Macro Definition Documentation

◆ FXFONT_ALLCAP

#define FXFONT_ALLCAP   (1 << 16)

Definition at line 36 of file fx_font.h.

◆ FXFONT_FF_FIXEDPITCH

#define FXFONT_FF_FIXEDPITCH   (1 << 0)

Definition at line 19 of file fx_font.h.

◆ FXFONT_FF_ROMAN

#define FXFONT_FF_ROMAN   (1 << 4)

Definition at line 20 of file fx_font.h.

◆ FXFONT_FF_SCRIPT

#define FXFONT_FF_SCRIPT   (4 << 4)

Definition at line 21 of file fx_font.h.

◆ FXFONT_FIXED_PITCH

#define FXFONT_FIXED_PITCH   (1 << 0)

Definition at line 30 of file fx_font.h.

◆ FXFONT_FORCE_BOLD

#define FXFONT_FORCE_BOLD   (1 << 18)

Definition at line 38 of file fx_font.h.

◆ FXFONT_FW_BOLD

#define FXFONT_FW_BOLD   700

Definition at line 25 of file fx_font.h.

◆ FXFONT_FW_BOLD_BOLD

#define FXFONT_FW_BOLD_BOLD   900

Definition at line 26 of file fx_font.h.

◆ FXFONT_FW_NORMAL

#define FXFONT_FW_NORMAL   400

Definition at line 24 of file fx_font.h.

◆ FXFONT_ITALIC

#define FXFONT_ITALIC   (1 << 6)

Definition at line 35 of file fx_font.h.

◆ FXFONT_NONSYMBOLIC

#define FXFONT_NONSYMBOLIC   (1 << 5)

Definition at line 34 of file fx_font.h.

◆ FXFONT_NORMAL

#define FXFONT_NORMAL   (0)

Definition at line 29 of file fx_font.h.

◆ FXFONT_SCRIPT

#define FXFONT_SCRIPT   (1 << 3)

Definition at line 33 of file fx_font.h.

◆ FXFONT_SERIF

#define FXFONT_SERIF   (1 << 1)

Definition at line 31 of file fx_font.h.

◆ FXFONT_SMALLCAP

#define FXFONT_SMALLCAP   (1 << 17)

Definition at line 37 of file fx_font.h.

◆ FXFONT_SYMBOLIC

#define FXFONT_SYMBOLIC   (1 << 2)

Definition at line 32 of file fx_font.h.

◆ FXFONT_USEEXTERNATTR

#define FXFONT_USEEXTERNATTR   0x80000

Definition at line 41 of file fx_font.h.

Function Documentation

◆ AdobeNameFromUnicode()

ByteString AdobeNameFromUnicode ( wchar_t unicode)

Definition at line 144 of file fx_font.cpp.

References fxcrt::ByteString::ByteString().

Here is the call graph for this function:

◆ FontFamilyIsFixedPitch()

bool FontFamilyIsFixedPitch ( uint32_t family)
inline

Definition at line 86 of file fx_font.h.

Referenced by CFX_FolderFontInfo::FindFont(), CFX_AndroidFontInfo::MapFont(), and CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontFamilyIsRoman()

bool FontFamilyIsRoman ( uint32_t family)
inline

Definition at line 89 of file fx_font.h.

Referenced by CFX_AndroidFontInfo::MapFont(), and CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontFamilyIsScript()

bool FontFamilyIsScript ( int32_t family)
inline

Definition at line 92 of file fx_font.h.

Referenced by CFX_AndroidFontInfo::MapFont(), and CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontStyleIsAllCaps()

bool FontStyleIsAllCaps ( uint32_t style)
inline

Definition at line 76 of file fx_font.h.

Referenced by CPDF_SimpleFont::LoadCommon().

Here is the caller graph for this function:

◆ FontStyleIsFixedPitch()

bool FontStyleIsFixedPitch ( uint32_t style)
inline

Definition at line 67 of file fx_font.h.

Referenced by CPDF_SimpleFont::LoadSubstFont(), and CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontStyleIsForceBold()

bool FontStyleIsForceBold ( uint32_t style)
inline

Definition at line 61 of file fx_font.h.

Referenced by FPDFEditEmbedderTest::CheckFontDescriptor(), CFX_FontMapper::FindSubstFont(), CFGAS_DefaultFontManager::GetFont(), CFGAS_PDFFontMgr::GetFont(), and CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontStyleIsItalic()

bool FontStyleIsItalic ( uint32_t style)
inline

Definition at line 64 of file fx_font.h.

Referenced by FPDFEditEmbedderTest::CheckFontDescriptor(), CFX_FontMapper::FindSubstFont(), CFGAS_DefaultFontManager::GetFont(), CFGAS_PDFFontMgr::GetFont(), and CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontStyleIsNonSymbolic()

bool FontStyleIsNonSymbolic ( uint32_t style)
inline

Definition at line 73 of file fx_font.h.

Referenced by FPDFEditEmbedderTest::CheckFontDescriptor(), and CPDF_Type1Font::Load().

Here is the caller graph for this function:

◆ FontStyleIsScript()

bool FontStyleIsScript ( uint32_t style)
inline

Definition at line 82 of file fx_font.h.

Referenced by CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontStyleIsSerif()

bool FontStyleIsSerif ( uint32_t style)
inline

Definition at line 79 of file fx_font.h.

Referenced by CFX_FolderFontInfo::FontFaceInfo::SimilarityScore().

Here is the caller graph for this function:

◆ FontStyleIsSymbolic()

bool FontStyleIsSymbolic ( uint32_t style)
inline

Definition at line 70 of file fx_font.h.

Referenced by CPDF_SimpleFont::LoadCommon(), and CPDF_Type1Font::LoadGlyphMap().

Here is the caller graph for this function:

◆ GetGlyphsBBox()

FX_RECT GetGlyphsBBox ( const std::vector< TextGlyphPos > & glyphs,
int anti_alias )

Definition at line 37 of file fx_font.cpp.

◆ GetNameFromTT()

ByteString GetNameFromTT ( pdfium::span< const uint8_t > name_table,
uint32_t name )

Definition at line 81 of file fx_font.cpp.

References fxcrt::ByteString::ByteString(), fxcrt::GetUInt16MSBFirst(), kNamePlatformMac, and kNamePlatformWindows.

Here is the call graph for this function:

◆ GetTTCIndex()

size_t GetTTCIndex ( pdfium::span< const uint8_t > pFontData,
size_t font_offset )

Definition at line 128 of file fx_font.cpp.

References fxcrt::GetUInt32MSBFirst().

Here is the call graph for this function:

◆ NormalizeFontMetric()

int NormalizeFontMetric ( int64_t value,
uint16_t upem )

Definition at line 150 of file fx_font.cpp.

Referenced by CPDF_Font::CheckFontMetrics().

Here is the caller graph for this function:

◆ UnicodeFromAdobeName()

wchar_t UnicodeFromAdobeName ( const char * name)

Definition at line 140 of file fx_font.cpp.

References FXFT_unicode_from_adobe_name().

Referenced by CPDF_CIDFont::GlyphFromCharCode().

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

Variable Documentation

◆ kNamePlatformAppleUnicode

uint16_t kNamePlatformAppleUnicode = 0
constexpr

Definition at line 44 of file fx_font.h.

◆ kNamePlatformMac

uint16_t kNamePlatformMac = 1
constexpr

Definition at line 45 of file fx_font.h.

Referenced by GetNameFromTT().

◆ kNamePlatformWindows

uint16_t kNamePlatformWindows = 3
constexpr

Definition at line 46 of file fx_font.h.

Referenced by GetNameFromTT().