mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-18 11:42:47 +00:00
macOS: Fix loading fonts from user home ~/Library/Fonts dir
This commit is contained in:
parent
360172d7ba
commit
6b7ba57ba2
@ -10,12 +10,20 @@
|
|||||||
|
|
||||||
#include "app/font_path.h"
|
#include "app/font_path.h"
|
||||||
|
|
||||||
|
#include "base/fs.h"
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|
||||||
|
// TODO use a Cocoa API to get the list of paths
|
||||||
void get_font_dirs(base::paths& fontDirs)
|
void get_font_dirs(base::paths& fontDirs)
|
||||||
{
|
{
|
||||||
// TODO use a Cocoa API to get the list of paths
|
const char* home = std::getenv("HOME");
|
||||||
fontDirs.push_back("~/Library/Fonts");
|
if (home) {
|
||||||
|
fontDirs.push_back(
|
||||||
|
base::join_path(home, "Library/Fonts"));
|
||||||
|
}
|
||||||
fontDirs.push_back("/Library/Fonts");
|
fontDirs.push_back("/Library/Fonts");
|
||||||
fontDirs.push_back("/System/Library/Fonts/");
|
fontDirs.push_back("/System/Library/Fonts/");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user