[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

images de navigation



Salut Denis,

(je mets ici pour l'archivage :-))

J'ai réglé le problème de l'image about.fr.gif : il y a juste une
ligne à modifier dans debbar.pl pour réussir. 

Cela dit, j'ai dû modifier le MakeFile de french/Pics pour ajouter le
script debbar_about.fr.pl dans le même répertoire, script qui est la
modification de debbar (dans english/Pics) juste pour fixer la
position de about.fr.gif.

Le seul em... est que l'en-tête du MakeFile demande de ne pas le
modifier (pour que cela soit fait par le mainteneur ad hoc). Peut-être
que l'on aura une dérogation pour french (mais c'est dangereux in fine
car on risque de rater une mise à jour ultérieure).

Je te propose en attendant de commiter le tout tel quel et que, en
tant que mainteneur, tu règles cela avec les gars qui s'en occupent
pour avoir une nouvelle option pour régler cela .

(Solution personnelle:
je pense qu'ajouter la bonne valeur dans pics.conf du genre

# Button text for your language                      

ABOUT_TEXT   := "À propos"

en

@ABOUT_TEXT   := ("À propos", <valeur> )

Par défaut <valeur> vaut 3 dans le script Perl debbar.

Ce serait alors facile de personnaliser à la main au cas par cas. Cela
demande revoir juste un peu le script de parsing du fichier de
configuration mais c'est quasiment une broutille)

Voilà, tout à commiter dans webwmlfrench/Pics

- about.fr.gif
- MakeFile
- debbar_about.fr.pl  (chmod 755)

Merci

PK

GIF image

# This Makefile should need no changes from webwml/english/Pics/Makefile
# Please send a message to debian-www if you need to modify anything
# so the problem can be fixed.

# random hint: for i in ../../english/Pics/*.png ../../english/Pics/debian.jpg ../../english/Pics/logo-50.jpg; do ln -s $i . ; done

#
# CAUTION: this Makefile has been modified by Patrice Karatchentzeff
# <p.karatchentzeff@free.fr> in violation of the previous comment
# until a clean solution would proposed.
# 
# The modification is for fixing the bad position of the about.fr.gif 
# text position.
# 


WMLBASE=..
CUR_DIR=Pics
SUBS=

include $(WMLBASE)/Make.lang

include pics.conf

debbar_mod := ./debbar_about.fr.pl
debbar := $(ENGLISHDIR)/Pics/debbar.pl
ifneq "$(wildcard debbar.pl)" ""
debbar := ./debbar.pl
endif

ifneq "$(ANTIALIAS)" ""
debbar += -antialias $(ANTIALIAS)
debbar_mod += -antialias $(ANTIALIAS)
endif
ifneq "$(FONTFACE)" ""
debbar += -fontface $(FONTFACE)
debbar_mod += -fontface $(FONTFACE)
endif
ifneq "$(FONTSIZE)" ""
debbar += -fontsize $(FONTSIZE)
debbar_mod += -fontsize $(FONTSIZE)
endif
ifneq "$(FONTTYPE)" ""
debbar += -fonttype $(FONTTYPE)
debbar_mod += -fonttype $(FONTTYPE)
endif
ifneq "$(FONTREGISTRY)" ""
debbar += -fontregistry $(FONTREGISTRY)
debbar_mod += -fontregistry $(FONTREGISTRY)
endif
ifneq "$(FONTENCODING)" ""
debbar += -fontencoding $(FONTENCODING)
debbar_mod += -fontencoding $(FONTENCODING)
endif

about.$(LANGUAGE).gif:
	$(debbar_mod) -words $(ABOUT_TEXT) -o $(CURDIR)/$@
devel.$(LANGUAGE).gif:
	$(debbar) -words $(DEVEL_TEXT) -o $(CURDIR)/$@
distrib.$(LANGUAGE).gif:
	$(debbar) -words $(DISTRIB_TEXT) -o $(CURDIR)/$@
news.$(LANGUAGE).gif:
	$(debbar) -words $(NEWS_TEXT) -o $(CURDIR)/$@
search.$(LANGUAGE).gif:
	$(debbar) -words $(SEARCH_TEXT) -o $(CURDIR)/$@
sitemap.$(LANGUAGE).gif:
	$(debbar) -words $(SITEMAP_TEXT) -o $(CURDIR)/$@
support.$(LANGUAGE).gif:
	$(debbar) -words $(SUPPORT_TEXT) -o $(CURDIR)/$@

pics: about.$(LANGUAGE).gif devel.$(LANGUAGE).gif distrib.$(LANGUAGE).gif \
  news.$(LANGUAGE).gif search.$(LANGUAGE).gif sitemap.$(LANGUAGE).gif \
  support.$(LANGUAGE).gif
#!/usr/bin/perl -w
#
# Perl script to generate the Debian toolbar icons
# By Craig Small <csmall@debian.org>, modified by various people
#
# See webwml/english/Pics/README for more information.
#
# modified by Patrice Karatchentzeff <p.karatchentzeff@free.fr>
# for resizing the about.r.gif text position.
# I change the original script name in  debbar_about.fr.pl
# instead of debbar.pl

use strict;
use Gimp qw( :auto ); 
use Gimp::Fu; 
   
sub debian_button {
	my ($words, $antialias, $fontface, $fontsize, $fonttype, $fontcolor, $bgcolor, $fontregistry, $fontencoding) = @_;
	my ($image,$layer,$text,$width);
	my $height = 18;

	gimp_palette_set_foreground($fontcolor);
	gimp_palette_set_background($bgcolor);


	$image = gimp_image_new(80, $height, RGB);
	$layer = gimp_layer_new($image, 80, $height, RGBA_IMAGE, "Button", 100, NORMAL_MODE);
	$text = gimp_text($image, $layer, 9,1, $words, 0, $antialias, $fontsize, PIXELS, "*", $fontface, $fonttype, "r", "*", "*", $fontregistry, $fontencoding);


	$width = gimp_drawable_width($text);

	# Resize everything
	gimp_image_resize($image, ($width + $height), $height, 0, 0);
	gimp_layer_resize($layer, ($width + $height), $height, 0, 0);

	gimp_image_add_layer($image, $layer, 0);


	gimp_selection_all($image);
	gimp_edit_clear($layer);

        gimp_rect_select($image, 9, 0, $width, $height, REPLACE, 0, 0);
	gimp_ellipse_select($image, (9-($height/2)), 0, $height, $height, ADD, 0, 0, 0);
	gimp_ellipse_select($image, ((9+$width) - ($height/2)), 0, $height, $height, ADD, 0,0,0);
	gimp_bucket_fill($layer, BG_BUCKET_FILL, NORMAL_MODE, 100, 0, 0, 5, 5);
	gimp_selection_none($image);

	gimp_floating_sel_anchor($text);

	gimp_palette_set_background("#df0451");

	gimp_convert_indexed($image, 0, 0, 8, 0, 0, "");

	return $image;
}
 
   
register 
      "debian_button",
      "Create Debian Toolbar button",            # a small description 
      "A script to generate Debian navbar",      # a help text
      "Craig Small",
      "Copyright (c) 1998, 2001  SPI Inc.",
      "2001-06-10",
      "<Toolbox>/Xtns/Perl-Fu/Debian/Toolbar",   # menu path
      "*",                                       # Image types
      [ 
       [PF_STRING, "words", "Words to put in button", "About"], 
       [PF_BOOL, "antialias", "Use anti-aliasing", 1], 
       [PF_STRING, "fontface", "Font face", "Arial"], 
       [PF_INT, "fontsize", "Font size", "14"], 
       [PF_STRING, "fonttype", "Font type (e.g. bold, medium)", "bold"], 
       [PF_COLOR, "fontcolor", "Font color", [255,255,255]] ,
       [PF_COLOR, "bgcolor", "Background color", [0,0,132]],
       [PF_STRING, "fontregistry", "Font registry (e.g. iso8859)", "*"], 
       [PF_STRING, "fontencoding", "Font encoding (e.g. 1)", "*"]
      ], 
      \&debian_button; 
   
  exit main()

-- 
      |\      _,,,---,,_       Patrice KARATCHENTZEFF
ZZZzz /,`.-'`'    -.  ;-;;,_   mailto:p.karatchentzeff@free.fr
     |,4-  ) )-,_. ,\ (  `'-'  http://p.karatchentzeff.free.fr
    '---''(_/--'  `-'\_)       

Reply to: