On Mon, Aug 12, 2002 at 09:50:55AM +0200, Andre Poenitz wrote: > > Ok: Character styles should be done by using something similar to > MathFontInsets.
Regular font (i.e. commands like \textbf) should be implemented like character styles, so this means removing the font list from the paragraph class. > Advantages: > * trivially to implement as almost everything is already there > (mainly GUI is missing) > * small code (currently about 150 lines in math_fontinset.C and > math_factory.C, not much more to be done). > * allow proper nesting It is also possible to support nesting using the current implementation, by changing the font list in the paragraph class to a tree. > * consistency with mathed > * slightly different UI (it is clear whether cursor is inset or outside) > > Known disadvantages: > * Line breaking in the parent paragraph. > * slightly different UI (extra cursor left/right to enter inset) Other disadvantages: 1) Current inset code doesn't allow inheritance of font settings from the current paragraph or from parent inset. For example, if I have a paragraph which set the font to italics (e.g. a Theorem paragraph), and I insert an inset (e.g. a tabular inset) the text in the inset will not be italics. 2) If you start a mouse selection from inside an inset, you cannot choose text which are outside of the inset. 3) Pageup/down do not work inside an inset. 4) Bookmarks do not work inside an inset. (note that I checked the above in lyx-1.2.1cvs as I currently don't have lyx-1.3.0cvs here). These disadvantages (esp. 1, and "line breaking" which you mentined) make insets a bad choice at this time for handling fonts & character styles. So we can either: 1) Move font handling to insets and add character style support. Make the users suffer until the problem above are solved. 2) Add character style to lyxfont. Wait until inset code gets better, and then move font handling to insets. 3) Add character style to lyxfont. Keep the current scheme of font handling (namely storing font data in the paragraph class), but simplify the code.