From 3c57dd931145d43f2b0aef96c4d178135956bf91 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 05:13:10 +0200 Subject: Adding upstream version 2.10.36. Signed-off-by: Daniel Baumann --- plug-ins/script-fu/scripts/ts-helloworld.scm | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 plug-ins/script-fu/scripts/ts-helloworld.scm (limited to 'plug-ins/script-fu/scripts/ts-helloworld.scm') diff --git a/plug-ins/script-fu/scripts/ts-helloworld.scm b/plug-ins/script-fu/scripts/ts-helloworld.scm new file mode 100644 index 0000000..2c04105 --- /dev/null +++ b/plug-ins/script-fu/scripts/ts-helloworld.scm @@ -0,0 +1,65 @@ +; "Hello, World" Test v1.00 February 29, 2004 +; by Kevin Cozens +; +; Creates an image with the text "Hello, World!" +; This was the first TinyScheme based script ever created and run for the +; 2.x version of GIMP. + +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; 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 . +; +; Tiny-Fu first successfully ran this script at 2:07am on March 6, 2004. + +(define (script-fu-helloworld text font size color) + (let* ( + (width 10) + (height 10) + (img (car (gimp-image-new width height RGB))) + (text-layer) + ) + + (gimp-context-push) + + (gimp-image-undo-disable img) + (gimp-context-set-foreground color) + + (set! text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) + (set! width (car (gimp-drawable-width text-layer))) + (set! height (car (gimp-drawable-height text-layer))) + (gimp-image-resize img width height 0 0) + + (gimp-image-undo-enable img) + (gimp-display-new img) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-helloworld" + "_Hello World..." + "Creates an image with a user specified text string." + "Kevin Cozens " + "Kevin Cozens" + "February 29, 2004" + "" + SF-STRING "Text string" "Hello, World!" + SF-FONT "Font" "Sans" + SF-ADJUSTMENT "Font size (pixels)" '(100 2 1000 1 10 0 1) + SF-COLOR "Color" '(0 0 0) +) + +(script-fu-menu-register "script-fu-helloworld" + "/Filters/Languages/Script-Fu/Test") -- cgit v1.2.3