mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-18 03:34:45 -04:00
Make setters return reference to self: Font
This commit is contained in:
parent
f9ef31c4b2
commit
739629354b
@ -68,32 +68,36 @@ int Font::GetStyle() const {
|
||||
return TTF_GetFontStyle(font_);
|
||||
}
|
||||
|
||||
void Font::SetStyle(int style) {
|
||||
Font& Font::SetStyle(int style) {
|
||||
TTF_SetFontStyle(font_, style);
|
||||
return *this;
|
||||
}
|
||||
|
||||
int Font::GetOutline() const {
|
||||
return TTF_GetFontOutline(font_);
|
||||
}
|
||||
|
||||
void Font::SetOutline(int outline) {
|
||||
Font& Font::SetOutline(int outline) {
|
||||
TTF_SetFontOutline(font_, outline);
|
||||
return *this;
|
||||
}
|
||||
|
||||
int Font::GetHinting() const {
|
||||
return TTF_GetFontHinting(font_);
|
||||
}
|
||||
|
||||
void Font::SetHinting(int hinting) {
|
||||
Font& Font::SetHinting(int hinting) {
|
||||
TTF_SetFontHinting(font_, hinting);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool Font::GetKerning() const {
|
||||
return TTF_GetFontKerning(font_);
|
||||
}
|
||||
|
||||
void Font::SetKerning(bool allowed) {
|
||||
Font& Font::SetKerning(bool allowed) {
|
||||
TTF_SetFontKerning(font_, allowed);
|
||||
return *this;
|
||||
}
|
||||
|
||||
int Font::GetHeight() const {
|
||||
|
@ -177,10 +177,12 @@ public:
|
||||
/// In this case, you should probably turn off these styles and draw your
|
||||
/// own strikethroughs and underlines.
|
||||
///
|
||||
/// \returns Reference to self
|
||||
///
|
||||
/// \see https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html#SEC22
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void SetStyle(int style = TTF_STYLE_NORMAL);
|
||||
Font& SetStyle(int style = TTF_STYLE_NORMAL);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current outline size of the loaded font
|
||||
@ -202,10 +204,12 @@ public:
|
||||
/// glyphs, even if there is no change in outline size, so it may be best
|
||||
/// to check the current outline size by using GetOutline() first
|
||||
///
|
||||
/// \returns Reference to self
|
||||
///
|
||||
/// \see https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html#SEC24
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void SetOutline(int outline = 0);
|
||||
Font& SetOutline(int outline = 0);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current hinting setting of the loaded font
|
||||
@ -235,10 +239,12 @@ public:
|
||||
/// glyphs, even if there is no change in hinting, so it may be best
|
||||
/// to check the current hinting by using GetHinting() first
|
||||
///
|
||||
/// \returns Reference to self
|
||||
///
|
||||
/// \see https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html#SEC26
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void SetHinting(int hinting = TTF_HINTING_NORMAL);
|
||||
Font& SetHinting(int hinting = TTF_HINTING_NORMAL);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current kerning setting of the loaded font
|
||||
@ -264,10 +270,12 @@ public:
|
||||
/// is not working for a specific font, resulting in overlapping
|
||||
/// glyphs or abnormal spacing within words.
|
||||
///
|
||||
/// \returns Reference to self
|
||||
///
|
||||
/// \see https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html#SEC28
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void SetKerning(bool allowed = true);
|
||||
Font& SetKerning(bool allowed = true);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the maximum pixel height of all glyphs of the loaded font
|
||||
|
Loading…
x
Reference in New Issue
Block a user