This file is indexed.

/usr/share/gimp/2.0/scripts/xtns-zenkov-shrek-text.scm is in gimp-plugin-registry 5.20120621.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
;
; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; Shrek text script  for GIMP 2.4
; Copyright (c) 2004 Ivan Zenkov <ivan.zenkov@gmail.com>
;
; Tags: logo
;
; Author statement:
;
; Based on iText tutorial by Craig Marshall
;
; --------------------------------------------------------------------
; Distributed by Gimp FX Foundry project
; --------------------------------------------------------------------
;   - Changelog -
; Updated to work with Gimp2.4 (11-2007)
; http://www.gimpscripts.com
;
;
; --------------------------------------------------------------------
;
;    This program is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation, either version 3 of the License, or
;    (at your option) any later version.
;
;    This program is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.
;
;    You should have received a copy of the GNU General Public License
;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define (script-fu-shrek-text string font-name font-size text-color)

  (let* ((text-ext (gimp-text-get-extents-fontname string font-size 0 font-name))
     (wid (+ (car text-ext) 20))
     (hig (+ (cadr text-ext) 20))
     (img (car (gimp-image-new wid hig 0)))
     (bg-layer (car (gimp-layer-new img wid hig 0 _"Background" 100 0)))
     (shadow-layer (car (gimp-layer-new img wid hig 1 _"Shadow" 100 0)))
     (text-layer (car (gimp-layer-new img wid hig 1 _"Text" 100 0)))
     (glow-layer (car (gimp-layer-new img wid hig 1 _"Glow layer (first)" 100 0)))
     (glow-layer-second (car (gimp-layer-new img wid hig 1 _"Glow layer (first)" 100 0)))
     (plastic-layer (car (gimp-layer-new img wid hig 1 _"Plastic effect" 100 0)))
     (text-channel (car (gimp-channel-new img wid hig _"Text channel" 50 '(0 0 0))))
     (shrink-num (/ (caddr text-ext) (* (/ (/ (caddr text-ext) 3.3) (caddr text-ext)) 100)))
     (blur-num (/ (caddr text-ext) 10))
     (old-fg (car (gimp-context-get-foreground)))
     (old-bg (car (gimp-context-get-background))))

    (gimp-image-undo-disable img)

    (gimp-image-add-layer img bg-layer 1)
    (gimp-image-add-layer img shadow-layer -1)
    (gimp-image-add-layer img text-layer -1)
    (gimp-image-add-layer img glow-layer -1)
    (gimp-image-add-layer img plastic-layer -1)
    (gimp-image-add-channel img text-channel 0)

    (gimp-context-set-background '(255 255 255))
    (gimp-edit-clear bg-layer)
    (gimp-edit-clear shadow-layer)
    (gimp-edit-clear text-layer)
    (gimp-edit-clear glow-layer)
    (gimp-edit-clear plastic-layer)
    (gimp-context-set-background '(0 0 0))
    (gimp-edit-clear text-channel)

    (gimp-context-set-foreground text-color)
    (gimp-floating-sel-anchor (car (gimp-text-fontname img text-layer 10 10 string 0 TRUE font-size PIXELS font-name)))

    ; glow effect
    (gimp-selection-layer-alpha text-layer)
    (gimp-selection-shrink img shrink-num)
    (gimp-edit-fill glow-layer 2)
    (gimp-layer-set-mode glow-layer 5)
    (gimp-selection-none img)
    (plug-in-gauss-iir2 1 img glow-layer blur-num blur-num)
    ;; ugly code
    (set! glow-layer-second (car (gimp-layer-copy glow-layer 0)))
    (gimp-drawable-set-name glow-layer-second _"Glow layer (second)")
    (gimp-image-add-layer img glow-layer-second -1)
    (gimp-layer-set-mode glow-layer-second 5)
    (set! text-layer (car (gimp-image-merge-down img glow-layer-second 2)))
    (set! text-layer (car (gimp-image-merge-down img glow-layer 2)))

    ; blur channel
    (gimp-edit-copy text-layer)
    (gimp-floating-sel-anchor (car (gimp-edit-paste text-channel 0)))
    (plug-in-gauss-iir2 1 img text-channel (/ blur-num 2) (/ blur-num 2))
    (gimp-drawable-set-visible text-channel 0)

    ; plastic effect
    (gimp-edit-fill plastic-layer 1)
    (gimp-layer-set-mode plastic-layer 4)
    (plug-in-lighting 1 img plastic-layer text-channel 0 TRUE FALSE 0 0 '(255 255 255) 1 0 1 -1 -1 1 0.30 1 0.40 0.60 27 TRUE FALSE FALSE)
    (set! text-layer (car (gimp-image-merge-down img plastic-layer 2)))

    ; shadow
    (gimp-selection-layer-alpha text-layer)
    (gimp-edit-fill shadow-layer 1)
    (gimp-selection-none img)
    (plug-in-gauss-iir2 1 img shadow-layer 1 1)

; I can't use script-fu-drop-shadow :-(
; ERROR: wta(1st) to min (see errobj)
; Please fix it.
;    (script-fu-drop-shadow 0 img bg-layer 0 0 1 '(0 0 0) 100 1)

; I can't delete channel
; ERROR: Procedural database execution failed:
;    (gimp_drawable_delete 66)
; Please fix it.
;    (gimp-drawable-delete text-channel)

    (gimp-context-set-foreground old-fg)
    (gimp-context-set-background old-bg)

    (gimp-image-undo-enable img)
    (gimp-display-new img)))

(script-fu-register "script-fu-shrek-text"
            _"Shrek Text..."
            _"Creates a text layer with an iMac-like effect"
            "Ivan Zenkov"
            "Ivan Zenkov"
            "September 17, 2004"
            ""
            SF-STRING     _"Text" "Shrek"
            SF-FONT       _"Font" "Serif Bold"
            SF-ADJUSTMENT _"Font Size (pixels)" '(100 2 1000 1 10 0 1)
            SF-COLOR      _"Text Color" '(84 155 8))

(script-fu-menu-register "script-fu-shrek-text"
                         "<Image>/File/Create/FX-Foundry/Logos")