OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLFont Class Reference

An encapsulation of a font item. More...

#include <XLStyles.hpp>

Public Member Functions

 XLFont ()
 
 XLFont (const XMLNode &node)
 Constructor. New items should only be created through an XLStyles object.
 
 XLFont (const XLFont &other)
 Copy Constructor.
 
 XLFont (XLFont &&other) noexcept=default
 Move Constructor.
 
 ~XLFont ()
 
XLFontoperator= (const XLFont &other)
 Copy assignment operator.
 
XLFontoperator= (XLFont &&other) noexcept=default
 Move assignment operator.
 
std::string fontName () const
 Get the font name.
 
size_t fontCharset () const
 Get the font charset.
 
size_t fontFamily () const
 Get the font family.
 
size_t fontSize () const
 Get the font size.
 
XLColor fontColor () const
 Get the font color.
 
bool bold () const
 Get the font bold status.
 
bool italic () const
 Get the font italic (cursive) status.
 
bool strikethrough () const
 Get the font strikethrough status.
 
XLUnderlineStyle underline () const
 Get the font underline status.
 
XLFontSchemeStyle scheme () const
 get the font scheme: none, major or minor
 
XLVerticalAlignRunStyle vertAlign () const
 get the font vertical alignment run style: baseline, subscript or superscript
 
bool outline () const
 Get the outline status.
 
bool shadow () const
 Get the shadow status.
 
bool condense () const
 Get the condense status.
 
bool extend () const
 Get the extend status.
 
XLFontsetFontName (std::string_view newName)
 Setter functions for style parameters.
 
XLFontsetFontCharset (size_t newCharset)
 
XLFontsetFontFamily (size_t newFamily)
 
XLFontsetFontSize (size_t newSize)
 
XLFontsetFontColor (XLColor newColor)
 
XLFontsetBold (bool set=true)
 
XLFontsetItalic (bool set=true)
 
XLFontsetStrikethrough (bool set=true)
 
XLFontsetUnderline (XLUnderlineStyle style=XLUnderlineSingle)
 
XLFontsetScheme (XLFontSchemeStyle newScheme)
 
XLFontsetVertAlign (XLVerticalAlignRunStyle newVertAlign)
 
XLFontsetOutline (bool set=true)
 
XLFontsetShadow (bool set=true)
 
XLFontsetCondense (bool set=true)
 
XLFontsetExtend (bool set=true)
 
std::string summary () const
 Return a string summary of the font properties.
 

Friends

class XLFonts
 

Detailed Description

An encapsulation of a font item.

Constructor & Destructor Documentation

◆ XLFont() [1/4]

XLFont::XLFont ( )

◆ XLFont() [2/4]

XLFont::XLFont ( const XMLNode node)
explicit

Constructor. New items should only be created through an XLStyles object.

Parameters
nodeAn XMLNode object with the fonts XMLNode. If no input is provided, a null node is used.

◆ XLFont() [3/4]

XLFont::XLFont ( const XLFont other)

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLFont() [4/4]

OpenXLSX::XLFont::XLFont ( XLFont &&  other)
defaultnoexcept

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLFont()

XLFont::~XLFont ( )
default

Member Function Documentation

◆ bold()

bool XLFont::bold ( ) const

Get the font bold status.

Returns
true = bold, false = not bold

◆ condense()

bool XLFont::condense ( ) const

Get the condense status.

Returns
true if the font is condensed

◆ extend()

bool XLFont::extend ( ) const

Get the extend status.

Returns
true if the font is extended (spacing between characters is increased)

◆ fontCharset()

size_t XLFont::fontCharset ( ) const

Get the font charset.

Returns
The font charset id

◆ fontColor()

XLColor XLFont::fontColor ( ) const

Get the font color.

Returns
The font color

◆ fontFamily()

size_t XLFont::fontFamily ( ) const

Get the font family.

Returns
The font family id

◆ fontName()

std::string XLFont::fontName ( ) const

Get the font name.

Returns
The font name

◆ fontSize()

size_t XLFont::fontSize ( ) const

Get the font size.

Returns
The font size

◆ italic()

bool XLFont::italic ( ) const

Get the font italic (cursive) status.

Returns
true = italic, false = not italice

◆ operator=() [1/2]

XLFont & XLFont::operator= ( const XLFont other)

Copy assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to the lhs object.

◆ operator=() [2/2]

XLFont & OpenXLSX::XLFont::operator= ( XLFont &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to lhs object.

◆ outline()

bool XLFont::outline ( ) const

Get the outline status.

Returns
true if the font is formatted with an outline effect (per ECMA-376 legacy macOS font styling)

◆ scheme()

XLFontSchemeStyle XLFont::scheme ( ) const

get the font scheme: none, major or minor

Returns
An XLFontSchemeStyle

◆ setBold()

XLFont & XLFont::setBold ( bool  set = true)

◆ setCondense()

XLFont & XLFont::setCondense ( bool  set = true)

◆ setExtend()

XLFont & XLFont::setExtend ( bool  set = true)

◆ setFontCharset()

XLFont & XLFont::setFontCharset ( size_t  newCharset)

◆ setFontColor()

XLFont & XLFont::setFontColor ( XLColor  newColor)

◆ setFontFamily()

XLFont & XLFont::setFontFamily ( size_t  newFamily)

◆ setFontName()

XLFont & XLFont::setFontName ( std::string_view  newName)

Setter functions for style parameters.

Parameters
valuethat shall be set
Returns
true for success, false for failure

◆ setFontSize()

XLFont & XLFont::setFontSize ( size_t  newSize)

◆ setItalic()

XLFont & XLFont::setItalic ( bool  set = true)

◆ setOutline()

XLFont & XLFont::setOutline ( bool  set = true)

◆ setScheme()

XLFont & XLFont::setScheme ( XLFontSchemeStyle  newScheme)

◆ setShadow()

XLFont & XLFont::setShadow ( bool  set = true)

◆ setStrikethrough()

XLFont & XLFont::setStrikethrough ( bool  set = true)

◆ setUnderline()

XLFont & XLFont::setUnderline ( XLUnderlineStyle  style = XLUnderlineSingle)

◆ setVertAlign()

XLFont & XLFont::setVertAlign ( XLVerticalAlignRunStyle  newVertAlign)

◆ shadow()

bool XLFont::shadow ( ) const

Get the shadow status.

Returns
true if the font has a shadow effect

◆ strikethrough()

bool XLFont::strikethrough ( ) const

Get the font strikethrough status.

Returns
true = strikethrough, false = no strikethrough

◆ summary()

std::string XLFont::summary ( ) const

Return a string summary of the font properties.

Returns
string with info about the font object

◆ underline()

XLUnderlineStyle XLFont::underline ( ) const

Get the font underline status.

Returns
An XLUnderlineStyle value

◆ vertAlign()

XLVerticalAlignRunStyle XLFont::vertAlign ( ) const

get the font vertical alignment run style: baseline, subscript or superscript

Returns
An XLVerticalAlignRunStyle

Friends And Related Symbol Documentation

◆ XLFonts

friend class XLFonts
friend

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