[scribus-dev] Text-formatting

a.l.e ale.comp_06 at xox.ch
Fri Jul 13 05:43:27 UTC 2012


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.
- 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.
- 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!)

in my eyes, the biggest stepping stone is what one should see in the
properties palette when a frame is selected (while not being in edit
mode). we should probably only show the values for those formatting
that are common to the whole frame
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)
the major change there, would be that we would have to allow empty
values in the palette (or not applied values)


summarizing it all:
currently, there is a default style attached to the frame and this
formatting is used in several cases; in my dreams we should temporarily
attach some formatting to the frame only when it's empty.


voilà, this how i believe applying the formatting in a text frame
should behave!

if somebody wants to work on this, i can certainly start writing a more
formal specification (showing all the cases i can think of) and present
it on this list for comments!

and if you have further ideas on this, just reply to this mail! :-)

ciao
a.l.e



More information about the scribus-dev mailing list