]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-gnome.scm
*** empty log message ***
[lilypond.git] / scm / output-gnome.scm
index 972a50c703dc7e6d6af81c096ef7816b95dd0e8d..1f6c7d2c51dcf531bd3e9533e8eb57def730b6e0 100644 (file)
@@ -4,64 +4,73 @@
 ;;;; 
 ;;;; (c)  2004 Jan Nieuwenhuizen <janneke@gnu.org>
 
-;;; HIP -- hack in progress
+;;; TODO:
 ;;;
+;;;  * Figure out and fix font scaling and character placement
+;;;  * EC font package: add missing X font directories and AFMs
+;;;  * User-interface, keybindings
+;;;  * Implement missing stencil functions
+;;;  * Implement missing commands
+;;;  * More information in stencils, e.g., location and grob tag.
+;;;  * Embedded Lily:
+;;;    - allow GnomeCanvas or `toplevel' GtkWindow to be created
+;;;      outside of LilyPond
+;;;    - lilylib.
+;;;  * Release schedule and packaging of dependencies.  This hack
+;;;    depends on several CVS and TLA development sources.
+
 ;;; You need:
 ;;;
-;;;   * guile-1.6.4 (NOT CVS)
-;;;   * Rotty's g-wrap--tng, possibly Janneke's if you have libffi-3.4.
-;;;
-;;; see also: guile-gtk-general@gnu.org
+;;;   * Rotty's g-wrap >= 1.9.1 (or TLA)
+;;;   * guile-gnome-platform >= 2.5.992 (or TLA)
+;;;   * pango >= 1.5.2 (or CVS)
 ;;;
+;;; See also: guile-gtk-general@gnu.org
+
 ;;; Try it
 ;;;
-;;;   * If using GUILE CVS , then compile LilyPond with GUILE 1.6, 
+;;;   [* Get cvs and tla]
 ;;;
-;;;    PATH=/usr/bin/:$PATH ./configure --enable-config=g16  ; make conf=g16
+;;;   * Install gnome/gtk and libffi development stuff
 ;;;
-;;;   * Install gnome/gtk development stuff and g-wrap, guile-gnome
+;;;   * Install pango, g-wrap and guile-gnome from CVS or arch: 
 ;;;     see buildscripts/guile-gnome.sh
 ;;;  
-;;;   * Use latin1 encoding for gnome backend, do
+;;;   * Build LilyPond with gui support: configure --enable-gui
 ;;;
+;;;   * Supposing that LilyPond was built in ~/cvs/savannah/lilypond,
+;;;     tell fontconfig about the feta fonts dir:
+"
+cat > ~/.fonts.conf << EOF
+<fontconfig>
+<dir>~/cvs/savannah/lilypond/mf/out</dir>
+</fontconfig>
+EOF
+"
+;;;     or copy all your .pfa/.pfb's to ~/.fonts if your fontconfig
+;;;     already looks there for fonts.  Check if it works by doing:
 "
-       ./configure --prefix=$(pwd) --enable-config=g16
-       make -C mf conf=g16 clean
-       make -C mf conf=g16 ENCODING_FILE=$(kpsewhich cork.enc)
-       (cd mf/out-g16 && mkfontdir)
-       xset +fp $(pwd)/mf/out-g16
+fc-list | grep -i lily
 "
 ;;;
 ;;;   * Setup environment
 "
-export GUILE_LOAD_PATH=$HOME/usr/pkg/g-wrap/share/guile/site:$HOME/usr/pkg/g-wrap/share/guile/site/g-wrap:$HOME/usr/pkg/guile-gnome/share/guile
-export LD_LIBRARY_PATH=$HOME/usr/pkg/g-wrap/lib:$HOME/usr/pkg/guile-gnome/lib
+export GUILE_LOAD_PATH=$HOME/usr/pkg/g-wrap/share/guile/site:$HOME/usr/pkg/g-wrap/share/guile/site/g-wrap:$HOME/usr/pkg/guile-gnome/share/guile:$GUILE_LOAD_PATH
+export LD_LIBRARY_PATH=$HOME/usr/pkg/pango/lib:$HOME/usr/pkg/g-wrap/lib:$HOME/usr/pkg/guile-gnome/lib:$LD_LIBRARY_PATH
 export XEDITOR='/usr/bin/emacsclient --no-wait +%l:%c %f'
 "
-;;;  * For GNOME point-and-click, add
-;;;     #(ly:set-point-and-click 'line-column)
-;;;    to your .ly; just click an object on the canvas.
+;;;  * Also for GNOME point-and-click, you need to set XEDITOR and add
+"
+#(ly:set-point-and-click 'line-column)
+"
+;;;    to your .ly.
 ;;;
 ;;;  * Run lily:
 "
-lilypond-bin -fgnome input/simple-song.ly
+lilypond -fgnome input/simple-song.ly
 "
-
-;;; TODO:
-;;;  * pango+feta font (see archives gtk-i18n-list@gnome.org and
-;;;    lilypond-devel)
-;;;    - wait for/help with pango 1.6
-;;;    - convert feta to OpenType (CFF) or TrueType (fontforge?)
-;;;    - hack feta20/feta20.pfa?:
-;;;  * font, canvas, scaling?
-;;;  * implement missing stencil functions
-;;;  * implement missing commands
-;;;  * user-interface, keybindings
-;;;  * papersize, outputscale from book
-
-
-;;; SCRIPT moved to buildscripts/guile-gnome.sh
-
+;;; point-and-click: (mouse-1) click on a graphical object;
+;;; grob-property-list: (mouse-3) click on a graphical object.
 
 (debug-enable 'backtrace)
 
@@ -74,19 +83,24 @@ lilypond-bin -fgnome input/simple-song.ly
  (lily)
  (gnome gtk))
 
-;; the name of the module will change to canvas rsn
+
+;; The name of the module will change to `canvas' rsn
 (if (resolve-module '(gnome gw canvas))
     (use-modules (gnome gw canvas))
     (use-modules (gnome gw libgnomecanvas)))
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; globals
+
+;; junkme
 (define system-origin '(0 . 0))
 
-;;; set by framework-gnome.scm:
+;;; set by framework-gnome.scm
 (define canvas-root #f)
 (define output-scale #f)
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; helper functions
 
@@ -129,13 +143,16 @@ lilypond-bin -fgnome input/simple-song.ly
 ;;; stencil outputters
 ;;;
 
+;;; catch-all for missing stuff
+;;; comment this out to see find out what functions you miss :-)
 (define (dummy . foo) #f)
-
 (map (lambda (x) (module-define! this-module x dummy))
      (append
       (ly:all-stencil-expressions)
       (ly:all-output-backend-commands)))
 
+
+
 (define (char font i)
   (text font (utf8 i)))
 
@@ -163,6 +180,7 @@ lilypond-bin -fgnome input/simple-song.ly
    ((equal? (ly:font-name font) "GNU-LilyPond-feta-20")
     "lilypond-feta, regular 32")
    (else
+    ;; FIXME
     "ecrm12")))
     ;;(ly:font-name font))))
     ;;(ly:font-filename font))))
@@ -206,15 +224,9 @@ lilypond-bin -fgnome input/simple-song.ly
   
   (make <gnome-canvas-text>
     #:parent (canvas-root)
-    
-    ;; experimental text placement corrections.
-    ;; UGHR?  What happened to tex offsets?  south-west?
-    ;; is pango doing something 'smart' wrt baseline ?
-    #:anchor 'south-west
-    #:x 0.003 #:y 0.123
-    
-    ;;#:anchor 'west
-    ;;#:x 0.015 #:y -3.71
+
+    #:anchor 'west
+    #:x 0.0 #:y 0.0
     
     #:font (pango-font-name font)
     
@@ -234,12 +246,11 @@ lilypond-bin -fgnome input/simple-song.ly
 
 ;; WTF is this in every backend?
 (define (horizontal-line x1 x2 thickness)
-  ;;(let ((thickness 2))
   (filledbox (- x1) (- x2 x1) (* .5 thickness) (* .5 thickness)))
 
-(define (define-origin file line col)
-  (if (procedure? point-and-click)
-      ;; duh, only silly string append
-      ;; (point-and-click line col file)
-      (list 'location line col file)
-      #f))
+;;(define (define-origin file line col)
+;;  (if (procedure? point-and-click)
+;;      (list 'location line col file)))
+
+(define (grob-cause grob)
+  grob)