summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-18 19:03:53 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-18 19:03:53 -0300
commit0bbb0d0caadcabb4228482424a3809c7132aa557 (patch)
treed1e5336276327fa9ff1da59dad15e8e4992a1a2a /scene
parent4b05181397bb916b20d0eec3d1c640e028896eda (diff)
DynamicFontData can be built-in (will still link to a ttf though), closes #4600
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/dynamic_font.cpp11
-rw-r--r--scene/resources/dynamic_font.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 3503d3bdb1..09c4f4e8cb 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -66,11 +66,22 @@ void DynamicFontData::set_font_path(const String& p_path) {
font_path=p_path;
}
+String DynamicFontData::get_font_path() const {
+ return font_path;
+}
+
void DynamicFontData::set_force_autohinter(bool p_force) {
force_autohinter=p_force;
}
+void DynamicFontData::_bind_methods() {
+ ObjectTypeDB::bind_method(_MD("set_font_path","path"),&DynamicFontData::set_font_path);
+ ObjectTypeDB::bind_method(_MD("get_font_path"),&DynamicFontData::get_font_path);
+
+ ADD_PROPERTY(PropertyInfo(Variant::STRING,"font_path",PROPERTY_HINT_FILE,"*.ttf,*.otf"),_SCS("set_font_path"),_SCS("get_font_path"));
+}
+
DynamicFontData::DynamicFontData()
{
diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h
index 87a59abf06..508d630218 100644
--- a/scene/resources/dynamic_font.h
+++ b/scene/resources/dynamic_font.h
@@ -60,10 +60,14 @@ friend class DynamicFont;
Ref<DynamicFontAtSize> _get_dynamic_font_at_size(int p_size);
+protected:
+
+ static void _bind_methods();
public:
void set_font_ptr(const uint8_t* p_font_mem,int p_font_mem_size);
void set_font_path(const String& p_path);
+ String get_font_path() const;
void set_force_autohinter(bool p_force);
DynamicFontData();