Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions coresdk/src/coresdk/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,6 @@ namespace splashkit_lib
return has_font(_fonts.find(name)->second);
}

bool font_has_size(font fnt, int font_size)
{
if (has_font(fnt))
{
return fnt->_data.count(font_size) > 0;
}
else
{
LOG(WARNING) << "Asking if font has size on invalid font.";
}

return false;
}

bool font_has_size(const string &name, int font_size)
{
return font_has_size(font_named(name), font_size);
}

void font_load_size(font fnt, int font_size)
{
if (has_font(fnt))
{
sk_add_font_size(fnt, font_size);
}
else
{
LOG(WARNING) << "font_load_size failed: font does not exist.";
}
}

void font_load_size(const string &name, int font_size)
{
return font_load_size(font_named(name), font_size);
}

font font_named(string name)
{
if (has_font(name))
Expand Down
40 changes: 0 additions & 40 deletions coresdk/src/coresdk/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,6 @@ namespace splashkit_lib
* @attribute method load_size
* @attribute self fnt
*/
void font_load_size(font fnt, int font_size);

/**
* @brief Loads a new size for an already loaded `font`.
*
* @param name The name of the `font` to load the size for.
* @param font_size The desired size of the `font`.
*
* @attribute suffix name_as_string
*/
void font_load_size(const string &name, int font_size);

/**
* @brief Checks if the supplied `font` has been loaded.
*
* @param fnt The `font` to check if loaded.
*
* @returns Returns true if the specified `font` is loaded.
*/
bool has_font(font fnt);

/**
Expand All @@ -173,27 +154,6 @@ namespace splashkit_lib
*
* @returns Returns true if the supplied `font` has the supplied size.
*/
bool font_has_size(font fnt, int font_size);

/**
* @brief Checks if the supplied `font` has the supplied size.
*
* @param name The name of the `font` to be checked.
* @param font_size The size to check.
*
* @attribute suffix name_as_string
*
* @returns Returns true if there is a font with the supplied name that has the supplied size.
*/
bool font_has_size(const string &name, int font_size);

/**
* @brief Finds a loaded font that has the supplied name and returns it.
*
* @param name The name of the font to find.
*
* @returns Returns the font that has the supplied name.
*/
font font_named(string name);

/**
Expand Down
4 changes: 0 additions & 4 deletions coresdk/src/test/test_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ void test_font_auto_load()

cout << "The next line should fail as the font has not been loaded." << endl;
cout << flush;
font_load_size("fail", 20);

cout << "Checking is size 50 exists. Should be false: " << font_has_size("leaguegothic", 50) << endl;
font_load_size("leaguegothic", 50);
cout << "Checking if size 50 exists. Should be true: " << font_has_size("leaguegothic", 50) << endl;
draw_text(
"Preloaded... (UNDERLINE)",
COLOR_BLACK,
Expand Down