Commit 4c80cdc
Load default font
Changed files (2)
Diff
@@ -96,7 +96,7 @@ public class KeyBindings { public static bool require_modifier; - public uint get_modifiers () {+ public static uint get_modifiers () { return modifier; } @@ -120,8 +120,8 @@ public class KeyBindings { } public static void remove_modifier_from_keyval (uint keyval) {- uint mod = get_mod_from_key (keyval);- set_modifier (modifier ^ mod); + uint mod = 0xFFFFFF ^ get_mod_from_key (keyval);+ set_modifier (modifier & mod); } public static void add_modifier_from_keyval (uint keyval) {@@ -22,11 +22,7 @@ public class Text : Widget { public Font font { get { if (current_font == null) {- File path = SearchPaths.find_file (null, "roboto.bf");- current_font = new Font ();- if (!load_font ((!) path.get_path ())) {- current_font = new Font ();- }+ load_default_font (); } return (!) current_font;@@ -71,6 +67,13 @@ public class Text : Widget { set_text (text); } + public static void load_default_font () {+ File path = SearchPaths.find_file (null, "roboto.bf");+ if (FontCache.get_default_cache ().get_font ((!) path.get_path ()) == null) {+ warning ("Default font not found.");+ }+ }+ public void set_font_size (double height_in_pixels) { font_size = height_in_pixels; sidebearing_extent = 0;