|
OpenXLSX 1.9.1
|
An encapsulation of the XLSX fonts. More...
#include <XLStyles.hpp>
Public Member Functions | |
| XLFonts () | |
| XLFonts (const XMLNode &node) | |
| Constructor. New items should only be created through an XLStyles object. | |
| XLFonts (const XLFonts &other) | |
| Copy Constructor. | |
| XLFonts (XLFonts &&other) | |
| Move Constructor. | |
| ~XLFonts () | |
| XLFonts & | operator= (const XLFonts &other) |
| Copy assignment operator. | |
| XLFonts & | operator= (XLFonts &&other) noexcept=default |
| Move assignment operator. | |
| size_t | count () const |
| Get the count of fonts. | |
| XLFont | fontByIndex (XLStyleIndex index) const |
| Get the font identified by index. | |
| XLFont | operator[] (XLStyleIndex index) const |
| Operator overload: allow [] as shortcut access to fontByIndex. | |
| XLStyleIndex | create (XLFont copyFrom=XLFont{}, std::string_view styleEntriesPrefix=XLDefaultStyleEntriesPrefix) |
| Append a new XLFont, based on copyFrom, and return its index in fonts node. | |
| XLStyleIndex | findOrCreate (XLFont copyFrom, std::string_view styleEntriesPrefix=XLDefaultStyleEntriesPrefix) |
| Find an existing font matching copyFrom's properties, or create a new one. | |
An encapsulation of the XLSX fonts.
| XLFonts::XLFonts | ( | ) |
|
explicit |
Constructor. New items should only be created through an XLStyles object.
| node | An XMLNode object with the styles item. If no input is provided, a null node is used. |
| XLFonts::XLFonts | ( | const XLFonts & | other | ) |
Copy Constructor.
| other | Object to be copied. |
| XLFonts::XLFonts | ( | XLFonts && | other | ) |
Move Constructor.
| other | Object to be moved. |
| XLFonts::~XLFonts | ( | ) |
| size_t XLFonts::count | ( | ) | const |
Get the count of fonts.
| XLStyleIndex XLFonts::create | ( | XLFont | copyFrom = XLFont{}, |
| std::string_view | styleEntriesPrefix = XLDefaultStyleEntriesPrefix |
||
| ) |
Append a new XLFont, based on copyFrom, and return its index in fonts node.
| copyFrom | Can provide an XLFont to use as template for the new style |
| styleEntriesPrefix | Prefix the newly created cell style XMLNode with this pugi::node_pcdata text |
| XLStyleIndex XLFonts::findOrCreate | ( | XLFont | copyFrom, |
| std::string_view | styleEntriesPrefix = XLDefaultStyleEntriesPrefix |
||
| ) |
Find an existing font matching copyFrom's properties, or create a new one.
Uses a canonical XML fingerprint for O(1) cache lookups after the first call. Prevents duplicate font entries when the same style is applied to many cells.
| copyFrom | The font descriptor to match or create. |
| styleEntriesPrefix | XML indentation prefix for newly created nodes. |
| XLFont XLFonts::fontByIndex | ( | XLStyleIndex | index | ) | const |
Get the font identified by index.
| index | The index within the XML sequence |
Copy assignment operator.
| other | Right hand side of assignment operation. |
Move assignment operator.
| other | Right hand side of assignment operation. |
|
inline |
Operator overload: allow [] as shortcut access to fontByIndex.
| index | The index within the XML sequence |