Comment 19 for bug 827695

Revision history for this message
In , Johnsonf (johnsonf) wrote :

Created attachment 53928
updated example of bad bracket behaviour

I made a new example document that shows more problems with the brackets.

Right now there are two kinds of brackets. Normal and Scalable.

Normal Brackets just draw the Unicode character normally. It scales in the same way all the other characters scale and lines up just like a normal characer.

Scalable Brackets do something else. I am not sure what. They scale linearly to be the same hight as the object they inclose. They are not just normal brackets that get stretched up and down. they look different from the normal brackets even when the object they enclose is one character tall.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  Fixing this _The Right Way_ is NOT an easy hack
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

It would require actual mutations of the vector (bezier) curves inside the bracket characters that are drawn. Or a custom implementation of the bracket characters.

If this was done properly there would be only one kind of bracket, which would make them easier to use and fit the sort of "just works" standard that we all aspire to have in our software.

There isn't a solution that looks good and ONLY involves scaling.

Assuming that the bracket characters don't have a lot of unnessecary bezier curve endpoints along thier curves, the solution is to:

1. design a system so that arbitrary offsets can be applied to the positions of arbitrary curve endpoints. A demo of this system would be a character that fits inline and looks just like other characters, but can have a sine wave distortion applied to the positions of its curve endpoints so that it wobbles like a skrillex song.

2. design a new scaling system based on the previous step. The character is placed in front of the object to inclose, and looks just like how the Normal brackets look now. Then, the curve endpoints that lie in the top third of the character are moved until thier top edge lines up with the top edge of the object to be enclosed, and the bottom third moved down in a similar fasion.

It is possible that this would produce bad curves on something like the curly brace, but in theory the curve tangents could be adjusted algorithmically based on the distance that the endpoints were moved, to compensate.