You are here

A logo/icon for FOB

Keith and I have been working on the logo for the site. The original design was my fault. Keith wrote a Cairo/Nickle program to generate a cleaner, prettier version. I built a script (attached) to build a properly-constructed favicon out of a transparent PNG.

Keith will post his code shortly.

AttachmentSize
Plain text icon favicon-sh.txt481 bytes
Forum Topic: 
Taxonomy upgrade extras: 

Keithp actually posted the PNG for the new logo to his blog.

Well, linear gradients don't appear to work in the Cairo software PNG renderer. Sometimes.

Keith is using a radial gradient for the logo glasses until we can fix this.

Here's the nickle code I used to generate the logo. It's nasty inside, but that's no different from a hand-drawn logo.

[code]
#!/usr/bin/env nickle

autoimport Cairo;

void fob (cairo_t cr)
{
translate (cr, -7, -9);
scale (cr, 1.5, 1.5);

void face (cairo_t cr)
{
save (cr);
set_line_width (cr, 4);

scale (cr, 3.5, 4);
arc (cr, 9, 9, 7, 0, 2*pi);
save (cr);
pattern_t pat = Pattern::create_radial (12, 12, 0, 9, 9, 7);
Pattern::add_color_stop (pat, 0, 1, 1, 1, 1);
Pattern::add_color_stop (pat, 1, 1, .8, .6, 1);
set_pattern (cr, pat);
fill (cr);
restore (cr);
scale (cr, 1/3.5, 1/4);
stroke (cr);
restore (cr);
}

void lens (cairo_t cr, int x, int y)
{
save (cr);
translate (cr, x, y);
move_to (cr, 0, 0);
line_to (cr, 0, 10);
curve_to (cr, 0, 18, 13, 18, 13, 10);
line_to (cr, 13, 0);
line_to (cr, 0, 0);
if (true)
{
save (cr);
set_rgb_color (cr, .9, .9, .9);
fill (cr);
restore (cr);
}
if (false)
{
save (cr);
pattern_t pat = Pattern::create_radial (8, 8, 0, 8, 8, 30);
Pattern::add_color_stop (pat, 0, 1, 1, 1, 1);
Pattern::add_color_stop (pat, 1, .8, .8, .8, 1);
set_pattern (cr, pat);
fill (cr);
restore (cr);
}
restore (cr);
}

void letters (cairo_t cr)
{
save (cr);
select_font (cr, "sans", font_slant_t.NORMAL, font_weight_t.NORMAL);
scale_font (cr, 40);
rotate (cr, 90 * pi / 180);
translate (cr, 12, -20);
move_to (cr, 0, 0);
show_text (cr, "F");
move_to (cr, 8, 4);
show_text (cr, "B");
restore (cr);
}

void earpiece (cairo_t cr)
{
save (cr);
set_line_width (cr, 4);
move_to (cr, 10, 20);
rel_curve_to (cr, 7, 0, 3, 3, 8, 6);
stroke (cr);
restore (cr);
}

face (cr);
lens (cr, 18, 26);
lens (cr, 31, 26);
letters (cr);
earpiece (cr);
}

if (true)
{
cairo_t cr = new_png ("fob.png", 80, 90);
fob (cr);
destroy (cr);

cairo_t cr = new_png ("fob-16.png", 16, 16);
scale (cr, 0.1{7}, 0.1{7});
translate (cr, 5, 0);
fob (cr);
destroy (cr);

cairo_t cr = new_png ("fob-32.png", 32, 32);
scale (cr, 0.3{5}, 0.3{5});
translate (cr, 5, 0);
fob (cr);
destroy (cr);

cairo_t cr = new_png ("fob-48.png", 48, 48);
scale (cr, 0.5{3}, 0.5{3});
translate (cr, 5, 0);
fob (cr);
destroy (cr);
}
else
{
cairo_t cr = new ();
fob (cr);
sleep (10000000);
}
[/code]

Uh, the PNM scaler used by favicon.sh does a really world-class ugly job making a tiny version of the new logo. Oh well. Keith has better bitmaps generated directly by Cairo: I'll install them RSN.

The attached modified favicon-sh.txt will accept a --prescaled argument that causes it to use pre-built scaled images produced by, [u]for example[/u], Cairo.

I've updated the logo and favicon on the website: I think I'm done for now. Thanks to Keith for the Cairo work!

(Oops. You can't edit a comment to attach to it :-(. I'll submit another comment with the script I forgot. I also noticed I'm posting as 'admin'. Bad me.)

Looks like attachments to comments not OK. Hmm. I'll just overwrite the previous attachment.