FLImaging 7.6.11.1
FLImaging::Foundation::CStencil Class Reference

A class that converts strings to Figure. More...

#include <Stencil.h>

Inheritance diagram for FLImaging::Foundation::CStencil:
FLImaging::Base::CFLBase

Public Member Functions

 CStencil ()
 Default constructor.
 CStencil (const CStencil &st)
 Copy constructor.
 CStencil (const CStencil *pSt)
 Copy constructor.
virtual ~CStencil ()
 Default destructor.
virtual const CResult Assign (const CStencil &st)
 Assigns a copy of the specified CStencil object to this object.
virtual const CResult Assign (const CStencil *pSt)
 Assigns a copy of the specified CStencil object to this object.
const CStenciloperator= (const CStencil &st)
 Assignment operator.
virtual const CResult LoadFont (const Base::CFLString< wchar_t > &strFontName)
virtual const CResult LoadFontByPath (const Base::CFLString< wchar_t > &strFilePath, const Base::CFLString< wchar_t > &strFontName)
virtual const CResult SelectFont (const Base::CFLString< wchar_t > &strFontName)
virtual const CResult GetSelectedFontName (Base::CFLString< wchar_t > &strFontName)
virtual const CResult Clear ()
 Clears the object and releases all loaded fonts.
virtual const CResult ClearFont (const Base::CFLString< wchar_t > &strFontName)
 Removes the specified font from the list of loaded fonts.
virtual bool IsLoaded () const
virtual bool IsLoaded (const Base::CFLString< wchar_t > &strFontName) const
virtual bool IsLoadedByPath (const Base::CFLString< wchar_t > &strFilePath, const Base::CFLString< wchar_t > &strFontName) const
const CResult SetLineSpacing (float f32LineSpacing)
 Sets the line spacing as a multiplier. If set to 0, there is no spacing between lines. If set to 1, the spacing between lines is equal to the font size.
float GetLineSpacing () const
 Returns the line spacing multiplier.
const CResult SetLetterSpacing (float f32LetterSpacing)
 Sets the spacing between characters as a multiplier. If set to 0, there is no spacing between characters. If set to 1, the spacing between characters is equal to the font size.
float GetLetterSpacing () const
 Returns the character spacing multiplier.
const CResult SetLetterWidth (float f32LetterWidth)
 Sets the character width as a multiplier.
float GetLetterWidth () const
 Returns the character width multiplier.
const CResult SetFontSize (float f32FontSize)
 Sets the font size.
float GetFontSize () const
 Returns the font size.
const CResult ConvertStringToFigure (const Base::CFLString< char > &str, Foundation::CFLFigureArray *pFigureArray) const
 Converts a string into Figure objects.
const CResult ConvertStringToFigure (const Base::CFLString< char > &str, Foundation::CFLFigureArray &figureArray) const
 Converts a string into Figure objects.
const CResult ConvertStringToFigure (const Base::CFLString< wchar_t > &str, Foundation::CFLFigureArray *pFigureArray) const
 Converts a string into Figure objects.
const CResult ConvertStringToFigure (const Base::CFLString< wchar_t > &str, Foundation::CFLFigureArray &figureArray) const
 Converts a string into Figure objects.
Base::CFLString< wchar_t > GetFontFaceName () const
 Returns the face name of the loaded font.
virtual bool IsLicenseAvailable () const override
 Returns whether the algorithm can be used with the current license.
Public Member Functions inherited from FLImaging::Base::CFLBase
 CFLBase ()
 Default constructor.
virtual ~CFLBase ()
 Destructor.
void Lock () const
 Set a lock on an object.
bool TryLock () const
 Try to lock the object.
void Unlock () const
 Unlock the object.
virtual const CProcessingUnitBaseGetProcessingUnit () const
 Returns the set ProcessingUnit.
virtual const CResult SetProcessingUnit (const CProcessingUnitBase &pub)
 set the ProcessingUnit
virtual const CResult SetProcessingUnit (const CProcessingUnitBase *pPub)
 Set the ProcessingUnit.
virtual void ResetProcessingUnit ()
 Rest the ProcessingUnit.
virtual bool IsValid () const
 Validate the object.
template<class T>
bool IsValid (T &tValue) const
 Validate input values.
template<class T>
bool IsValid (T *pTValue) const
 Validate input values.
template<class T>
void GenerateMin (T &tValue) const
 Generate the minimum value of that type.
template<class T>
void GenerateMin (T *pTValue) const
 Generate the minimum value of that type.
template<class T>
void GenerateMinInt32 (T &tValue) const
 Generate minimum signed 32-bit integer value.
template<class T>
void GenerateMinInt32 (T *pTValue) const
 Generate minimum signed 32-bit integer value.
template<class T>
void GenerateMinInt31 (T &tValue) const
 Generate minimum signed 31-bit integer value.
template<class T>
void GenerateMinInt31 (T *pTValue) const
 Generate minimum signed 31-bit integer value.
template<class T>
void GenerateMax (T &tValue) const
 Generate the maximum value of that type.
template<class T>
void GenerateMax (T *pTValue) const
 Generate the maximum value of that type.
template<class T>
void GenerateMaxInt32 (T &tValue) const
 Generate maximum signed 32-bit integer value.
template<class T>
void GenerateMaxInt32 (T *pTValue) const
 Generate maximum signed 32-bit integer value.
template<class T>
void GenerateMaxInt31 (T &tValue) const
 Generate maximum signed 31-bit integer value.
template<class T>
void GenerateMaxInt31 (T *pTValue) const
 Generate maximum signed 31-bit integer value.
template<class T>
void GenerateInvalid (T &tValue) const
 Generate invalid value.
template<class T>
void GenerateInvalid (T *pTValue) const
 Generate invalid value.
virtual void OnReceiveBroadcast (const CBroadcastMessage *pMessage)
 Callback function. A function that receives a BroadcastMessage.
virtual int64_t GetClassType () const =0
 Returns the Type value of Class. The returned value itself has no meaning, but if it is the same type of class, the same value will be displayed, so comparison is possible.
const char * GetClassNameWithNamespace () const
 Returns the class name including the namespace of the actual instance.
const char * GetClassNameWithoutNamespace () const
 Returns the class name that does not include the namespace of the actual instance.
virtual uint32_t GetClassHash () const
 Returns the class hash value of the actual instance. For the same class, even if the instance is different, it has the same value.
const CResult ShareSynchronizationObject (const CFLBase *pSrcObject) const
 Share synchronization object of original object.
bool IsSharedSynchronizationObject () const
 Is shared synchronization object.
virtual void Throw (const CResult &res, const wchar_t *pWcsExtraMessage=nullptr) const
 Raise an exception. Information and error codes of the object that occurred are recorded in the log.
virtual void Throw (const std::exception &res, const wchar_t *pWcsExtraMessage) const
 Raise an exception. Information and error codes of the object that occurred are recorded in the log.

Detailed Description

A class that converts strings to Figure.

Constructor & Destructor Documentation

◆ CStencil() [1/2]

FLImaging::Foundation::CStencil::CStencil ( const CStencil & st)

Copy constructor.

Parameters
[in]stCreates a new object by copying the parameters of the specified object.
See also
FLImaging::Foundation::CStencil

◆ CStencil() [2/2]

FLImaging::Foundation::CStencil::CStencil ( const CStencil * pSt)

Copy constructor.

Parameters
[in]pStCreates a new object by copying the parameters of the specified object.
See also
FLImaging::Foundation::CStencil

Member Function Documentation

◆ Assign() [1/2]

virtual const CResult FLImaging::Foundation::CStencil::Assign ( const CStencil & st)
virtual

Assigns a copy of the specified CStencil object to this object.

Parameters
[in]stCStencil object to copy.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Foundation::CStencil

◆ Assign() [2/2]

virtual const CResult FLImaging::Foundation::CStencil::Assign ( const CStencil * pSt)
virtual

Assigns a copy of the specified CStencil object to this object.

Parameters
[in]pStPointer to the CStencil object to copy.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Foundation::CStencil

◆ Clear()

virtual const CResult FLImaging::Foundation::CStencil::Clear ( )
virtual

Clears the object and releases all loaded fonts.

Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult

◆ ClearFont()

virtual const CResult FLImaging::Foundation::CStencil::ClearFont ( const Base::CFLString< wchar_t > & strFontName)
virtual

Removes the specified font from the list of loaded fonts.

Parameters
[in]strFontNameName of the font to remove.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Base::CFLString

◆ ConvertStringToFigure() [1/4]

const CResult FLImaging::Foundation::CStencil::ConvertStringToFigure ( const Base::CFLString< char > & str,
Foundation::CFLFigureArray & figureArray ) const

Converts a string into Figure objects.

Parameters
[in]strString to convert.
[out]figureArrayReceives the converted Figure objects.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::Base::CFLString
FLImaging::Foundation::CFLFigureArray
FLImaging::CResult

◆ ConvertStringToFigure() [2/4]

const CResult FLImaging::Foundation::CStencil::ConvertStringToFigure ( const Base::CFLString< char > & str,
Foundation::CFLFigureArray * pFigureArray ) const

Converts a string into Figure objects.

Parameters
[in]strString to convert.
[in]pFigureArrayPointer to receive the converted Figure objects.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::Base::CFLString
FLImaging::Foundation::CFLFigureArray
FLImaging::CResult

◆ ConvertStringToFigure() [3/4]

const CResult FLImaging::Foundation::CStencil::ConvertStringToFigure ( const Base::CFLString< wchar_t > & str,
Foundation::CFLFigureArray & figureArray ) const

Converts a string into Figure objects.

Parameters
[in]strString to convert.
[out]figureArrayReceives the converted Figure objects.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::Base::CFLString
FLImaging::Foundation::CFLFigureArray
FLImaging::CResult

◆ ConvertStringToFigure() [4/4]

const CResult FLImaging::Foundation::CStencil::ConvertStringToFigure ( const Base::CFLString< wchar_t > & str,
Foundation::CFLFigureArray * pFigureArray ) const

Converts a string into Figure objects.

Parameters
[in]strString to convert.
[in]pFigureArrayPointer to receive the converted Figure objects.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::Base::CFLString
FLImaging::Foundation::CFLFigureArray
FLImaging::CResult

◆ GetFontFaceName()

Base::CFLString< wchar_t > FLImaging::Foundation::CStencil::GetFontFaceName ( ) const

Returns the face name of the loaded font.

Return values
FLImaging::Base::CFLString<wchar_t>Font face name.
See also
FLImaging::Base::CFLString

◆ GetFontSize()

float FLImaging::Foundation::CStencil::GetFontSize ( ) const

Returns the font size.

Return values
floatFont size.

◆ GetLetterSpacing()

float FLImaging::Foundation::CStencil::GetLetterSpacing ( ) const

Returns the character spacing multiplier.

Return values
floatCharacter spacing (unit: multiplier).

◆ GetLetterWidth()

float FLImaging::Foundation::CStencil::GetLetterWidth ( ) const

Returns the character width multiplier.

Return values
floatCharacter width (unit: multiplier).

◆ GetLineSpacing()

float FLImaging::Foundation::CStencil::GetLineSpacing ( ) const

Returns the line spacing multiplier.

Return values
floatLine spacing (unit: multiplier).

◆ GetSelectedFontName()

virtual const CResult FLImaging::Foundation::CStencil::GetSelectedFontName ( Base::CFLString< wchar_t > & strFontName)
virtual

Retrieves the name of the currently selected font.

Parameters
[out]strFontNameReceives the name of the currently selected font.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Base::CFLString

◆ IsLicenseAvailable()

virtual bool FLImaging::Foundation::CStencil::IsLicenseAvailable ( ) const
overridevirtual

Returns whether the algorithm can be used with the current license.

Return values
boolLicense availability

Reimplemented from FLImaging::Base::CFLBase.

◆ IsLoaded() [1/2]

virtual bool FLImaging::Foundation::CStencil::IsLoaded ( ) const
virtual

Returns whether one or more fonts are loaded.

Return values
boolReturns true if one or more fonts are loaded; otherwise, false.

◆ IsLoaded() [2/2]

virtual bool FLImaging::Foundation::CStencil::IsLoaded ( const Base::CFLString< wchar_t > & strFontName) const
virtual

Returns whether the specified font is loaded.

Parameters
[in]strFontNameName of the font to check.
Return values
boolReturns true if the specified font is loaded; otherwise, false.
See also
FLImaging::Base::CFLString

◆ IsLoadedByPath()

virtual bool FLImaging::Foundation::CStencil::IsLoadedByPath ( const Base::CFLString< wchar_t > & strFilePath,
const Base::CFLString< wchar_t > & strFontName ) const
virtual

Returns whether a font loaded from the specified path and font name exists.

Parameters
[in]strFilePathFile path to check.
[in]strFontNameFont name to check.
Return values
boolReturns true if a loaded font matching the specified path and font name exists; otherwise, false.
See also
FLImaging::Base::CFLString

◆ LoadFont()

virtual const CResult FLImaging::Foundation::CStencil::LoadFont ( const Base::CFLString< wchar_t > & strFontName)
virtual

Loads a font. Once loaded, the font remains loaded in the object until the Clear() function is called.

Parameters
[in]strFontNameFont name.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Base::CFLString

◆ LoadFontByPath()

virtual const CResult FLImaging::Foundation::CStencil::LoadFontByPath ( const Base::CFLString< wchar_t > & strFilePath,
const Base::CFLString< wchar_t > & strFontName )
virtual

Loads a .TTF (TrueType Font) file. Once loaded, the font remains loaded in the object until the Clear() function is called.

Parameters
[in]strFilePathPath of the font file to load.
[in]strFontNameFont name.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Base::CFLString

◆ operator=()

const CStencil & FLImaging::Foundation::CStencil::operator= ( const CStencil & st)

Assignment operator.

Parameters
[in]stCStencil object to assign.
Return values
constCStencil& Reference to this object.
See also
FLImaging::Foundation::CStencil

◆ SelectFont()

virtual const CResult FLImaging::Foundation::CStencil::SelectFont ( const Base::CFLString< wchar_t > & strFontName)
virtual

Selects a preloaded font. If the font specified by the given name has not been loaded yet, it is loaded internally and then selected.

Parameters
[in]strFontNameFont name.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult
FLImaging::Base::CFLString

◆ SetFontSize()

const CResult FLImaging::Foundation::CStencil::SetFontSize ( float f32FontSize)

Sets the font size.

Parameters
[in]f32FontSizeFont size.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult

◆ SetLetterSpacing()

const CResult FLImaging::Foundation::CStencil::SetLetterSpacing ( float f32LetterSpacing)

Sets the spacing between characters as a multiplier. If set to 0, there is no spacing between characters. If set to 1, the spacing between characters is equal to the font size.

Parameters
[in]f32LetterSpacingCharacter spacing (unit: multiplier).
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult

◆ SetLetterWidth()

const CResult FLImaging::Foundation::CStencil::SetLetterWidth ( float f32LetterWidth)

Sets the character width as a multiplier.

Parameters
[in]f32LetterWidthCharacter width. A value of 1 uses the original character width. A value of 0.7 renders characters at 70% of their original width.
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult

◆ SetLineSpacing()

const CResult FLImaging::Foundation::CStencil::SetLineSpacing ( float f32LineSpacing)

Sets the line spacing as a multiplier. If set to 0, there is no spacing between lines. If set to 1, the spacing between lines is equal to the font size.

Parameters
[in]f32LineSpacingLine spacing (unit: multiplier).
Return values
constFLImaging::CResult Result of the function execution (EResult_OK on success)
See also
FLImaging::CResult