wiki:BasicText
Last modified 15 years ago Last modified on 04/15/10 13:08:17

Basic text requirements

Need to support

  • Java and OS fonts
    • The default font should be a java one in order to make sure that all users will have it (Lucida bright for example, but see licence)
    • Characters that needs to be supported are characters provided by fonts + tabs + bullets (eventually hidden characters need to be supported in future)
  • Text foreground coloring
    • Transparency
  • Text backround coloring
    • Transparency
  • Styles - Text should support more than one style. For now, styles that exclude each other won't be added. It will be best if text styles can be extended later. This means that it should be possible to add new types of styling. Layout should display only styles that it "knows" about.
    • Styles that should be available now
      • Normal
      • Bold
      • Italic
      • Underline
      • Strikethrough (stikeout)
    • Styles that may be considered later
      • Different underline styles
      • Double strikethrough
      • Superscript
      • Subscript
    • Applying styles
      • Without selection
        • Inside word (cursor is between letters, not symbols) - the style is applied to the whole word
          • Outside word - style is applied to current position. Style is applied to the symbols that are typed in that position. The style is not applied to pasted text if it has own formatting. If pasted text is plain, formatting is applied to it.
      • The whole selection that has this style - the style is removed from the selection
      • The whole selection doesn't have this style - the style is applied to the selection
      • Selection starts with styled text - this style is removed from selection
      • Selection contains with styled text (but does not start with styled text - this style is applied to whole selection)
  • Highlighting - For now, there are 2 types of highlighting that should be available
    • Highlighting as text style - This one is applied when the user creates a link. The links should allow the same styling as the regular text (excluding those that affect layout size - for example, changing font, font size, etc. We may support those, but should not expose them. Good usage will be underline, change fore/background, strikethrough). Styling applied via link creation should be appended to the current style if possible (if they do not contradict), otherwise - link styling should be displayed (but it will be good old styling to be preserved for later use if needed)
    • Highlighting as external feature - Sophie should support external highlighting. This means that other features (and not the user directly) should be able to highlight text. Note that this should not be preserved in the text. As in the previous case, this highlighting should be appended to the current style if possible (if they do not contradict). This kind of higlighting will be used for book extras, search, spellcheck, etc.
    • Highlighting previously highlighted selection of the same type - When a selection has been already highlighted and another highlight of the same type is applied, the last applied highlight of this type should be shown. However, it is prefferable to save the old highlight. Same goes for the attachments, if we have the string abc and create link1 for ab, then link2 for bc, triggering b will only execute link2.
    • Highlighting previously highlighted selection of different type - If the applied styles do not contradict, the both styles should be applied. If the styles do contradict, apply the elements that do not contradict. For the other elements, introduce priority.
    • Priorities (highest is first)
      • Selection
      • External highlighting
      • Links
      • Text styling
  • User interaction - User should be able to:
    • Navigate in text - when clicking in a text frame (with mouse), the caret should be put in the most near possible position
      • Navigating with arrows - should move the caret in the desired position.
        • Left/right - if there is left/right position in this row, go to it, otherwise go to previous/next row (if any, otherwise do nothing)
        • Ctrl+left/right - same as above, but skip whole words (go to the prev/next space)
      • Up/Down - if there is previous/next row, go to the most near possible position on it, otherwise - do nothing
      • Create paragraphs - every time the user hits enter, end of paragraph should be inserted
      • Create new lines - every time the user hits shift+enter, a new line should be created (but not new paragraph)
    • Append text - append text in an existing position. Empty texts should have one position to begin from.
      • Style appended text - text should preserve its own styling information (if any - typed text and plain text should not have one). The styling of pasted text should not be appended to destination formatting (if the pasted text was styled)
        • Later it may be considered to have different paste ways - for destination and source formatting
    • Remove text - text should be removed with its formatting
      • Delete - removes next character
      • Backspace - removes previous character
      • Ctrl+delete - removes next word (and the space after it, if any, but not tabs.)
      • Ctrl+backspace - removes previous word
      • Hold Delete/backspace - removes characters one by one as fast as possible
    • Overwrite - When typing with "Insert" pressed, the text should be overwritten. The caret should look different
    • Select
      • Selection with mouse - Via drag while holding left mouse button
      • Via keyboard while holding shift key
      • Control key should allow complex selections
      • Caret should disappear when selecting
      • Selection in more than one frame - selection should be per user, a user should not be able to select in more than one frame (this should be discussed)
    • Text Cut/Copy/Paste
      • Cut
        • Only works when text is selected, otherwise the whole frame is cut. Selection includes special characters like line break and paragraph break.
          • The text is removed immidiately and put in the clipboard with it's formatting and some attachments*
          • Any selection works, even complex selections
      • Copy
        • Only works when text is selected, otherwise the whole frame is copied. Selection includes special characters like line break and paragraph break.
          • The text is put in the clipboard with its formatting and some attachments*
          • Any selection works, even complex selections
      • Paste
        • The text is pasted at current cursor position or over the current selection (overwrited selection is removed with its formatting, attachments and special characters)
        • The text is with it's style and attachments (that are not unique and location based)
          • Pasted looks exactly like the selection that was copied/cut and contains links and other non-unique attachments
    • Text import - import only (styled) text from different file formats
    • Current import formats
      • Plain text
      • RTF (+styling that we support)
      • HTML(+styling that we support)
    • Future import formats - formats that may be supported in future
      • Odt
      • Doc
      • Docx