Font
Native font.
| Header | #include "nativeui/gfx/font.h" |
| Namespace | namespace nu |
| Type | class (RefCounted) |
Constructors
Font(const std::string& name, float size, Font::Weight weight, Font::Style style)
Create a Font implementation with the specified name, DIP size,
weight and style.
Parameters
const std::string&namefloatsizeFont::WeightweightFont::Stylestyle
Font(const base::FilePath& path, float size)
Create a Font by reading from |path|. If the font file contains multiple families or weights, only the first encountered font will be used.
Parameters
const base::FilePath&pathfloatsize
Class methods
Font* Default()
Return the default font used for displaying text.
Return
Font*Methods
Font* Derive(float size_delta, Font::Weight weight, Font::Style style) const
Returns a new Font derived from the existing font.
The size_delta is the size in DIP to add to the current font.
Parameters
floatsize_deltaFont::WeightweightFont::Stylestyle
Return
Font*std::string GetName() const
Return font's family name.
Return
std::stringfloat GetSize() const
Return font's DIP size.
Return
floatFont::Weight GetWeight() const
Return the font weight.
Return
Font::WeightFont::Style GetStyle() const
Return the font style.
Return
Font::StyleNativeFont GetNative() const
Return the native instance wrapped by the class.
Return
NativeFont