On Wed, Apr 19, 2000 at 12:52:46PM +0200, Lars Gullik Bj&resh;nnes wrote:
> Dekel Tsur <[EMAIL PROTECTED]> writes:
>
> | For the current kernel, I thought of the following changes to the
> | way the fonts
> | are stored by the LyX paragraph class:
> |
> | 1. The paragraph stores a vector (FontList) of pairs (position, font),
> | sorted by positions, containing the positions in the paragraph in
> | which the font
> | changes, and the corresponding fonts.
> |
> | 2. The text vector stores special chars between the font changes.
> | This chars are rendered on the screen (for example, a small red
> | dot).
>
> Can't this also be handled by a "next_font_change_at_pos" variable?
Maybe, but I think it will give an uglier code.
Furthermore, the use of special char is also for the purpose of
differentiating the position before the font change and after the font change:
Suppose you have a word "abcd" where ab is in the default font, and cd is in
bold. Now, what happens when you place the cursor between b and c, and
insert a new char. Which font will it have?
With my suggestion, you can place the cursor before/after the special char
to get the desired result. Again, this can be implemented without the
insertion of the special chars, but it will require additional code,
while with my suggestion the implementation should be easy.
> (I realy don't like the special chars)
Why? This way the font changes are treated like insets. In fact, it is
possible to remove Fontlist and put font information into InsetList, but it
might hurt performance a little bit.
> | For example, if the paragraph is "abc def ghi" where def is in bold, then
> | the paragrah text vector will contain "abc $def$ ghi",
> | and FontList will be {(0,default font),(5,bold),(9,default font)}.
>
> I feel that you two points are ortogonal, we can have one without the
> other.
I've already implemented the first point. Should I submit it now, or after
1.1.5 ?