mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
freetype: Get DejaVuSansMono.ttf from the assets directory
This commit is contained in:
parent
c10aab9830
commit
da6b7987f1
@ -24,6 +24,8 @@
|
|||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
#include <retro_miscellaneous.h>
|
#include <retro_miscellaneous.h>
|
||||||
|
#include <string/stdstring.h>
|
||||||
|
#include "../../configuration.h"
|
||||||
|
|
||||||
#ifdef WIIU
|
#ifdef WIIU
|
||||||
#include <wiiu/os.h>
|
#include <wiiu/os.h>
|
||||||
@ -268,6 +270,7 @@ error:
|
|||||||
* but should hopefully work ... */
|
* but should hopefully work ... */
|
||||||
|
|
||||||
static const char *font_paths[] = {
|
static const char *font_paths[] = {
|
||||||
|
"assets://pkg/DejaVuSansMono.ttf",
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
"C:\\Windows\\Fonts\\consola.ttf",
|
"C:\\Windows\\Fonts\\consola.ttf",
|
||||||
"C:\\Windows\\Fonts\\verdana.ttf",
|
"C:\\Windows\\Fonts\\verdana.ttf",
|
||||||
@ -295,9 +298,18 @@ static const char *font_renderer_ft_get_default_font(void)
|
|||||||
return "";
|
return "";
|
||||||
#else
|
#else
|
||||||
size_t i;
|
size_t i;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
char asset_path[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(font_paths); i++)
|
for (i = 0; i < ARRAY_SIZE(font_paths); i++)
|
||||||
{
|
{
|
||||||
|
/* Check if we are getting the font from the assets directory. */
|
||||||
|
if (string_is_equal(font_paths[i], "assets://pkg/DejaVuSansMono.ttf"))
|
||||||
|
{
|
||||||
|
fill_pathname_join(asset_path, settings->paths.directory_assets, "pkg/DejaVuSansMono.ttf", PATH_MAX_LENGTH);
|
||||||
|
font_paths[i] = asset_path;
|
||||||
|
}
|
||||||
|
|
||||||
if (filestream_exists(font_paths[i]))
|
if (filestream_exists(font_paths[i]))
|
||||||
return font_paths[i];
|
return font_paths[i];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user