[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A: Setting fred text font



jherbst@poobah.wellesley.edu (Jean R. Herbst) wrote:

> We are using MCL in our introductory AI class. We need to increase
> the size of the font in the fred window (we are using a projector to
> display the monitor during lecture, and the font is too small (9
> pt?). We can change the font in the Listener window by loading the
> font-menus.lisp from the examples folder and using the EDIT menu font
> size option, but this doesn't seem to affect the fred window. Can you
> help?

  I use the following code to change text font by selecting text and 
pressing a control-key:

(in-package :cl-user)
; The following functions allow the user to press a control key to
;   change the selected text to a large demo-suitable font.


(defun set-selection-font (font-spec window)
  "Sets the font-spec of the selected text in the designated window." 
   (let ((buff (fred-buffer window))
          start end)
     (multiple-value-setq (start end) 
                     (ccl::selection-range (ccl::front-window)))
     (ccl::buffer-set-font-spec Buff font-spec start end)))


(defun demo-font (window)
  "Change the font number to get a bigger font"
  (set-selection-font '("courier" 14) window))

(defun normal-font (window) 
  (set-selection-font '("monaco" 9 :srcor :plain) window))


; Defines keystrokes for the font-changing.
; <control>-q          => BIG font
; <control><shift>-q   => normal font
; (change keystrokes to suit)

(ccl::comtab-set-key ccl::*comtab* '(:control #\q) 'demo-font)
(ccl::comtab-set-key ccl::*comtab* '(:control #\Q) 'normal-font)




Mick O'Donnell