The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Get name of fallback font from fontconfig

These changes was commited to the Birdfont repository Fri, 29 May 2015 17:47:38 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 29 May 2015 17:47:38 +0000]

Updated Files

libbirdfont/OverView.vala
libbirdfont/Renderer/CachedFont.vala
libbirdfont/Renderer/Text.vala
--- a/libbirdfont/OverView.vala +++ b/libbirdfont/OverView.vala @@ -1304,6 +1304,7 @@ character.set_text ((!) c.to_string ()); character.set_font_size (height); character.draw_at_top (cr, x + 10, y); + printd ("Fallback font: " + character.get_font_file_name ()); cr.restore (); }
--- a/libbirdfont/Renderer/CachedFont.vala +++ b/libbirdfont/Renderer/CachedFont.vala @@ -71,8 +71,17 @@ } return g; + } + + public string get_font_file_name () { + if (font == null) { + warning ("No font loaded."); + return ""; + } + + return (((!) font).font_file != null) ? (!) ((!) font).font_file : "".dup (); } } }
--- a/libbirdfont/Renderer/Text.vala +++ b/libbirdfont/Renderer/Text.vala @@ -55,6 +55,10 @@ set_text (text); set_font_size (size); + } + + public string get_font_file_name () { + return cached_font.get_font_file_name (); } public void use_cache (bool cache) {