diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-06-16 16:58:51 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-06-16 16:58:51 +0200 |
commit | cc5dcc0e0c22e16ed8ce8c598ccb58843175a177 (patch) | |
tree | 85d8233900b17cdad74bdb29e82b175a7e01bd12 /src/logo-generator.vala | |
parent | a78a48fb1f29ccfbac0872cbb09846fceb939020 (diff) | |
download | arctica-greeter-cc5dcc0e0c22e16ed8ce8c598ccb58843175a177.tar.gz arctica-greeter-cc5dcc0e0c22e16ed8ce8c598ccb58843175a177.tar.bz2 arctica-greeter-cc5dcc0e0c22e16ed8ce8c598ccb58843175a177.zip |
src/logo-generator.vala: Make logo-generator more flexible. Allow passing-in of output logo's width and height. Fix placing of version string.
Diffstat (limited to 'src/logo-generator.vala')
-rw-r--r-- | src/logo-generator.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/logo-generator.vala b/src/logo-generator.vala index 23a45d2..0556466 100644 --- a/src/logo-generator.vala +++ b/src/logo-generator.vala @@ -4,9 +4,13 @@ public class Main : Object private static string? file = null; private static string? text = null; private static string? result = null; + private static int width = 245; + private static int height = 44; private const OptionEntry[] options = { {"logo", 0, 0, OptionArg.FILENAME, ref file, "Path to logo", "LOGO"}, {"text", 0, 0, OptionArg.STRING, ref text, "Sublogo text", "TEXT"}, + {"width", 0, 0, OptionArg.INT, ref width, "Logo width", "WIDTH"}, + {"height", 0, 0, OptionArg.INT, ref height, "Logo height", "HEIGHT"}, {"output", 0, 0, OptionArg.FILENAME, ref result, "Path to rendered output", "OUTPUT"}, {null} }; @@ -22,15 +26,15 @@ public class Main : Object stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]); return 0; } - Cairo.ImageSurface surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, 245, 44); + Cairo.ImageSurface surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height); Cairo.Context context = new Cairo.Context (surface); Cairo.ImageSurface logo = new Cairo.ImageSurface.from_png (file); context.set_source_surface (logo, 0, 0); context.paint(); context.set_source_rgb (0.7, 0.7, 0.7); - context.translate (logo.get_width(), logo.get_height()); - context.move_to (0.2*logo.get_height(),-24); + context.translate ( logo.get_width(), logo.get_height() - 0.1*logo.get_height() ); + context.move_to (0.2*logo.get_height(), 0); var font_description = new Pango.FontDescription(); font_description.set_family("Droid Sans"); |