Commit 86189c3c authored by Tor Lillqvist's avatar Tor Lillqvist
Browse files

Use the gimp-text*-fontname API throughout.

parent 8786de48
......@@ -52,13 +52,8 @@
y2))
(define (script-fu-alien-glow-button text
font
size
foundry
family
weight
slant
set-width
spacing
text-color
glow-color
bg-color
......@@ -67,29 +62,19 @@
flatten)
(let* ((old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents text
size
PIXELS
foundry
family
weight
slant
set-width
spacing))
(text-extents (gimp-text-get-extents-fontname text
size
PIXELS
font))
(ascent (text-ascent text-extents))
(descent (text-descent text-extents))
(img-width (+ (* 2 padding)
(- (text-width text-extents)
(text-width (gimp-text-get-extents " "
size
PIXELS
foundry
family
weight
slant
set-width
spacing)))))
(text-width (gimp-text-get-extents-fontname " "
size
PIXELS
font)))))
(img-height (+ (* 2 padding)
(+ ascent descent)))
(layer-height img-height)
......@@ -127,8 +112,8 @@
(gimp-selection-none img)
(plug-in-gauss-rle 1 img glow-layer glow-radius TRUE TRUE)
(gimp-palette-set-foreground text-color)
(let ((textl (car (gimp-text
img -1 0 0 text 0 TRUE size PIXELS foundry family weight slant set-width spacing))))
(let ((textl (car (gimp-text-fontname
img -1 0 0 text 0 TRUE size PIXELS font))))
(gimp-layer-set-offsets textl
(+ padding (/ glow-radius 2))
(+ (+ padding descent) (/ glow-radius 2))))
......@@ -151,23 +136,11 @@
"July 1997"
""
SF-STRING "Text" "Hello world!"
SF-VALUE "Size" "22"
SF-STRING "Foundry" "*"
SF-STRING "Family" "futura_poster"
SF-STRING "Weight" "*"
SF-STRING "Slant" "*"
SF-STRING "Set width" "*"
SF-STRING "Spacing" "*"
SF-FONT "Font" "-*-futura_poster-*-*-*-*-22-*-*-*-*-*-*-*"
SF-ADJUSTMENT "Font Size (pixels)" '(22 2 100 1 1 0 1)
SF-COLOR "Text color" '(0 0 0)
SF-COLOR "Glow Color" '(63 252 0)
SF-COLOR "Background Color" '(0 0 0)
SF-VALUE "Padding" "6"
SF-VALUE "Glow Radius" "10"
SF-TOGGLE "Flatten Image?" TRUE)
......@@ -18,6 +18,12 @@
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
(define (text-width extents)
......@@ -50,12 +56,7 @@
(define (script-fu-button00 text
size
foundry
family
weight
slant
set-width
spacing
font
ul-color
lr-color
text-color
......@@ -65,29 +66,19 @@
(let* ((old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents text
(text-extents (gimp-text-get-extents-fontname text
size
PIXELS
foundry
family
weight
slant
set-width
spacing))
font))
(ascent (text-ascent text-extents))
(descent (text-descent text-extents))
(img-width (+ (* 2 (+ padding bevel-width))
(- (text-width text-extents)
(text-width (gimp-text-get-extents " "
(text-width (gimp-text-get-extents-fontname " "
size
PIXELS
foundry
family
weight
slant
set-width
spacing)))))
font)))))
(img-height (+ (* 2 (+ padding bevel-width))
(+ ascent descent)))
......@@ -144,8 +135,8 @@
; Create text layer
(gimp-palette-set-foreground text-color)
(let ((textl (car (gimp-text
img -1 0 0 text 0 TRUE size PIXELS foundry family weight slant set-width spacing))))
(let ((textl (car (gimp-text-fontname
img -1 0 0 text 0 TRUE size PIXELS font))))
(gimp-layer-set-offsets textl
(+ bevel-width padding)
(+ bevel-width padding descent)))
......@@ -168,13 +159,8 @@
"June 1997"
""
SF-STRING "Text" "Hello world!"
SF-VALUE "Size" "16"
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "helvetica"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-ADJUSTMENT "Font Size (pixels)" '(16 2 100 1 1 0 1)
SF-FONT "Font" "-*-helvetica-*-r-*-*-16-*-*-*-p-*-*-*"
SF-COLOR "Upper-left color" '(0 255 127)
SF-COLOR "Lower-right color" '(0 127 255)
SF-COLOR "Text color" '(0 0 0)
......
......@@ -18,7 +18,12 @@
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
(define (text-width extents)
(car extents))
......@@ -33,11 +38,11 @@
(cadr (cddr extents)))
(define (script-fu-beveled-pattern-button
text text-size foundry family weight slant set-width spacing text-color pattern pressed)
text text-size font text-color pattern pressed)
(let* ((old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents
text text-size PIXELS foundry family weight slant set-width spacing))
(text-extents (gimp-text-get-extents-fontname
text text-size PIXELS font))
(ascent (text-ascent text-extents))
(descent (text-descent text-extents))
......@@ -47,8 +52,8 @@
(width (+ (* 2 xpadding)
(- (text-width text-extents)
(text-width
(gimp-text-get-extents
" " text-size PIXELS foundry family weight slant set-width spacing)))))
(gimp-text-get-extents-fontname
" " text-size PIXELS font)))))
(height (+ (* 2 ypadding)
(+ ascent descent)))
......@@ -56,8 +61,8 @@
(background (car (gimp-layer-new img width height RGBA_IMAGE "Background" 100 NORMAL)))
(bumpmap (car (gimp-layer-new img width height RGBA_IMAGE "Bumpmap" 100 NORMAL)))
(textl (car
(gimp-text
img -1 0 0 text 0 TRUE text-size PIXELS foundry family weight slant set-width spacing))))
(gimp-text-fontname
img -1 0 0 text 0 TRUE text-size PIXELS font))))
(gimp-image-disable-undo img)
(gimp-image-add-layer img background 1)
......@@ -118,12 +123,7 @@
""
SF-STRING "Text" "Hello world!"
SF-VALUE "Text size" "32"
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "utopia"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-FONT "Font" "-*-helvetica-*-r-*-*-32-*-*-*-p-*-*-*"
SF-COLOR "Text color" '(0 0 0)
SF-PATTERN "Pattern" "Wood"
SF-TOGGLE "Pressed?" FALSE)
......@@ -18,16 +18,22 @@
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
(define (script-fu-beveled-pattern-heading
text text-size foundry family weight slant set-width spacing pattern transparent)
text text-size font pattern transparent)
(let* ((old-bg-color (car (gimp-palette-get-background)))
(img (car (gimp-image-new 10 10 RGB)))
(textl
(car
(gimp-text img -1 0 0 text 0 TRUE text-size PIXELS foundry family weight slant set-width spacing)))
(gimp-text-fontname img -1 0 0 text 0 TRUE text-size PIXELS font)))
(width (car (gimp-drawable-width textl)))
(height (car (gimp-drawable-height textl)))
......@@ -95,12 +101,7 @@
"July 1997"
""
SF-STRING "Text" "Hello world!"
SF-VALUE "Text size" "72"
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "utopia"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-ADJUSTMENT "Text Size (pixels)" '(72 2 200 1 1 0 1)
SF-FONT "Font" "-*-helvetica-*-r-*-*-72-*-*-*-p-*-*-*"
SF-PATTERN "Pattern" "Wood"
SF-TOGGLE "Transparent background" FALSE)
......@@ -29,12 +29,18 @@
; with higher quality vector fonts. This is how the actual www.gimp.org
; logos were created.
;
(define (script-fu-headers-gimp-org text font weight slant width font-size text-color high-color side-color shadow-color crop rm-bg index num-colors)
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
(define (script-fu-headers-gimp-org text font font-size text-color high-color side-color shadow-color crop rm-bg index num-colors)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(text-layer (car (gimp-text img -1 0 0
(text-layer (car (gimp-text-fontname img -1 0 0
text 30 TRUE font-size PIXELS
"*" font weight slant width "*")))
font)))
(width (car (gimp-drawable-width text-layer)))
(height (car (gimp-drawable-height text-layer)))
(bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
......@@ -113,7 +119,7 @@
high-color side-color shadow-color
crop rm-bg index num-colors)
(script-fu-headers-gimp-org (string-append " " text)
font "bold" "i" "normal" font-size
font font-size
text-color high-color side-color shadow-color
crop rm-bg index num-colors))
......@@ -121,7 +127,7 @@
(define (script-fu-small-header-gimp-org text font font-size text-color
high-color side-color shadow-color
crop rm-bg index num-colors)
(script-fu-headers-gimp-org text font "medium" "r" "normal"
(script-fu-headers-gimp-org text font
font-size text-color high-color
side-color shadow-color
crop rm-bg index num-colors))
......
......@@ -29,13 +29,19 @@
; with higher quality vector fonts. This is how the actual www.gimp.org
; logos were created.
;
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
(define (script-fu-labels-gimp-org text font font-size weight slant width text-color shadow-color bg-color rm-bg index num-colors color-thresh yoff xoff height)
(define (script-fu-labels-gimp-org text font font-size text-color shadow-color bg-color rm-bg index num-colors color-thresh yoff xoff height)
(let* ((img (car (gimp-image-new 125 height RGB)))
(text-layer (car (gimp-text img -1 xoff yoff text 0
(text-layer (car (gimp-text-fontname img -1 xoff yoff text 0
TRUE font-size PIXELS
"*" font weight slant width "*")))
font)))
(bg-layer (car (gimp-layer-new img 125 height
RGB_IMAGE "Background" 100 NORMAL)))
(shadow-layer (car (gimp-layer-copy text-layer TRUE)))
......@@ -89,13 +95,13 @@
;;;
(define (script-fu-tube-button-label-gimp-org text rm-bg index)
(script-fu-labels-gimp-org text "helvetica" 14 "medium" "r" "normal" '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30))
(script-fu-labels-gimp-org text "helvetica" 14 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30))
(define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
(script-fu-labels-gimp-org text "helvetica" 12 "medium" "r" "normal" '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24))
(script-fu-labels-gimp-org text "helvetica" 12 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24))
(define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
(script-fu-labels-gimp-org text "helvetica" 10 "medium" "r" "normal" '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18))
(script-fu-labels-gimp-org text "helvetica" 10 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18))
(script-fu-register "script-fu-tube-button-label-gimp-org"
......@@ -142,9 +148,6 @@
SF-STRING "Text String" "Gimp.Org"
SF-FONT "Font" "-*-helvetica-*-r-*-*-24-*-*-*-p-*-*-*"
SF-ADJUSTMENT "Font Size (pixels)" '(18 2 1000 1 10 0 1)
SF-STRING "Weight" "medium"
SF-STRING "Slant" "r"
SF-STRING "Width" "normal"
SF-COLOR "Text Color" '(130 165 235)
SF-COLOR "Shadow Color" '(0 0 0)
SF-COLOR "Background Color" '(255 255 255)
......
......@@ -2,6 +2,12 @@
;;; Author: Shuji Narazaki <narazaki@InetQ.or.jp>
;;; Time-stamp: <1998/01/18 05:25:03 narazaki@InetQ.or.jp>
;;; Version: 1.2
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
;;; Code:
(if (not (symbol-bound? 'script-fu-hsv-graph-scale (the-environment)))
......@@ -302,10 +308,10 @@
(list red-segment green-segment blue-segment)
(list red-color green-color blue-color))
(gimp-palette-set-foreground '(255 255 255))
(let ((text-layer (car (gimp-text gimg -1 0 0
(let ((text-layer (car (gimp-text-fontname gimg -1 0 0
"Red: Hue, Green: Sat, Blue: Val"
1 1 12 PIXELS "*"
"helvetica" "*" "*" "*" "*")))
1 1 12 PIXELS
"-*-helvetica-*-r-*-*-12-*-*-*-p-*-*-*")))
(offset-y (- y-base (car (gimp-drawable-height clayer)))))
(gimp-layer-set-mode text-layer DIFFERENCE)
(gimp-layer-translate clayer 0 offset-y)
......
;;; i26-gunya2.scm -*-scheme-*-
;;; Time-stamp: <1997/05/11 18:46:26 narazaki@InetQ.or.jp>
;;; Author: Shuji Narazaki (narazaki@InetQ.or.jp)
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
;;; Comment:
;;; This is the first font decoration of Imigre-26 (i26)
......@@ -9,8 +15,8 @@
(define (script-fu-i26-gunya2 text text-color frame-color font font-size frame-size)
(let* ((img (car (gimp-image-new 256 256 RGB)))
(border (/ font-size 10))
(text-layer (car (gimp-text img -1 0 0 text (* border 2) TRUE font-size
PIXELS "*" font "*" "*" "*" "*")))
(text-layer (car (gimp-text-fontname img -1 0 0 text (* border 2)
TRUE font-size PIXELS font)))
(width (car (gimp-drawable-width text-layer)))
(height (car (gimp-drawable-height text-layer)))
(dist-text-layer (car (gimp-layer-new img width height RGBA_IMAGE
......@@ -94,6 +100,3 @@
SF-VALUE "Frame Size" "2")
;;; i26-gunya2.scm ends here
......@@ -2,6 +2,12 @@
;;; Time-stamp: <1998/03/28 02:46:26 narazaki@InetQ.or.jp>
;;; Author: Shuji Narazaki <narazaki@InetQ.or.jp>
;;; Version 0.7
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
;;; Code:
(if (not (symbol-bound? 'script-fu-show-image-structure-new-image?
......@@ -104,11 +110,10 @@
(set! index 0)
(set! layer-names (nreverse layer-names))
(while (< index num-of-layers)
(set! text-layer (car (gimp-text img -1 (/ border 2)
(set! text-layer (car (gimp-text-fontname img -1 (/ border 2)
(+ (* space index) old-height)
(car layer-names)
0 TRUE 14 PIXELS "*" "helvetica"
"*" "*" "*" "*")))
0 TRUE 14 PIXELS "-*-helvetica-*-r-*-*-14-*-*-*-p-*-*-*")))
(gimp-layer-set-mode text-layer NORMAL)
(set! index (+ index 1))
(set! layer-names (cdr layer-names)))))
......
......@@ -4,6 +4,12 @@
; Round Button --- create a round beveled Web button.
; Copyright (C) 1998 Federico Mena Quintero & Arturo Espinosa Aldama
; federico@nuclecu.unam.mx arturo@nuclecu.unam.mx
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
;
; 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
......@@ -41,12 +47,7 @@
(define (script-fu-round-button text
size
foundry
family
weight
slant
set-width
spacing
font
ul-color
lr-color
text-color
......@@ -62,26 +63,18 @@
pressed)
(cond ((eqv? notpressed TRUE)
(do-pupibutton text size foundry family weight slant
set-width spacing ul-color lr-color
(do-pupibutton text size font ul-color lr-color
text-color xpadding ypadding bevel ratio 0)))
(cond ((eqv? notpressed-active TRUE)
(do-pupibutton text size foundry family weight slant
set-width spacing ul-color-high lr-color-high
(do-pupibutton text size font ul-color-high lr-color-high
hlight-color xpadding ypadding bevel ratio 0)))
(cond ((eqv? pressed TRUE)
(do-pupibutton text size foundry family weight slant
set-width spacing ul-color-high lr-color-high
(do-pupibutton text size font ul-color-high lr-color-high
hlight-color xpadding ypadding bevel ratio 1))))
(define (do-pupibutton text
size
foundry
family
weight
slant
set-width
spacing
font
ul-color
lr-color
text-color
......@@ -94,15 +87,10 @@
(let* ((old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(text-extents (gimp-text-get-extents text
(text-extents (gimp-text-get-extents-fontname text
size
PIXELS
foundry
family
weight
slant
set-width
spacing))
font))
(ascent (text-ascent text-extents))
(descent (text-descent text-extents))
......@@ -113,15 +101,10 @@
(width (+ (* 2 (+ radius xpadding)) bevel
(- (text-width text-extents)
(text-width (gimp-text-get-extents " "
(text-width (gimp-text-get-extents-fontname " "
size
PIXELS
foundry
family
weight
slant
set-width
spacing)))))
font)))))
(img (car (gimp-image-new width height RGB)))
......@@ -179,9 +162,9 @@
(cond ((eqv? pressed 1) (set! bevel (+ bevel 1))))
(gimp-palette-set-foreground text-color)
(let ((textl (car (gimp-text
(let ((textl (car (gimp-text-fontname
img -1 0 0 text 0 TRUE size PIXELS
foundry family weight slant set-width spacing))))
font))))
(gimp-layer-set-offsets textl
(+ xpadding radius bevel)
(+ ypadding descent bevel)))
......@@ -214,13 +197,8 @@
"June 1998"
""
SF-STRING "Text" ""
SF-VALUE "Size" "16"
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "helvetica"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-ADJUSTMENT "Font Size (pixels)" '(16 2 100 1 1 0 1)
SF-FONT "Font" "-*-helvetica-*-r-*-*-24-*-*-*-p-*-*-*"
SF-COLOR "Upper color" '(192 192 0)
SF-COLOR "Lower color" '(128 108 0)
SF-COLOR "Text color" '(0 0 0)
......
......@@ -4,6 +4,14 @@
; Bump-mapped title script --- create a bump-mapped title image for web pages
; Copyright (C) 1997 Federico Mena Quintero
; federico@nuclecu.unam.mx
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
verted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; The call to gimp-palette-set-background has been given a real layer
; (although it is not used) otherwise gimp 1.1 crashed.
; ************************************************************************
;
; 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
......@@ -126,7 +134,7 @@
(gimp-edit-fill bg-layer)
(gimp-ellipse-select img 0 0 text-height text-height REPLACE TRUE FALSE 0)
(gimp-palette-set-background (car (gimp-color-picker -1 text-layers-offset 0 TRUE FALSE)))
(gimp-palette-set-background (car (gimp-color-picker text-layer text-layers-offset 0 TRUE FALSE)))
(gimp-edit-fill bg-layer)
; Fade-out gradient at the right
......
Supports Markdown
0% or .