Nice script Graechan.
If I could make a couple of suggestions:
- Three inputs don't seem to be used:
Image width (pixels)
Image height(pixels)
Background Palette
- Use a more common default font - "JasmineUPC Bold" seems to be an extra-cost specialty font. Something like
Arial or
Sans would be more likely to be found on most systems.
- A slightly different option is to use the current font as the default (and pattern and gradient). It involves a little extra code, but makes it a lot easier for the user. Here are snippets for defaulting to the current font and pattern. The font is more difficult because the script uses the font in the let* statement, so the input string name needs to be changed (font-in) and the correct string set into 'font' before it is used. The pattern can be set anytime before it is used. This same technique can be used for brushes and gradients.
(define (script-fu-metal-text
text
font-in
size
metal
tint-color
3d-effect
pixels
bkg-type
pattern
bkg-color
gradient
conserve)
(let* (
(image (car (gimp-image-new 256 256 RGB)))
(border (/ size 4))
(font (if (> (string-length font-in) 0)
font-in ;user selected font
(car (gimp-context-get-font)))) ;use current font
(size-layer (car (gimp-text-fontname image -1 0 0 text border TRUE size PIXELS font)))
...
.
.
;;;;fill the background layer
(if (> (string-length pattern) 0)
(gimp-context-set-pattern pattern) ;user selected pattern
() ;use the current pattern
)
(gimp-context-set-background bkg-color)
...
.
.
SF-TEXT "Text" "Metal\nText"
SF-FONT "Font" "" ;default to current font
SF-ADJUSTMENT "Font size (pixels)" '(350 6 500 1 1 0 1)
SF-OPTION "Metal Finish Type" '("Chrome" "Gold" "Silver" "Copper" "Bronze" "Colored Tint")
SF-COLOR "Tint Color" '(0 0 255)
SF-TOGGLE "Add a 3D Effect" FALSE
SF-ADJUSTMENT "3D Height (pixels)" '(30 1 100 1 10 0 0)
SF-OPTION "Background Type" '("None" "Pattern" "Color" "Gradient")
SF-PATTERN "Pattern" "" ;default to current pattern
SF-COLOR "Background color" '(153 153 153)
SF-GRADIENT "Background Gradient" "Abstract 3"
SF-TOGGLE "Keep the Layers" FALSE
I wish I could highlight the changes in the code snippets, but I'm sure you will figure them out.
edit - fixed error in first code snippet.