[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
?'s: font-specs, styled-text-edit, clx
- To: info-macl@cambridge.apple.com
- Subject: ?'s: font-specs, styled-text-edit, clx
- From: cornell@unix1.cs.umass.edu (Matthew Cornell)
- Date: Mon, 20 Aug 90 10:09:46 EDT
- Cc: cornell@unix1.CS.UMASS.EDU
[Note: once I get the following few bugs fixed I'll be uploading a
_stable_ *editable-styled-text-dialog-item* along with some other
dandy quickdraw and *editable-text-dialog-item* utilities. I
appreciate everyone's great help.]
Hello:
1. I've re-implemented my *editable-styled-text-dialog-item* to use
MACL's font-spec handling code as I need TextStyle record info
corresponding to a spec (tsFont, tsFace, tsStyle, and tsSize) and I
don't want to repeat MACL's parsing of font-specs. But the only way I
found to do this was to "trick" MACL by saving the current
(dialog-item-font), calling (set-dialog-item-font <new-spec>),
grabbing ccl::%font-face-code and ccl::%mode-size-code, restoring
(dialog-item-font), and decoding the codes. I determined:
;; On %font-face-code:
;; high order word = Mac font number
;; low order word = Mac font character style
;;
;; On %mode-size-code:
;; high order word = pen mode
;; low order word = font size, which may be zero if it's the same as
;; the dialog's (?)
The problems are this is indirect and wasteful so I'd like to call the
parse, decode, and encode functions directly, and I think sometimes
the codes assume some inheritance of font-spec info from the
containing dialog and I'm not sure how that's done or what it is. I'd
appreciate any words of advice/info!
2. In getting the styled text edit stuff to work I've extended
dialog-item-font and set-dialog-item-font to apply to either the
default (null) font, the selection, or an arbitrary range of text.
However, to get the the default font-spec (dialog-item-font) to apply
to every editing action (paste, keystroke, insert, and set) as I
guarantee, I have to set the style (_TESetStyle) it each time. This is
because the null selection is lost by things like setting the
selection range. The problem is setting the style each time causes the
dialog item to be redrawn which causes flashing and other redrawing
overhead. This is the case even if the redraw parameter to
_TESetStyle is 0 (FALSE). I'd appreciate any help on this as it's one
of the last things I need to do to get this really useful.
3. On the same topic, I want to be able to set the style of any range
of text (not just the selected text as _TESetStyle does) and it looks
like the only way to do this is via _SetStylScrap. But I'm getting
system errors which indicate I don't know really understand the data
structures or the purpose/meaning of the the trap. It takes start/end
args which specify the text to modify (I assume) and it takes a
STScrpHandle which specifies the style(s) to apply. This arg confuses
me as: 1) STScrpHandle can specify a number of styles but only one
makes sense here, right? 2) each of STScrpHandle's elements
(ScrpSTElement) has a scrpStartChar field but what does this apply to?
I've already specified the range in _SetStylScrap! I would appreciate
*any* help or pointers to more knowledgeable sources.
4. (From before) Does anyone know how hard (possible?) it is to get
CLX going in MACL under the MacOS and what the approximate cost would
be? I'm interested in the user interface packages built upon it, as
described in cl-x-lisp-interfaces.text, which I downloaded via
anonymous ftp from a.gp.cs.cmu.edu in the directory /usr/mkant/Public.
matt
Matthew Cornell
==================================================
Knowledge Communication Systems Group
Department of Computer and Information Science
University of Massachusetts/Amherst, MA 01002
cornell@cs.umass.edu
(413) 256-6664[home] (413) 545-0639, -0582[office]
==================================================