34#include <Pt/Gfx/Api.h>
35#include <Pt/System/Path.h>
36#include <Pt/SmartPtr.h>
324 , _weight(
Font::Weight::Normal)
325 , _slant(
Font::Slant::Normal)
326 , _stretch(
Font::Stretch::Normal)
327 , _category(
Font::Category::None)
331 FontData(
const std::string& family, std::size_t size,
335 const std::string& styleName = std::string())
338 , _styleName(styleName)
342 , _category(Font::Category::None)
356 , _category(category)
360 FontData(
const std::string& family,
const FontData& font)
363 , _styleName(font._styleName)
364 , _weight(font._weight)
365 , _slant(font._slant)
366 , _stretch(font._stretch)
367 , _category(font._category)
371 const std::string& family()
const
376 std::size_t size()
const
381 const std::string& styleName()
const
386 bool hasStyleName()
const
388 return ! _styleName.empty();
414 std::string _styleName;
Font family, size and style.
Definition Font.h:63
const std::string & family() const
Returns the family of the font.
Slant slant() const
Returns the slant of the font request.
Font withSlant(Slant slant) const
Returns a copy of this font with a different slant.
Definition Font.h:293
Font(const std::string &family, std::size_t size, const std::string &styleName, Weight weight=Weight::Normal, Slant slant=Slant::Normal, Stretch stretch=Stretch::Normal)
Construct a font with an exact style name hint.
static void addFonts(const System::Path &path)
Adds all fonts found at the given path.
static const std::vector< System::Path > & fontFiles()
Returns the registered font files.
bool operator==(const Font &a, const Font &b)
Returns true if two font requests are equal.
Definition Font.h:215
bool operator<(const Font &a, const Font &b)
Returns true if one font request sorts before another.
Definition Font.h:245
Weight weight() const
Returns the weight of the font request.
Font withStretch(Stretch stretch) const
Returns a copy of this font with a different stretch.
Definition Font.h:305
Category category() const
Returns the generic font category.
const std::string & styleName() const
Returns the optional exact style name hint.
Font()
Default constructor.
static bool addFont(const System::Path &path)
Adds one font file.
Font withWeight(Weight weight) const
Returns a copy of this font with a different weight.
Definition Font.h:281
Category
Describes a generic fallback font category.
Definition Font.h:107
Stretch
Describes the requested font stretch.
Definition Font.h:92
Slant
Describes the requested font slant.
Definition Font.h:83
bool operator!=(const Font &a, const Font &b)
Returns true if two font requests are different.
Definition Font.h:230
Font(Category category, std::size_t size, Weight weight=Weight::Normal, Slant slant=Slant::Normal, Stretch stretch=Stretch::Normal)
Construct a font from a generic category.
static bool removeFont(const System::Path &path)
Removes one font file.
Weight
Describes the requested font weight.
Definition Font.h:68
std::size_t size() const
Returns the size of the font.
Font(const std::string &family, std::size_t size, Weight weight=Weight::Normal, Slant slant=Slant::Normal, Stretch stretch=Stretch::Normal)
Construct a font with explicit weight and slant.
bool hasStyleName() const
Returns true if an exact style name hint is set.
Stretch stretch() const
Returns the stretch of the font request.
Font withSize(std::size_t size) const
Returns a copy of this font with a different size.
Definition Font.h:269
Policy based smart pointer.
Definition SmartPtr.h:462
Represents a path in the file-system.
Definition Path.h:48
Graphics and imaging services.
Definition Api-Argb32Image.h:12
Core module.
Definition Allocator.h:33