Merge pull request #1472 from nixbody/cffi-unicode-fixes
UNICODE fixes (clipboard, window title, file dialogs, paths, font glyphs, ...)
This commit is contained in:
@@ -188,10 +188,11 @@ class Font
|
||||
public function getGlyphs(characters:String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. "):Array<Glyph>
|
||||
{
|
||||
#if (lime_cffi && !macro)
|
||||
var glyphs:Dynamic = NativeCFFI.lime_font_get_glyph_indices(src, characters);
|
||||
// lime_font_get_glyph_indices returns Array<Int>
|
||||
// cast it to Array<Glyph> instead (Glyph is an abstract)
|
||||
return cast glyphs;
|
||||
#if hl
|
||||
return [for (index in NativeCFFI.lime_font_get_glyph_indices(src, characters)) new Glyph(index)];
|
||||
#else
|
||||
return NativeCFFI.lime_font_get_glyph_indices(src, characters);
|
||||
#end
|
||||
#else
|
||||
return null;
|
||||
#end
|
||||
|
||||
@@ -113,10 +113,7 @@ class FileDialog
|
||||
#if (!macro && lime_cffi)
|
||||
#if hl
|
||||
var bytes = NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath);
|
||||
if (bytes != null)
|
||||
{
|
||||
path = @:privateAccess String.fromUTF8(cast bytes);
|
||||
}
|
||||
path = bytes != null ? @:privateAccess String.fromUTF8(cast bytes) : null;
|
||||
#else
|
||||
path = NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath);
|
||||
#end
|
||||
@@ -157,10 +154,7 @@ class FileDialog
|
||||
#if (!macro && lime_cffi)
|
||||
#if hl
|
||||
var bytes = NativeCFFI.lime_file_dialog_open_directory(title, filter, defaultPath);
|
||||
if (bytes != null)
|
||||
{
|
||||
path = @:privateAccess String.fromUTF8(cast bytes);
|
||||
}
|
||||
path = bytes != null ? @:privateAccess String.fromUTF8(cast bytes) : null;
|
||||
#else
|
||||
path = NativeCFFI.lime_file_dialog_open_directory(title, filter, defaultPath);
|
||||
#end
|
||||
@@ -331,7 +325,7 @@ class FileDialog
|
||||
#if (!macro && lime_cffi)
|
||||
#if hl
|
||||
var bytes = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath);
|
||||
path = @:privateAccess String.fromUTF8(cast bytes);
|
||||
path = bytes != null ? @:privateAccess String.fromUTF8(cast bytes) : null;
|
||||
#else
|
||||
path = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath);
|
||||
#end
|
||||
|
||||
Reference in New Issue
Block a user