[scribus-dev] Text-formatting

Gregory Pittman gpittman at iglou.com
Fri Jul 13 12:53:19 UTC 2012


On 07/13/2012 01:43 AM, a.l.e wrote:
> hi greg,
> 
>> I think it starts with answering the questions about what behavior 
>> should be expected before someone goes and "fixes" the code, since 
>> they're liable to make bad choices.
> 
> well, in my eyes, the answer is not that difficult. at least not for
> the most simple cases:
> 
> - if you put your cursor at the beginning of the frame (and there is
>   already some text in the frame), you should get the same formatting
>   as the char after the cursor
> - if the cursor is at the end of the frame (and it's not an empty
>   frame), the formatting of the char before the cursor should be used.
> - when the frame is created (and it's empty) a default formatting
>   -- defined in the document settings -- should be temporarily attached
>   to the frame. it will be used when you insert the first character and
>   the link will be lost.
I think these are all reasonable, and hopefully not too hard to implement.


> - when you clear the content in a frame, the formatting of the last
>   deleted character will be stored temporarily and attached
>   to the frame. this is the formatting scribus will be using when
>   a new text is typed in the text frame.
> - the cases where a full last word or the full text (ctrl-a DEL) get's
>   deleted at once are a bit more tricky, but i'm confident that we can
>   find a good way to manage this.

I think both of these are more problematic conceptually.

> - if you select the whole frame (not in edit mode) and apply some
>   formatting that formatting is simply applied to the whole text in the
>   frame.
> - if one modifies the formatting while no text is selected, the
>   formatting should be used for the next character typed; moving the
>   cursor will erase those temporary formatting (or we can make them
>   dependent on the position, so that if the person comes back to the
>   same place the formatting will still be applied... but this might not
>   be what the person expects!)
> 
My suggestion for these two is to make the "Default" style more fluid.
If you change the style or font features for an entire frame, empty or
not, this should become the default for that frame until it's changed.

> when we are not in edit mode we could store those values in the
> temporary formatting attached to the frame (with a best effort spirit:
> so, if one has the whole text in red, sets one word in green and then
> back (only that word) to red, the formatting for the frame will show no
> color)

If you look at an SLA file, what you see is that each time there is some
mod to the style, it creates a new <ITEXT...> block. It might be that
improving style handling could make this less verbose.

Greg



More information about the scribus-dev mailing list