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)
7 # roughly based on Spencer Kimball's "Glowing Hot" effect, included with GIMP
14 (define (nexuiz-brand-image img text size font)
17 (text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font)))
21 (feather3 (/ size 10))
22 (width (car (gimp-drawable-width text-layer)))
23 (height (car (gimp-drawable-height text-layer)))
24 (posx (- (car (gimp-drawable-offsets text-layer))))
25 (posy (- (cadr (gimp-drawable-offsets text-layer))))
26 (glow-layer (car (gimp-layer-copy text-layer TRUE)))
28 (gimp-layer-resize text-layer width (+ 36 height) 0 0)
29 (gimp-image-resize img width (+ 36 height) 0 0)
30 (gimp-image-resize-to-layers img)
31 (gimp-image-add-layer img glow-layer 1)
32 (gimp-layer-translate glow-layer posx posy)
33 (gimp-selection-none img)
34 (gimp-layer-set-preserve-trans text-layer TRUE)
35 (gimp-context-set-background '(0 0 0))
36 (gimp-edit-fill text-layer BACKGROUND-FILL)
37 (gimp-selection-layer-alpha text-layer)
38 (gimp-selection-feather img feather1)
39 (gimp-context-set-background '(221 0 0))
40 (gimp-edit-fill glow-layer BACKGROUND-FILL)
41 (gimp-edit-fill glow-layer BACKGROUND-FILL)
42 (gimp-edit-fill glow-layer BACKGROUND-FILL)
43 (gimp-selection-layer-alpha text-layer)
44 (gimp-selection-feather img feather2)
45 (gimp-context-set-background '(232 217 18))
46 (gimp-edit-fill glow-layer BACKGROUND-FILL)
47 (gimp-edit-fill glow-layer BACKGROUND-FILL)
48 (gimp-selection-layer-alpha text-layer)
49 (gimp-selection-feather img feather3)
50 (gimp-context-set-background '(255 255 255))
51 (gimp-edit-fill glow-layer BACKGROUND-FILL)
52 (gimp-selection-none img)
57 (img (car (gimp-image-new 256 256 RGB)))
59 (gimp-image-undo-disable img)
60 (nexuiz-brand-image img "$version" 24 "Bitstream Vera Sans Bold")
61 (gimp-image-merge-visible-layers img 1)
62 (file-tga-save RUN-NONINTERACTIVE img (car (gimp-image-active-drawable img)) "$versiontag.tga" "$versiontag.tga" 1 1)