LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
FontCharMap Class Referencefinal

#include <fontcharmap.hxx>

Inheritance diagram for FontCharMap:
[legend]
Collaboration diagram for FontCharMap:
[legend]

Public Member Functions

 FontCharMap ()
 A new FontCharMap is created based on a "default" map, which includes all codepoints in the Unicode BMP range, including surrogates. More...
 
 FontCharMap (bool bMicrosoftSymbolMap, std::vector< sal_UCS4 > aRangeCodes)
 A new FontCharMap is created based on passed arguments. More...
 
virtual ~FontCharMap () override
 
bool IsDefaultMap () const
 Determines if the font character map is the "default". More...
 
bool HasChar (sal_UCS4) const
 Does the font character map include the UCS4 character? More...
 
int CountCharsInRange (sal_UCS4 cMin, sal_UCS4 cMax) const
 Returns the number of chars supported by the font, which are inside the unicode range from cMin to cMax (inclusive). More...
 
int GetCharCount () const
 Get the number of characters in the font character map. More...
 
sal_UCS4 GetFirstChar () const
 Get the first character in the font character map. More...
 
sal_UCS4 GetLastChar () const
 Get the last character in the font character map. More...
 
sal_UCS4 GetNextChar (sal_UCS4 cChar) const
 Get the next character in the font character map. More...
 
sal_UCS4 GetPrevChar (sal_UCS4 cChar) const
 Get the previous character in the font character map. More...
 
int GetIndexFromChar (sal_UCS4 cChar) const
 Get the index of a particular character in the font character map. More...
 
sal_UCS4 GetCharFromIndex (int nCharIndex) const
 Get the character at a particular index in the font character map. More...
 
bool isMicrosoftSymbolMap () const
 
- Public Member Functions inherited from SvRefBase
 SvRefBase ()
 
 SvRefBase (const SvRefBase &)
 
SvRefBaseoperator= (const SvRefBase &)
 
void RestoreNoDelete ()
 
void AddNextRef ()
 
void AddFirstRef ()
 
void ReleaseRef ()
 
unsigned int GetRefCount () const
 

Static Public Member Functions

static FontCharMapRef GetDefaultMap (bool bMicrosoftSymbolMap)
 Get the default font character map. More...
 

Private Member Functions

int findRangeIndex (sal_UCS4) const
 
 FontCharMap (ImplFontCharMapRef pIFCMap)
 
 FontCharMap (const FontCharMap &)=delete
 
void operator= (const FontCharMap &)=delete
 

Private Attributes

ImplFontCharMapRef mpImplFontCharMap
 

Friends

class ::OutputDevice
 

Additional Inherited Members

- Protected Member Functions inherited from SvRefBase
virtual ~SvRefBase () COVERITY_NOEXCEPT_FALSE
 

Detailed Description

Definition at line 35 of file fontcharmap.hxx.

Constructor & Destructor Documentation

◆ FontCharMap() [1/4]

FontCharMap::FontCharMap ( )

A new FontCharMap is created based on a "default" map, which includes all codepoints in the Unicode BMP range, including surrogates.

Definition at line 88 of file fontcharmap.cxx.

Referenced by GetDefaultMap().

◆ FontCharMap() [2/4]

FontCharMap::FontCharMap ( bool  bMicrosoftSymbolMap,
std::vector< sal_UCS4 aRangeCodes 
)

A new FontCharMap is created based on passed arguments.

Definition at line 98 of file fontcharmap.cxx.

◆ ~FontCharMap()

FontCharMap::~FontCharMap ( )
overridevirtual

Definition at line 103 of file fontcharmap.cxx.

References mpImplFontCharMap.

◆ FontCharMap() [3/4]

FontCharMap::FontCharMap ( ImplFontCharMapRef  pIFCMap)
private

Definition at line 93 of file fontcharmap.cxx.

◆ FontCharMap() [4/4]

FontCharMap::FontCharMap ( const FontCharMap )
privatedelete

Member Function Documentation

◆ CountCharsInRange()

int FontCharMap::CountCharsInRange ( sal_UCS4  cMin,
sal_UCS4  cMax 
) const

Returns the number of chars supported by the font, which are inside the unicode range from cMin to cMax (inclusive).

Parameters
cMinLowest codepoint in range to be counted
cMaxHighest codepoint in range to be counted
Returns
number of characters in the font charmap between the two codepoints.

Definition at line 126 of file fontcharmap.cxx.

References findRangeIndex(), i, mpImplFontCharMap, and nCount.

◆ findRangeIndex()

int FontCharMap::findRangeIndex ( sal_UCS4  cChar) const
private

Definition at line 233 of file fontcharmap.cxx.

References mpImplFontCharMap.

Referenced by CountCharsInRange(), GetNextChar(), GetPrevChar(), and HasChar().

◆ GetCharCount()

int FontCharMap::GetCharCount ( ) const

Get the number of characters in the font character map.

Returns
number of characters in the font character map.

Definition at line 121 of file fontcharmap.cxx.

References mpImplFontCharMap.

◆ GetCharFromIndex()

sal_UCS4 FontCharMap::GetCharFromIndex ( int  nCharIndex) const

Get the character at a particular index in the font character map.

The index is different from the codepoint, because font character maps can

determine the character.

Parameters
nCharIndexIndex used to find the character
Returns
Character in font character map.

Definition at line 216 of file fontcharmap.cxx.

References i, mpImplFontCharMap, and nIndex.

◆ GetDefaultMap()

FontCharMapRef FontCharMap::GetDefaultMap ( bool  bMicrosoftSymbolMap)
static

Get the default font character map.

Returns
the default font character map.

Definition at line 108 of file fontcharmap.cxx.

References FontCharMap(), and ImplFontCharMap::getDefaultMap().

Referenced by vcl::font::PhysicalFontFace::GetFontCharMap(), and vcl::pdf::BuildinFont::GetFontCharMap().

◆ GetFirstChar()

sal_UCS4 FontCharMap::GetFirstChar ( ) const

Get the first character in the font character map.

Returns
first character in the font character map.

Definition at line 160 of file fontcharmap.cxx.

References mpImplFontCharMap.

Referenced by GetNextChar(), and GetPrevChar().

◆ GetIndexFromChar()

int FontCharMap::GetIndexFromChar ( sal_UCS4  cChar) const

Get the index of a particular character in the font character map.

The index is different from the codepoint, because font character maps can

determine the index.

Parameters
cCharCharacter used to find index number
Returns
Index of character in font character map.

Definition at line 196 of file fontcharmap.cxx.

References i, and mpImplFontCharMap.

◆ GetLastChar()

sal_UCS4 FontCharMap::GetLastChar ( ) const

Get the last character in the font character map.

Returns
last character in the font character map.

Definition at line 165 of file fontcharmap.cxx.

References mpImplFontCharMap.

Referenced by GetNextChar(), and GetPrevChar().

◆ GetNextChar()

sal_UCS4 FontCharMap::GetNextChar ( sal_UCS4  cChar) const

Get the next character in the font character map.

This is important because character maps (e.g. the default map which holds the characters in the BMP plane) can have discontiguous ranges.

Parameters
cCharCharacter from which to find next character
Returns
next character in the font character map.

Definition at line 170 of file fontcharmap.cxx.

References findRangeIndex(), GetFirstChar(), GetLastChar(), and mpImplFontCharMap.

◆ GetPrevChar()

sal_UCS4 FontCharMap::GetPrevChar ( sal_UCS4  cChar) const

Get the previous character in the font character map.

This is important because character maps (e.g. the default map which holds the characters in the BMP plane) can have discontiguous ranges.

Parameters
cCharCharacter from which to find previous character
Returns
previous character in the font character map.

Definition at line 183 of file fontcharmap.cxx.

References findRangeIndex(), GetFirstChar(), GetLastChar(), and mpImplFontCharMap.

◆ HasChar()

bool FontCharMap::HasChar ( sal_UCS4  cChar) const

Does the font character map include the UCS4 character?

Returns
true if character exists in font character map, false is not.

Definition at line 152 of file fontcharmap.cxx.

References findRangeIndex().

◆ IsDefaultMap()

bool FontCharMap::IsDefaultMap ( ) const

Determines if the font character map is the "default".

The default map includes all codepoints in the Unicode BMP range, including surrogates.

Returns
true if default map, false if not default map.

Definition at line 114 of file fontcharmap.cxx.

References mpImplFontCharMap.

◆ isMicrosoftSymbolMap()

bool FontCharMap::isMicrosoftSymbolMap ( ) const

Definition at line 119 of file fontcharmap.cxx.

References mpImplFontCharMap.

◆ operator=()

void FontCharMap::operator= ( const FontCharMap )
privatedelete

Friends And Related Function Documentation

◆ ::OutputDevice

friend class ::OutputDevice
friend

Definition at line 144 of file fontcharmap.hxx.

Member Data Documentation

◆ mpImplFontCharMap

ImplFontCharMapRef FontCharMap::mpImplFontCharMap
private

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