Commit b2c77e2
Write program version and OS to .birdfont file
Changed files (3)
modifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/BirdFontFile.valamodifiedscripts/configfile.py
Diff
@@ -28,6 +28,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) { BirdFont.logging = log; }@@ -261,10 +261,14 @@ class BirdFontFile : GLib.Object { } 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 {@@ -31,7 +31,7 @@ def write_config (prefix): 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))