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

#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 (const CmapResult &rCR)
 
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...
 
int GetGlyphIndex (sal_UCS4) 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 bSymbols)
 Get the default font character map. More...
 

Private Member Functions

int findRangeIndex (sal_UCS4) const
 
 FontCharMap (ImplFontCharMapRef const &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::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 401 of file fontcharmap.cxx.

Referenced by GetDefaultMap().

FontCharMap::FontCharMap ( const CmapResult rCR)

Definition at line 411 of file fontcharmap.cxx.

FontCharMap::~FontCharMap ( )
overridevirtual

Definition at line 416 of file fontcharmap.cxx.

References mpImplFontCharMap.

FontCharMap::FontCharMap ( ImplFontCharMapRef const &  pIFCMap)
private

Definition at line 406 of file fontcharmap.cxx.

FontCharMap::FontCharMap ( const FontCharMap )
privatedelete

Member Function Documentation

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 437 of file fontcharmap.cxx.

References findRangeIndex(), i, mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

int FontCharMap::findRangeIndex ( sal_UCS4  cChar) const
private
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 432 of file fontcharmap.cxx.

References ImplFontCharMap::mnCharCount, and mpImplFontCharMap.

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 535 of file fontcharmap.cxx.

References i, ImplFontCharMap::mnRangeCount, mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

FontCharMapRef FontCharMap::GetDefaultMap ( bool  bSymbols)
static

Get the default font character map.

Returns
the default font character map.

Definition at line 421 of file fontcharmap.cxx.

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

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 479 of file fontcharmap.cxx.

References mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

Referenced by GetNextChar(), GetPrevChar(), and WMFWriter::SetAllAttr().

int FontCharMap::GetGlyphIndex ( sal_UCS4  cChar) const
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 515 of file fontcharmap.cxx.

References i, ImplFontCharMap::mnRangeCount, mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

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 484 of file fontcharmap.cxx.

References ImplFontCharMap::mnRangeCount, mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

Referenced by GetNextChar(), and GetPrevChar().

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 489 of file fontcharmap.cxx.

References findRangeIndex(), GetFirstChar(), GetLastChar(), mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

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 502 of file fontcharmap.cxx.

References findRangeIndex(), GetFirstChar(), GetLastChar(), mpImplFontCharMap, and ImplFontCharMap::mpRangeCodes.

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 462 of file fontcharmap.cxx.

References findRangeIndex(), GetGlyphIndex(), mpImplFontCharMap, and ImplFontCharMap::mpStartGlyphs.

Referenced by WinFontFace::HasChar(), and OutputDevice::HasGlyphs().

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 427 of file fontcharmap.cxx.

References ImplFontCharMap::isDefaultMap(), and mpImplFontCharMap.

Referenced by OutputDevice::GetFontCharMap().

void FontCharMap::operator= ( const FontCharMap )
privatedelete

Friends And Related Function Documentation

friend class ::OutputDevice
friend

Definition at line 140 of file fontcharmap.hxx.

Member Data Documentation

ImplFontCharMapRef FontCharMap::mpImplFontCharMap
private

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