On 7/29/07, David Chisnall <[EMAIL PROTECTED]> wrote: > > On 29 Jul 2007, at 18:12, Yen-Ju Chen wrote: > > > What I don't understand is you are talking > > about the user interface of a text editor > > or the internal text storage of a text editor ? > > A bit of both. > > > For GNUstep application, such text is probably stored as > > NSTextStorage, > > which is a NSAttributedString already. > > Right. In Foundation it's a way of tagging arbitrary data to > strings. AppKit builds on this to define some tags with certain > presentation-related meanings. I think we should build on this to > provide some defined semantic tags for headings, etc., and a > mechanism for third parties to define extra semantic tags and a way > of turning them into presentation tags. > > > The question is how do you present such attributed string to users. > > Rich text editor present attributed string as rendered text > > (bold, color, etc) > > while LaTex-like editor present the attributes as tag. > > If we don't want to have tag along with text, > > then we need a pane which shows current attributes of selected text, > > which is not that convenient. > > Exactly. For some tags we would want to change presentation > attributes while editing, for some we only would in display mode. > For both, we want a quick way of changing the metadata. It's trivial > to make text bold in a rich text editor; you select it and hit meta- > b. How can we expand this so it's (at least almost) as easy to add > other tags. > > > I think the reason having tag along with text (LaTex, HTML) > > is because people don't want to have a separate window for the > > attributes. > > Good point. Another example is probably WordPerfect, with the > 'reveal codes' function. This showed the document markup and allowed > editing, and hid it when you were writing. > > > They can tolerate some extra tag in text to avoid keep turning head > > to look another window. > > So I guess the questions is actually how do you want to present > > the attributes to users and which tag system you like to use. > > Maybe a quasi-mode where you hold down a modifier and a tag editor > appears above the selected text? I'm not completely convinced. Some > sort of in-stream view might also be nice if, as with WordPerfect, > you could toggle it on and off.
In terms of presenting the attributes, I think it is very close to what code editor or html+css editor does, like floating pane showing current attributes. As for the attributes, I think it is close to style sheet. So instead of having a 'bold' attribute, we have 'emphasis' attribute, and probably 'headline', 'reference', etc. attributes. And we certainly can do that easily with GNUstep. The only thing is to define our own set of attributes. But I think we don't want to end up with our own format for reading and writing. It is obvious that we cannot write such attributed string into RTF/RTFD. So the question is which format we want to read in and write to ? ReST is close, and probably a subset of LaTex is better. If we use LaTex as format, then we can output the attributed string straight to LaTex service, which may turn it into PDF and show up in Vindaloo. I don't know LaTex enough. Is it possible to have one-to-one mapping of attributes to a subset of LaTex ? If so, we just need a LaTex reading and write abilities and a set of attributes for NSAttributesString. We probably can also use Typewriter to set the attributes easily. So instead of a toolbar for 'bold', we have one for 'emphasis'. We can show such LaTex attributes with some default style in Typewriter for better visualization. But the real preview has to be output to LaTeX service. Yen-Ju > > David > > _______________________________________________ > Etoile-discuss mailing list > [email protected] > https://mail.gna.org/listinfo/etoile-discuss > _______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
