Add System.fontsDirectory
This commit is contained in:
@@ -31,6 +31,7 @@ class System {
|
||||
public static var desktopDirectory (get, null):String;
|
||||
public static var disableCFFI:Bool;
|
||||
public static var documentsDirectory (get, null):String;
|
||||
public static var fontsDirectory (get, null):String;
|
||||
public static var userDirectory (get, null):String;
|
||||
|
||||
|
||||
@@ -476,6 +477,17 @@ class System {
|
||||
}
|
||||
|
||||
|
||||
private static function get_fontsDirectory ():String {
|
||||
|
||||
#if (cpp || neko || nodejs)
|
||||
return lime_system_get_directory (SystemDirectory.FONTS, null, null);
|
||||
#else
|
||||
return null;
|
||||
#end
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static function get_userDirectory ():String {
|
||||
|
||||
#if (cpp || neko || nodejs)
|
||||
@@ -509,6 +521,7 @@ class System {
|
||||
var APPLICATION_STORAGE = 1;
|
||||
var DESKTOP = 2;
|
||||
var DOCUMENTS = 3;
|
||||
var USER = 4;
|
||||
var FONTS = 4;
|
||||
var USER = 5;
|
||||
|
||||
}
|
||||
@@ -13,6 +13,7 @@ namespace lime {
|
||||
APPLICATION_STORAGE,
|
||||
DESKTOP,
|
||||
DOCUMENTS,
|
||||
FONTS,
|
||||
USER
|
||||
|
||||
};
|
||||
|
||||
@@ -92,6 +92,39 @@ namespace lime {
|
||||
|
||||
}
|
||||
|
||||
case FONTS: {
|
||||
|
||||
#if defined (HX_WINRT)
|
||||
|
||||
return 0;
|
||||
|
||||
#elif defined (HX_WINDOWS)
|
||||
|
||||
char result[MAX_PATH] = "";
|
||||
SHGetFolderPath (NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, result);
|
||||
return std::string (result).c_str ();
|
||||
|
||||
#elif defined (HX_MACOS)
|
||||
|
||||
return "/Library/Fonts";
|
||||
|
||||
#elif defined (IPHONEOS)
|
||||
|
||||
return "/System/Library/Fonts/Cache";
|
||||
|
||||
#elif defined (ANDROID)
|
||||
|
||||
return "/system/fonts";
|
||||
|
||||
#elif defined (BLACKBERRY)
|
||||
|
||||
return "/usr/fonts/font_repository/monotype";
|
||||
|
||||
#endif
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case USER: {
|
||||
|
||||
#if defined (HX_WINRT)
|
||||
|
||||
Reference in New Issue
Block a user