oops, these files shouldn't have been deleted
[xonotic/xonotic.git] / misc / buildfiles / brand / nexbrand.sh
1 #!/bin/sh
2
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)
6
7 # roughly based on Spencer Kimball's "Glowing Hot" effect, included with GIMP
8
9 version=$1
10 versiontag=$2
11
12 gimp -i -b - <<EOF
13
14 (define (nexuiz-brand-image img text size font)
15         (let*(
16                         (border (/ size 4))
17                         (text-layer (car (gimp-text-fontname img -1 0 0 text border TRUE size PIXELS font)))
18                         (grow (/ size 4))
19                         (feather1 (/ size 3))
20                         (feather2 (/ size 7))
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)))
27                 )
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)
53         )
54 )
55
56 (let*(
57                 (img (car (gimp-image-new 256 256 RGB)))
58         )
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)
63         (gimp-quit 0)
64 )
65
66 EOF