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&
namefloat
sizeFont::Weight
weightFont::Style
style
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&
pathfloat
size
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
float
size_deltaFont::Weight
weightFont::Style
style
Return
Font*
std::string GetName() const
Return font's family name.
Return
std::string
float GetSize() const
Return font's DIP size.
Return
float
Font::Weight GetWeight() const
Return the font weight.
Return
Font::Weight
Font::Style GetStyle() const
Return the font style.
Return
Font::Style
NativeFont GetNative() const
Return the native instance wrapped by the class.
Return
NativeFont