Merge lp:~xnox/unity-greeter/off-the-grid into lp:unity-greeter

Proposed by Dimitri John Ledkov
Status: Merged
Approved by: Robert Ancell
Approved revision: 1124
Merged at revision: 1130
Proposed branch: lp:~xnox/unity-greeter/off-the-grid
Merge into: lp:unity-greeter
Diff against target: 130 lines (+69/-0)
4 files modified
.bzrignore (+2/-0)
debian/rules (+12/-0)
src/Makefile.am (+9/-0)
src/logo-generator.vala (+46/-0)
To merge this branch: bzr merge lp:~xnox/unity-greeter/off-the-grid
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Ancell Approve
Iain Lane (community) Needs Fixing
Review via email: mp+205896@code.launchpad.net

Commit message

Use logo-generator, to override /stock/ logo with an uptodate one.

Description of the change

I've fetched the ubuntu logo svg transparent mask from design.ubuntu.com, and trimmed to have no padding.
Then I've applied all the grid layout metrics and the logo exclusion areas metrics.
And finally, i've extended the logo with pango rendered logo-version strapline, fetched from a gsettings key.
Surprisingly, we don't have a tool that will print "16.04 LTS" (when one is running it, regardless if it's in development or became stable). I'll file a separate bug about it against ubuntu-distro-info.
Anyone, with this branch it means that we simply need to change default key and rebuild the package.
(Or we can add a gsettings key override to e.g. base-files package which consolidates most of the files that need to have "current ubuntu version strings and identifiers").

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1123
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~xnox/unity-greeter/off-the-grid/+merge/205896/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-greeter-ci/33/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-greeter-trusty-amd64-ci/16
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-greeter-trusty-armhf-ci/16

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity-greeter-ci/33/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Robert, I forget but I seem to recall there was a reason we couldn't auto-generate the words?

Revision history for this message
Iain Lane (laney) wrote :

Notwithstanding ↑, we agreed on #ubuntu-desktop to generate this at build-time. Thus the gsettings key goes away.

There's a wishlist item to have ubuntu-distro-info able to support the text (it almost can currently with -r), so we can do `ubuntu-distro-info -C trusty -r' or something. But that's not essential - having to change the string would be fine.

review: Needs Fixing
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I had a quick chat about this with seb, and he'd prefer image was generated
at buildtime instead of using a dconf key. I believe the metrics are
correct (including proper glyths of LT in ubuntu font) I'll generate stand
alone logo for lightdm and about computer and get them validated with
design next time I'm in the office.
On 12 Feb 2014 15:09, "Michael Terry" <email address hidden> wrote:

> Robert, I forget but I seem to recall there was a reason we couldn't
> auto-generate the words?
> --
> https://code.launchpad.net/~xnox/unity-greeter/off-the-grid/+merge/205896
> You are the owner of lp:~xnox/unity-greeter/off-the-grid.
>

Revision history for this message
Robert Ancell (robert-ancell) wrote :

> Robert, I forget but I seem to recall there was a reason we couldn't auto-
> generate the words?

I think it was just that the layout got quite complicated and design didn't specify anything other than "use this image".

lp:~xnox/unity-greeter/off-the-grid updated
1124. By Dimitri John Ledkov

Use logo-generator, to override /stock/ logo with an uptodate one.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I've now done the logo-generator as a standalone binary, which is executed from debian/rules to override the stock logo with an up-to-date one.

Patch for distro-info is submitted to bdrung to print requested release string, need to fix it up. So until distro-info is available the string is passed via debian/rules.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1124
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~xnox/unity-greeter/off-the-grid/+merge/205896/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-greeter-ci/34/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-greeter-trusty-amd64-ci/17
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-greeter-trusty-armhf-ci/17

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity-greeter-ci/34/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

<seb128> robert_ancell, hey, xnox pinged around eod for Laney and he said he would have a look tomorrow, but I'm sure he's going to be fine if you ack it

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-09-04 09:47:10 +0000
3+++ .bzrignore 2014-02-18 17:58:03 +0000
4@@ -20,6 +20,8 @@
5 src/*.c
6 src/unity_greeter_vala.stamp
7 src/unity-greeter
8+src/logo-generator
9+src/logo_generator_vala.stamp
10 tests/*.c
11 tests/unity_greeter_test_vala.stamp
12 tests/unity-greeter-test
13
14=== added file 'data/logo-bare.png'
15Binary files data/logo-bare.png 1970-01-01 00:00:00 +0000 and data/logo-bare.png 2014-02-18 17:58:03 +0000 differ
16=== modified file 'debian/rules'
17--- debian/rules 2013-06-26 07:25:01 +0000
18+++ debian/rules 2014-02-18 17:58:03 +0000
19@@ -8,3 +8,15 @@
20 override_dh_autoreconf:
21 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
22
23+
24+override_dh_auto_build:
25+ dh_auto_build
26+ ./src/logo-generator --logo data/logo-bare.png --text '14.04 LTS' --output logo.png
27+
28+override_dh_auto_install:
29+ dh_auto_install
30+ cp logo.png debian/unity-greeter/usr/share/unity-greeter/logo.png
31+
32+override_dh_auto_clean:
33+ dh_auto_clean
34+ rm -f logo.png
35
36=== modified file 'src/Makefile.am'
37--- src/Makefile.am 2013-11-12 03:45:00 +0000
38+++ src/Makefile.am 2014-02-18 17:58:03 +0000
39@@ -1,6 +1,7 @@
40 # -*- Mode: Automake; indent-tabs-mode: t; tab-width: 4 -*-
41
42 sbin_PROGRAMS = unity-greeter
43+noinst_PROGRAMS = logo-generator
44
45 unity_greeter_SOURCES = \
46 config.vapi \
47@@ -34,6 +35,8 @@
48 user-list.vala \
49 user-prompt-box.vala
50
51+logo_generator_SOURCES = logo-generator.vala
52+
53 unity_greeter_CFLAGS = \
54 $(UNITY_GREETER_CFLAGS) \
55 -w \
56@@ -44,6 +47,8 @@
57 -DPKGDATADIR=\""$(pkgdatadir)"\" \
58 -DINDICATORDIR=\""$(INDICATORDIR)"\"
59
60+logo_generator_CFLAGS = $(unity_greeter_CFLAGS)
61+
62 unity_greeter_VALAFLAGS = \
63 --pkg posix \
64 --pkg gtk+-3.0 \
65@@ -56,10 +61,14 @@
66 --pkg pixman-1 \
67 --target-glib 2.32
68
69+logo_generator_VALAFLAGS = $(unity_greeter_VALAFLAGS)
70+
71 unity_greeter_LDADD = \
72 $(UNITY_GREETER_LIBS) \
73 -lm
74
75+logo_generator_LDADD = $(unity_greeter_LDADD)
76+
77 unity_greeter_vala.stamp: $(top_srcdir)/config.h
78
79 DISTCLEANFILES = \
80
81=== added file 'src/logo-generator.vala'
82--- src/logo-generator.vala 1970-01-01 00:00:00 +0000
83+++ src/logo-generator.vala 2014-02-18 17:58:03 +0000
84@@ -0,0 +1,46 @@
85+public class Main : Object
86+{
87+
88+ private static string? file = null;
89+ private static string? text = null;
90+ private static string? result = null;
91+ private const OptionEntry[] options = {
92+ {"logo", 0, 0, OptionArg.FILENAME, ref file, "Path to logo", "LOGO"},
93+ {"text", 0, 0, OptionArg.STRING, ref text, "Sublogo text", "TEXT"},
94+ {"output", 0, 0, OptionArg.FILENAME, ref result, "Path to rendered output", "OUTPUT"},
95+ {null}
96+ };
97+
98+ public static int main(string[] args) {
99+ try {
100+ var opt_context = new OptionContext ("- OptionContext example");
101+ opt_context.set_help_enabled (true);
102+ opt_context.add_main_entries (options, null);
103+ opt_context.parse (ref args);
104+ } catch (OptionError e) {
105+ stdout.printf ("error: %s\n", e.message);
106+ stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
107+ return 0;
108+ }
109+ Cairo.ImageSurface surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, 245, 43);
110+ Cairo.Context context = new Cairo.Context (surface);
111+ context.translate (42, 11);
112+ Cairo.ImageSurface logo = new Cairo.ImageSurface.from_png (file);
113+ context.set_source_surface (logo, 0, 0);
114+ context.paint();
115+
116+ context.set_source_rgba (1, 1, 1, 1);
117+ context.translate (logo.get_width() + 0.25*logo.get_height(), logo.get_height());
118+
119+ var font_description = new Pango.FontDescription();
120+ font_description.set_family("Ubuntu");
121+ font_description.set_size((int)(0.75*logo.get_height() * Pango.SCALE));
122+ var layout = Pango.cairo_create_layout (context);
123+ layout.set_font_description (font_description);
124+ layout.set_text (text, -1);
125+ Pango.cairo_show_layout_line(context, layout.get_line(0));
126+
127+ surface.write_to_png(result);
128+ return 0;
129+ }
130+}

Subscribers

People subscribed via source and target branches