3 # usage: ./nexbrand.sh "2.0.1 RC 1" rc1
4 # writes "2.0.1 RC 1" on rc1.tga
5 # NOTE: unfortunately requires X-server (otherwise file-tga-save won't work... no joke)
12 (define (nexuiz-brand-image img text size font)
15 (text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font)))
19 (feather3 (/ size 10))
20 (width (car (gimp-drawable-width text-layer)))
21 (height (car (gimp-drawable-height text-layer)))
22 (posx (- (car (gimp-drawable-offsets text-layer))))
23 (posy (- (cadr (gimp-drawable-offsets text-layer))))
24 (glow-layer (car (gimp-layer-copy text-layer TRUE)))
26 (gimp-layer-resize text-layer width (+ 36 height) 0 0)
27 (gimp-image-resize img width (+ 36 height) 0 0)
28 (gimp-image-resize-to-layers img)
29 (gimp-image-add-layer img glow-layer 1)
30 (gimp-layer-translate glow-layer posx posy)
31 (gimp-selection-none img)
32 (gimp-layer-set-preserve-trans text-layer TRUE)
33 (gimp-context-set-background '(0 0 0))
34 (gimp-edit-fill text-layer BACKGROUND-FILL)
35 (gimp-selection-layer-alpha text-layer)
36 (gimp-selection-feather img feather1)
37 (gimp-context-set-background '(221 0 0))
38 (gimp-edit-fill glow-layer BACKGROUND-FILL)
39 (gimp-edit-fill glow-layer BACKGROUND-FILL)
40 (gimp-edit-fill glow-layer BACKGROUND-FILL)
41 (gimp-selection-layer-alpha text-layer)
42 (gimp-selection-feather img feather2)
43 (gimp-context-set-background '(232 217 18))
44 (gimp-edit-fill glow-layer BACKGROUND-FILL)
45 (gimp-edit-fill glow-layer BACKGROUND-FILL)
46 (gimp-selection-layer-alpha text-layer)
47 (gimp-selection-feather img feather3)
48 (gimp-context-set-background '(255 255 255))
49 (gimp-edit-fill glow-layer BACKGROUND-FILL)
50 (gimp-selection-none img)
51 (gimp-drawable-set-name glow-layer "Glow Layer")
56 (img (car (gimp-image-new 256 256 RGB)))
58 (gimp-image-undo-disable img)
59 (nexuiz-brand-image img "$version" 24 "Bitstream Vera Sans Bold")
60 (gimp-image-merge-visible-layers img 1)
61 (file-tga-save RUN-NONINTERACTIVE img (car (gimp-image-active-drawable img)) "$versiontag.tga" "$versiontag.tga" 1 1)