RichTextFX icon indicating copy to clipboard operation
RichTextFX copied to clipboard

Feature: allow areas of bordered text to have borders only on the outline

Open oowekyala opened this issue 6 years ago • 1 comments

Desired Feature

Allow areas of bordered text to have borders only on the outline.

For example, in the following image:

capture du 2018-03-29 00-50-49

The block is styled with a continuous span on bordered text (before overlay with syntax highlighting, so actually there are more spans in the final text)

The appearance I'm looking for is the following (with black lines representing the borders) :

full-outline-blue

In particular, the horizontal borders that separate each line would not be shown. Ideally, the two blue lines would not be shown either (there's an empty line in between, but it's the same span).

If that proves challenging to implement, the following would probably be easier and would content me:

small-outline

Current Workarounds

I think it's impossible in the current version

Implementation Costs

  • Some users could like the current appearance more. For that reason, the -rtfx-border-style could probably be enhanced with a new key, eg "area" to represent the new style without being invasive.
  • I don't know the codebase enough to understand what's needed to implement that right now

Related: #709

oowekyala avatar Mar 29 '18 10:03 oowekyala

The second screenshot will be more difficult to do as it will require each Path that is used to render a border to be aware of the other border's Paths.

For example, on line 360, you would need to render 4 different Paths (lines):

  • 2 for the top part of the line (from start until the character ", from that character until its end);
  • 1 for the right side of the shape; and
  • 1 for the bottom side of the shape (from the end until the g character)

As a result, it seems like this will need to be run in a later command (e.g. render the lines onto the screen first, then run some other method that calculates the above information [starting with the first line and then proceeding through the rest] and renders their shapes correctly).

What happens when the area's text is wrapped? (I suppose this feature could be disabled when that is enabled)

The third screenshot seems more doable. For example, if the border was rendered using a Node type different than just Path and augmented it with additional style classes to handle its border part differently (e.g. only show a border for the right side of it), then that would be easier to implement.

The closest thing you can get to the above is to just style the background color and ignore the outline part itself.

JordanMartinez avatar Mar 29 '18 17:03 JordanMartinez