applied update by Shuji Narazaki <narazaki@gimp.org>.

* plug-ins/script-fu/scripts/line-nova.scm,
	plug-ins/script-fu/scripts/text-circle.scm,
	plug-ins/script-fu/scripts/unsharp-mask.scm: applied update by Shuji
	Narazaki <narazaki@gimp.org>.
This commit is contained in:
Marc Lehmann
1998-11-25 21:18:26 +00:00
parent fa8a3bc922
commit b3c6723388
4 changed files with 72 additions and 124 deletions

View File

@ -1,7 +1,7 @@
;; text-circle.scm -- a script for The GIMP 1.0
;; Author: Shuji Narazaki <narazaki@InetQ.or.jp>
;; Time-stamp: <1998/04/30 22:00:40 narazaki@InetQ.or.jp>
;; Version 2.4
;; text-circle.scm -- a script for The GIMP 1.1
;; Author: Shuji Narazaki <narazaki@gimp.org>
;; Time-stamp: <1998/11/25 13:26:51 narazaki@gimp.org>
;; Version 2.5
;; Thanks:
;; jseymour@jimsun.LinxNet.com (Jim Seymour)
;; Sven Neumann <neumanns@uni-duesseldorf.de>
@ -22,39 +22,11 @@
;; large descent value to each letter temporally, most letters in most fonts
;; are aligned correctly. But don't expect completeness :-<
(if (not (symbol-bound? 'script-fu-text-circle-text (the-environment)))
(define script-fu-text-circle-text
"\"The GNU Image Manipulation Program Version 1.0 \""))
(if (not (symbol-bound? 'script-fu-text-circle-radius (the-environment)))
(define script-fu-text-circle-radius 80))
(if (not (symbol-bound? 'script-fu-text-circle-start-angle (the-environment)))
(define script-fu-text-circle-start-angle 0))
(if (not (symbol-bound? 'script-fu-text-circle-fill-angle (the-environment)))
(define script-fu-text-circle-fill-angle 360))
(if (not (symbol-bound? 'script-fu-text-circle-font-size (the-environment)))
(define script-fu-text-circle-font-size 18))
(if (not (symbol-bound? 'script-fu-text-circle-antialias (the-environment)))
(define script-fu-text-circle-antialias TRUE))
(if (not (symbol-bound? 'script-fu-text-circle-extra-pole (the-environment)))
(define script-fu-text-circle-extra-pole TRUE))
(if (not (symbol-bound? 'script-fu-text-circle-font-foundry (the-environment)))
(define script-fu-text-circle-font-foundry "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-family (the-environment)))
(define script-fu-text-circle-font-family "\"helvetica\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-weight (the-environment)))
(define script-fu-text-circle-font-weight "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-slant (the-environment)))
(define script-fu-text-circle-font-slant "\"r\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-width (the-environment)))
(define script-fu-text-circle-font-width "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-spacing (the-environment)))
(define script-fu-text-circle-font-spacing "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-debug? (the-environment)))
(define script-fu-text-circle-debug? #f))
(define (script-fu-text-circle text radius start-angle fill-angle
font-size antialias
foundry family weight slant width spacing)
font-size antialias font-name)
;;(set! script-fu-text-circle-debug? #t)
(define extra-pole TRUE) ; for debugging purpose
(define modulo fmod) ; in R4RS way
@ -76,8 +48,8 @@
(fixed-pole0 "l Agy")
;; the following used as real pad.
(fixed-pole " lAgy")
(font-infos (gimp-text-get-extents fixed-pole font-size PIXELS
"*" family "*" slant "*" "*"))
(font-infos (gimp-text-get-extents-fontname fixed-pole font-size
PIXELS font-name))
(desc (nth 3 font-infos))
(extra 0) ; extra is calculated from real layer
(angle-list #f)
@ -93,11 +65,11 @@
(set! radian-step (/ fill-angle-rad char-num))
;; set extra
(if (eq? extra-pole TRUE)
(let ((temp-pole-layer (car (gimp-text img -1 0 0
(let ((temp-pole-layer (car (gimp-text-fontname img -1 0 0
fixed-pole0
1 antialias
font-size PIXELS
"*" family "*" slant "*" "*"))))
font-name))))
(set! extra (car (gimp-drawable-width temp-pole-layer)))
(gimp-image-remove-layer img temp-pole-layer))
(set! extra 0))
@ -116,11 +88,11 @@
(set! temp-str (substring text index (+ index 1)))
(if (white-space-string? temp-str)
(set! temp-str "x"))
(set! temp-layer (car (gimp-text img -1 0 0
temp-str
1 antialias
font-size PIXELS
"*" family "*" slant "*" "*")))
(set! temp-layer (car (gimp-text-fontname img -1 0 0
temp-str
1 antialias
font-size PIXELS
font-name)))
(set! temp-list (cons (car (gimp-drawable-width temp-layer)) temp-list))
(gimp-image-remove-layer img temp-layer)
(set! index (+ index 1)))
@ -139,13 +111,14 @@
(set! letter (substring text index (+ index 1)))
(if (not (white-space-string? letter))
;; Running gimp-text with " " causes an error!
(let* ((new-layer (car (gimp-text img -1 0 0
(if (eq? extra-pole TRUE)
(string-append letter fixed-pole)
letter)
1 antialias
font-size PIXELS
"*" family "*" slant "*" "*")))
(let* ((new-layer
(car (gimp-text-fontname img -1 0 0
(if (eq? extra-pole TRUE)
(string-append letter fixed-pole)
letter)
1 antialias
font-size PIXELS
font-name)))
(width (car (gimp-drawable-width new-layer)))
(height (car (gimp-drawable-height new-layer)))
(rotate-radius (- (/ height 2) desc))
@ -187,41 +160,23 @@
(gimp-image-enable-undo img)
(gimp-image-clean-all img)
(gimp-display-new img)
(set! script-fu-text-circle-text (wrap-string text))
(set! script-fu-text-circle-radius radius)
(set! script-fu-text-circle-start-angle start-angle)
(set! script-fu-text-circle-fill-angle fill-angle)
(set! script-fu-text-circle-font-size font-size)
(set! script-fu-text-circle-antialias antialias)
(set! script-fu-text-circle-extra-pole extra-pole)
(set! script-fu-text-circle-font-foundry (wrap-string foundry))
(set! script-fu-text-circle-font-family (wrap-string family))
(set! script-fu-text-circle-font-weight (wrap-string weight))
(set! script-fu-text-circle-font-slant (wrap-string slant))
(set! script-fu-text-circle-font-width (wrap-string width))
(set! script-fu-text-circle-font-spacing (wrap-string spacing))
(gimp-displays-flush)))
(script-fu-register
"script-fu-text-circle"
"<Toolbox>/Xtns/Script-Fu/Logos/Text Circle"
"Render the specified text along the perimeter of a circle"
"Shuji Narazaki <narazaki@InetQ.or.jp>"
"Shuji Narazaki <narazaki@gimp.org>"
"Shuji Narazaki"
"1997-1998"
""
SF-VALUE "Text" script-fu-text-circle-text
SF-VALUE "Radius" (number->string script-fu-text-circle-radius)
SF-VALUE "Start-angle[-180:180]" (number->string script-fu-text-circle-start-angle)
SF-VALUE "Fill-angle [-360:360]" (number->string script-fu-text-circle-fill-angle)
SF-VALUE "Font Size (pixel)" (number->string script-fu-text-circle-font-size)
SF-TOGGLE "Antialias" script-fu-text-circle-antialias
SF-VALUE "Font Foundry" script-fu-text-circle-font-foundry
SF-VALUE " - Family" script-fu-text-circle-font-family
SF-VALUE " - Weight" script-fu-text-circle-font-weight
SF-VALUE " - Slant" script-fu-text-circle-font-slant
SF-VALUE " - Width" script-fu-text-circle-font-width
SF-VALUE " - Spacing" script-fu-text-circle-font-spacing
SF-STRING "Text" "The GNU Image Manipulation Program Version 1.1 "
SF-ADJUSTMENT "Radius" '(80 1 8000 1 1 0 1)
SF-ADJUSTMENT "Start-angle[-180:180]" '(0 -180 180 1 1 0 1)
SF-ADJUSTMENT "Fill-angle [-360:360]" '(360 -360 360 1 1 0 1)
SF-ADJUSTMENT "Font Size (pixel)" '(18 1 1000 1 1 0 1)
SF-TOGGLE "Antialias" TRUE
SF-FONT "Font name" "-adobe-helvetica-bold-r-normal-*-30-*-*-*-p-*-*-*"
)
;; text-circle.scm ends here