Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2019-05-19 02:40:33 +0300
committerHarley Acheson <harley.acheson@gmail.com>2019-05-19 02:40:33 +0300
commit5f2578f32fdd3cf49d5299f0553dc756e4f670cf (patch)
tree65fd9d8faff4c327f94194fa609c382bfec52c1c /source/blender/blenkernel/intern/appdir.c
parent1fce0460d5222604e7007518bc246c97286312f3 (diff)
UI: Default Directory for Windows Fonts
This patch gives new Windows users a better default preference for fonts folder Differential Revision: https://developer.blender.org/D4725 Reviewed by Campbell Barton and Brecht Van Lommel
Diffstat (limited to 'source/blender/blenkernel/intern/appdir.c')
-rw-r--r--source/blender/blenkernel/intern/appdir.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index c1ea57c5fcc..5c4c7066d64 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -30,6 +30,7 @@
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
+#include "BLI_string_utf8.h"
#include "BKE_blender_version.h"
#include "BKE_appdir.h" /* own include */
@@ -1024,3 +1025,16 @@ void BKE_tempdir_session_purge(void)
BLI_delete(btempdir_session, true, true);
}
}
+
+/* Gets a good default directory for fonts */
+bool BKE_appdir_fonts_folder_default(char *dir)
+{
+ bool success = false;
+#ifdef WIN32
+ wchar_t wpath[FILE_MAXDIR];
+ success = SHGetSpecialFolderPathW(0, wpath, CSIDL_FONTS, 0);
+ BLI_strncpy_wchar_as_utf8(dir, wpath, FILE_MAXDIR);
+#endif
+ /* TODO: Values for other OSs */
+ return success;
+}