29#ifndef PT_GFX_FONTFACE_H
30#define PT_GFX_FONTFACE_H
32#include <Pt/Gfx/Font.h>
33#include <Pt/SmartPtr.h>
51class PT_GFX_API FontFace
60 FontFace(
const std::string& family,
61 Weight weight = Weight::Normal,
62 Slant slant = Slant::Normal,
63 Stretch stretch = Stretch::Normal,
64 const std::string& styleName = std::string());
66 const std::string& family()
const;
71 const std::string&
name()
const;
73 const std::string& styleName()
const;
75 const std::string& style()
const;
77 Weight weight()
const;
81 Stretch stretch()
const;
90 return a.family() == b.family() &&
91 a.weight() == b.weight() &&
92 a.slant() == b.slant() &&
93 a.stretch() == b.stretch() &&
94 a.styleName() == b.styleName();
98inline bool operator!=(
const FontFace& a,
const FontFace& b)
100 return a.family() != b.family() ||
101 a.weight() != b.weight() ||
102 a.slant() != b.slant() ||
103 a.stretch() != b.stretch() ||
104 a.styleName() != b.styleName();
108inline bool operator<(
const FontFace& a,
const FontFace& b)
110 if(a.family() != b.family())
111 return a.family() < b.family();
113 if(a.weight() != b.weight())
114 return a.weight() < b.weight();
116 if(a.slant() != b.slant())
117 return a.slant() < b.slant();
119 if(a.stretch() != b.stretch())
120 return a.stretch() < b.stretch();
122 return a.styleName() < b.styleName();
132 , _weight(Font::Weight::Normal)
133 , _slant(Font::Slant::Normal)
134 , _stretch(Font::Stretch::Normal)
138 FontFaceData(
const std::string& family,
142 const std::string& styleName = std::string())
151 const std::string& family()
const
156 const std::string& styleName()
const
161 const std::string& style()
const
Resolved font family and style.
Definition FontFace.h:52
const std::string & name() const
Returns the family of the font face. Alias for family().
Stretch
Describes the requested font stretch.
Definition Font.h:92
Slant
Describes the requested font slant.
Definition Font.h:83
Weight
Describes the requested font weight.
Definition Font.h:68
Policy based smart pointer.
Definition SmartPtr.h:462
bool operator!=(const String &a, const String &b)
Compares two strings.
Definition Api-String.h:875
Graphics and imaging services.
Definition Api-Argb32Image.h:12
Core module.
Definition Allocator.h:33