From owner-freebsd-doc@FreeBSD.ORG Sun Aug 1 09:34:57 2004 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E548E16A4CE; Sun, 1 Aug 2004 09:34:57 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C45B43D1D; Sun, 1 Aug 2004 09:34:56 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i719Yb0s027545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 1 Aug 2004 10:34:37 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i719YbS8027544; Sun, 1 Aug 2004 10:34:37 +0100 (BST) (envelope-from matthew) Date: Sun, 1 Aug 2004 10:34:37 +0100 From: Matthew Seaman To: Murray Stokely Message-ID: <20040801093436.GA25901@happy-idiot-talk.infracaninophile.co.uk> References: <20040724092210.GA7369@comp.chem.msu.su> <20040724135202.GA24947@submonkey.net> <20040724140608.GE7369@comp.chem.msu.su> <20040801061047.GC27954@hub.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <20040801061047.GC27954@hub.freebsd.org> User-Agent: Mutt/1.5.6i X-Greylist: Message not sent from an IPv4 address, not delayed by milter-greylist-1.5.3 (smtp.infracaninophile.co.uk [0.0.0.0]); Sun, 01 Aug 2004 10:34:37 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040705, clamav-milter version 0.74a on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,CASHCASHCASH autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: Yar Tikhiy cc: Ceri Davies cc: doc@freebsd.org Subject: Re: Style for a long callout list X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Aug 2004 09:34:58 -0000 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 01, 2004 at 06:10:47AM +0000, Murray Stokely wrote: > On Sat, Jul 24, 2004 at 06:06:09PM +0400, Yar Tikhiy wrote: > > > Stick with it for now. We're hoping to add callout images up to 25 s= ome > > > time soon. > >=20 > > I see, thanks! >=20 > Maybe you guys could help us out and just generate the little images > required? We only go up to 15 right now, as that is the most needed > by the Handbook. As Ceri said, we'd like to have images up to at > least 25. Since you are the first to need those images, how about > making them for us and committing them to the tree? =3D) >=20 > It should actually be possible to make these from the command line > with tools like ImageMagick. We just need a circle with a number on > top of it. It's Sunday. I was bored. Here's a script to generate those images: #!/usr/bin/perl -w use strict; use POSIX qw(floor ceil); use GD; $0 =3D~ s@^.*/@@; sub colourARGB($$$$) { my $alpha =3D shift; my $red =3D shift; my $green =3D shift; my $blue =3D shift; # Alpha is in range 0 (opaque) to 127 (fully transparent), # R, G, B in range 0 .. 255. Force values into range. $alpha &=3D 0x7f; $red &=3D 0xff; $green &=3D 0xff; $blue &=3D 0xff; return $alpha << 24 | $red << 16 | $green << 8 | $blue; } MAIN: { my $im; # The Image object my $xsize =3D 16; my $ysize =3D 16; my $font =3D "/usr/X11R6/lib/X11/fonts/bitstream-vera/VeraMoBd.ttf"; # Bitstream Vera Mono Bold. my $bgcol =3D colourARGB( 127, 255, 255, 255 ); # Transparent White my $fgcol =3D colourARGB( 0, 255, 204, 0 ); # Orange my $txcol =3D colourARGB( 0, 0, 0, 0 ); # Black #my $bgcol =3D colourARGB( 127, 255, 255, 255 ); # Transparen= t White #my $fgcol =3D colourARGB( 0, 153, 0, 0 ); # Daemon Red #my $txcol =3D colourARGB( 0, 255, 255, 255 ); # White my $text =3D "25"; # What to write onto the image my $fsize; # Font size my @bounds; # For compositing text onto image my $x; # Coords of LL of text my $y; # Coords of LL of text # Usage: calloutnum.pl [text [size]] $text =3D $ARGV[0] if ( defined $ARGV[0] ); $xsize =3D $ysize =3D $ARGV[1] if ( defined $ARGV[1] ); $fsize =3D $xsize / 2; $im =3D new GD::Image->newTrueColor( $xsize, $ysize ) || die "$0: Failed to create image -- $!\n"; $im->saveAlpha(1); # Fill image with background colour, center a circle of foreground # colour on top of that, and write a number centered in that. $im->alphaBlending(0); $im->filledRectangle( 0, 0, $xsize - 1, $ysize - 1, $bgcol ); $im->alphaBlending(1); $im->setAntiAliased($fgcol); $im->filledEllipse( $xsize / 2, $ysize / 2, $xsize - 2, $ysize - 2, gdAntiAliased ); # First, get the bounding box for the text. Choose fontsize so that # 2 characters will approx. fill image size. @bounds =3D GD::Image->stringFT( $txcol, $font, $fsize, 0, 0, 0, $text ) or die "$0: Can't render text -- $@\n"; $x =3D floor( 0.5 * ( $xsize + $bounds[0] - $bounds[2] - 1 ) ); $y =3D ceil( 0.5 * ( $ysize + $bounds[1] - $bounds[7] ) ); $im->stringFT( $txcol, $font, $fsize, 0, $x, $y, $text ) || die "$0: Can't write using TrueType font -- $@\n"; print $im->png; } # # That's All Folks! # Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --RnlQjJ0d97Da+TV1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFBDLksiD657aJF7eIRAknfAJ9MaN6gOz7R0oS/T7V2xpo+In4aIQCgsK/Z bSItubknQsh5WNy6pp6ObKQ= =fhjD -----END PGP SIGNATURE----- --RnlQjJ0d97Da+TV1--