The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix export bug

These changes was commited to the Birdfont repository Fri, 26 Jun 2015 08:55:34 +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, 26 Jun 2015 08:55:34 +0000 (10:55 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 26 Jun 2015 08:55:34 +0000 (10:55 +0200)
commit 13887d659eda2ad412e554830cc7719370b40c8d
tree b4621b903ae9de209d70b6feff7a3ab5a58d7df2
parent 8ba846e350a816222d8382e3541b12efb184d97b
Fix export bug
Two TTF files can not have the same name

libbirdfont/ExportTool.vala
libbirdfont/MenuTab.vala
--- a/libbirdfont/ExportTool.vala +++ b/libbirdfont/ExportTool.vala @@ -394,10 +394,20 @@ File ttf_file_mac; File eot_file; bool done = true; + string ttf_name; + string ttf_name_mac; try { - ttf_file = get_child (folder, ExportSettings.get_file_name (current_font) + ".ttf"); - ttf_file_mac = get_child (folder, ExportSettings.get_file_name_mac (current_font) + ".ttf"); + ttf_name = ExportSettings.get_file_name (current_font) + ".ttf"; + ttf_name_mac = ExportSettings.get_file_name_mac (current_font) + ".ttf"; + + if (ttf_name == ttf_name_mac) { + warning ("Same file name for the two ttf files."); + ttf_name_mac = ExportSettings.get_file_name_mac (current_font) + " Mac.ttf"; + } + + ttf_file = get_child (folder, ttf_name); + ttf_file_mac = get_child (folder, ttf_name_mac); eot_file = get_child (folder, ExportSettings.get_file_name (current_font) + ".eot"); printd (@"Writing TTF fonts to $((!) ttf_file.get_path ())\n");
--- a/libbirdfont/MenuTab.vala +++ b/libbirdfont/MenuTab.vala @@ -105,6 +105,15 @@ return false; } + string ttf_name = ExportSettings.get_file_name (current_font) + ".ttf"; + string ttf_name_mac = ExportSettings.get_file_name_mac (current_font) + ".ttf"; + + if (ttf_name == ttf_name_mac) { + warning ("You need to choose a different name for the TTF file with Mac adjustmets."); + ttf_name_mac = ExportSettings.get_file_name_mac (current_font) + " Mac.ttf"; + return false; + } + return true; }