The Birdfont Source Code


All Repositories / birdfont.git / commit – 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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 29 May 2015 17:47:38 +0000 (19:47 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 29 May 2015 17:47:38 +0000 (19:47 +0200)
commit 5b021d30a564faf1abd5854f8748afd011600c70
tree c777abfa1dffc27d47da56a7b83408a809728245
parent 50a7bdaed9628df0e5f96fed787d0803b82da64f
Get name of fallback font from fontconfig

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) {