
2003-08-09 Henrik Brix Andersen <brix@gimp.org> * gimp/app/widgets/gimpwidgets-utils.[ch]: removed function gimp_menu_path_strip_uline() ... * gimp/libgimpbase/gimputils.[ch]: ... and added it here under the name gimp_strip_uline() * gimp/devel-docs/libgimpbase/libgimpbase-sections.txt: added gimp_strip_uline to gimputils section * gimp/app/plug-in/plug-in.c * gimp/app/widgets/gimpitemfactory.c * gimp/app/widgets/gimptoolbox. * gimp/app/gui/plug-in-menus.c: changed accordingly * gimp/plug-ins/script-fu/script-fu-scripts.c (script_fu_interface): use gimp_strip_uline() to strip mnemonics from script-fu menu paths * gimp/app/gui/vectors-menu.c * gimp/app/gui/templates-menu.c * gimp/app/gui/qmask-menu.c * gimp/app/gui/palettes-menu.c * gimp/app/gui/palette-editor-menu.c * gimp/app/gui/images-menu.c * gimp/app/gui/gradients-menu.c * gimp/app/gui/gradient-editor-menu.c * gimp/app/gui/documents-menu.c * gimp/app/gui/dialogs-menu.c * gimp/app/gui/colormap-editor-menu.c * gimp/app/gui/channels-menu.c * gimp/app/gui/buffers-menu.c * gimp/app/gui/brushes-menu.c * gimp/app/gui/layers-menu.c * gimp/plug-ins/pygimp/plug-ins/clothify.py * gimp/plug-ins/pygimp/plug-ins/shadow_bevel.py * gimp/plug-ins/pygimp/plug-ins/whirlpinch.py * gimp/plug-ins/pygimp/plug-ins/foggify.py * gimp/plug-ins/script-fu/scripts/*.scm * gimp/plug-ins/script-fu/script-fu.c: added mnemonics fixing more of bug #106991 * gimp/app/gui/error-console-menu.c (error_console_menu_update): updated menu item names, added mnemonics * gimp/plug-ins/common/animoptimize.c * gimp/plug-ins/common/animationplay.c: don't prepend every menu entry with "Animation"
74 lines
2.2 KiB
Scheme
74 lines
2.2 KiB
Scheme
;; font-select
|
|
;; Spencer Kimball
|
|
|
|
(define (max-font-width font-list font-size)
|
|
(let* ((list font-list)
|
|
(width 0)
|
|
(maxwidth 0)
|
|
(font "")
|
|
(extents '()))
|
|
(while list
|
|
(set! font (car list))
|
|
(set! list (cdr list))
|
|
(set! extents (gimp-text-get-extents font font-size PIXELS
|
|
"*" font "*" "*" "*" "*" "*" "*"))
|
|
(set! width (nth 0 extents))
|
|
(if (> width maxwidth) (set! maxwidth width)))
|
|
maxwidth))
|
|
|
|
|
|
(define (max-font-height font-list font-size)
|
|
(let* ((list font-list)
|
|
(height 0)
|
|
(maxheight 0)
|
|
(font "")
|
|
(extents '()))
|
|
(while list
|
|
(set! font (car list))
|
|
(set! list (cdr list))
|
|
(set! extents (gimp-text-get-extents font font-size PIXELS
|
|
"*" font "*" "*" "*" "*" "*" "*"))
|
|
(set! height (nth 1 extents))
|
|
(if (> height maxheight) (set! maxheight height)))
|
|
maxheight))
|
|
|
|
|
|
(define (script-fu-font-map font-list font-size border)
|
|
(let* ((font "")
|
|
(count 0)
|
|
(text-fs 0)
|
|
(num-fonts (length font-list))
|
|
(maxheight (max-font-height font-list font-size))
|
|
(maxwidth (max-font-width font-list font-size))
|
|
(width (+ maxwidth (* 2 border)))
|
|
(height (+ (* maxheight num-fonts) (* 2 border)))
|
|
(img (car (gimp-image-new width height GRAY)))
|
|
(drawable (car (gimp-layer-new img width height GRAY_IMAGE
|
|
"Font List" 100 NORMAL))))
|
|
(gimp-image-undo-disable img)
|
|
(gimp-image-add-layer img drawable 0)
|
|
(gimp-edit-fill drawable BG-IMAGE-FILL)
|
|
|
|
(while font-list
|
|
(set! font (car font-list))
|
|
(set! font-list (cdr font-list))
|
|
(set! text-fs (car (gimp-text img drawable border (+ border (* count maxheight))
|
|
font 0 TRUE font-size PIXELS "*" font "*" "*" "*" "*" "*" "*")))
|
|
(set! count (+ count 1))
|
|
(gimp-floating-sel-anchor text-fs))
|
|
|
|
(gimp-image-undo-enable img)
|
|
(gimp-display-new img)))
|
|
|
|
(script-fu-register "script-fu-font-map"
|
|
_"<Toolbox>/Xtns/Script-Fu/Utils/_Font Map..."
|
|
"Generate a listing of the specified fonts"
|
|
"Spencer Kimball"
|
|
"Spencer Kimball"
|
|
"1997"
|
|
""
|
|
SF-VALUE _"Fonts" "'(\"Agate\" \"AlfredDrake\" \"Becker\" \"Blippo\" \"Bodoni\" \"Dragonwick\" \"Engraver\" \"Futura_Poster\" \"RoostHeavy\")"
|
|
SF-ADJUSTMENT _"Font Size (pixels)" '(32 2 1000 1 10 0 1)
|
|
SF-ADJUSTMENT _"Border" '(10 0 150 1 10 0 1)
|
|
)
|