Merge branch 'master' of https://github.com/openfl/lime
This commit is contained in:
@@ -1,30 +1,60 @@
|
|||||||
package lime.graphics.cairo;
|
package lime.graphics.cairo;
|
||||||
|
|
||||||
|
|
||||||
import lime.text.Font;
|
import lime.text.Font;
|
||||||
import lime.system.System;
|
import lime.system.System;
|
||||||
|
|
||||||
class CairoFont
|
|
||||||
{
|
class CairoFont {
|
||||||
|
|
||||||
|
|
||||||
|
public var font (default, null):Font;
|
||||||
@:noCompletion public var handle:Dynamic;
|
@:noCompletion public var handle:Dynamic;
|
||||||
|
|
||||||
public var font(default,null):Font;
|
|
||||||
|
|
||||||
public function new( font : Font ) {
|
public function new (font:Font) {
|
||||||
|
|
||||||
#if lime_cairo
|
#if lime_cairo
|
||||||
|
|
||||||
this.font = font;
|
this.font = font;
|
||||||
handle = lime_cairo_ft_font_face_create_for_ft_face( font.src, 0 );
|
|
||||||
|
if (font != null && font.src != null) {
|
||||||
|
|
||||||
|
handle = lime_cairo_ft_font_face_create_for_ft_face (font.src, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy() {
|
|
||||||
|
public function destroy () {
|
||||||
|
|
||||||
#if lime_cairo
|
#if lime_cairo
|
||||||
lime_cairo_font_face_destroy (handle);
|
|
||||||
|
if (handle != null) {
|
||||||
|
|
||||||
|
lime_cairo_font_face_destroy (handle);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Native Methods
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (cpp || neko || nodejs)
|
#if (cpp || neko || nodejs)
|
||||||
private static var lime_cairo_ft_font_face_create_for_ft_face = System.load ("lime", "lime_cairo_ft_font_face_create_for_ft_face", 2);
|
private static var lime_cairo_ft_font_face_create_for_ft_face = System.load ("lime", "lime_cairo_ft_font_face_create_for_ft_face", 2);
|
||||||
private static var lime_cairo_font_face_destroy = System.load ("lime", "lime_cairo_font_face_destroy", 1);
|
private static var lime_cairo_font_face_destroy = System.load ("lime", "lime_cairo_font_face_destroy", 1);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -776,7 +776,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = "::targetPath::"; name = "::fontName::"; super (); }}
|
::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::"; super (); }}
|
||||||
::end::::end::::end::::end::
|
::end::::end::::end::::end::
|
||||||
|
|
||||||
#if (windows || mac || linux)
|
#if (windows || mac || linux)
|
||||||
@@ -793,7 +793,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
|||||||
#end
|
#end
|
||||||
|
|
||||||
#if openfl
|
#if openfl
|
||||||
::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = "::targetPath::"; name = "::fontName::";::end:: super (); }}
|
::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::";::end:: super (); }}
|
||||||
::end::::end::::end::
|
::end::::end::::end::
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user