The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Write program version and OS to .birdfont file

These changes was commited to the Birdfont repository Sun, 13 Oct 2019 13:38:35 +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>
Sun, 13 Oct 2019 13:38:35 +0000 (15:38 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 13 Oct 2019 13:39:17 +0000 (15:39 +0200)
commit b2c77e26df30a9ffc5d66e01965cef9e26bcb6fb
tree c764bb0775cf24d5098262f09e125044a1ec9e10
parent 789326a33efce1476c0cb2ea87c88b1d4befaa02
Write program version and OS to .birdfont file

libbirdfont/BirdFont.vala
libbirdfont/BirdFontFile.vala
scripts/configfile.py
--- a/libbirdfont/BirdFont.vala +++ b/libbirdfont/BirdFont.vala @@ -26,6 +26,18 @@ public static string get_version () { return VERSION; + } + + public static string get_os () { + #if MAC + return "mac"; + #else + if (BirdFont.win32) { + return "windows"; + } else { + return "linux"; + } + #endif } public static void set_logging (bool log) {
--- a/libbirdfont/BirdFontFile.vala +++ b/libbirdfont/BirdFontFile.vala @@ -261,10 +261,14 @@ } public void write_root_tag (DataOutputStream os) throws GLib.Error { + string program_version = get_version (); + string operating_system = get_os (); + os.put_string ("""<?xml version="1.0" encoding="utf-8" standalone="yes"?>"""); os.put_string ("\n"); os.put_string ("<font>\n"); os.put_string (@"<format>$FORMAT_MAJOR.$FORMAT_MINOR</format>\n"); + os.put_string (@"<program version=\"$program_version\" os=\"$operating_system\" />\n"); } public void write_closing_root_tag (DataOutputStream os) throws GLib.Error {
--- a/scripts/configfile.py +++ b/scripts/configfile.py @@ -31,7 +31,7 @@ f.write("// Don't edit this file -- it is generated by the build script\n") f.write("namespace BirdFont {\n") - var_line = ' internal static const string %s = "%s";\n' + var_line = ' internal const string %s = "%s";\n' for name, value in vars: f.write(var_line % (name, value))