Menu

Parenthesis

Graphics
2003-07-17
2003-07-17
  • James Aamodt Hart

    I have been playing with the text parenthesis in different fonts, and I would say that we have a minor problem on our hands. I was hoping to be able to use the text parenthesis because my drawn parenthesis were pathetic when they got too large. It seems that in Java's three standard fonts, however, the parenthesis does not reach "all the way up" to the full font height, as we would expect it not to. Thus we must find some operating-system independent way of finding the true visible height of a text parenthesis or we must reconcile ourselves to very careful scaling and drawing of graphics parenthesis. It seems unlikely we will be able to do the former (please prove me wrong, if you can) so we may well be stuck with the latter.

    Secondly, we have the question of how we are going to implement the parenthesis. I strongly believe that it is best to have the parenthesis be part of the image the object draws. To standardize it, I also believe an addParenthesis routine (as well as a parenthesisWidth function) should be in the Equation object. (They would take the height and width of the object to scale everything and then do the actual drawing.) We can work out the details later, but I just wanted to throw this out there.

     
    • Eric Wald

      Eric Wald - 2003-07-17

      Your drawn parentheses are basically just stretched text characters.  I was hoping for a slightly different approach, if it works correctly.  A half-implemented routine exists in the Equation code to draw them directly, with graphics routines, but it will need serious revision.

      To make matters worse, functions are the reverse of everything else:  Clicking on a parenthesis should select the whole function, not the argument list.  They might as well use the same routine to draw them, but it won't be around the expression as a whole.

      I personally want to separate minus and plus signs from the selected font, as well.  For one thing, they should each have the same width.

       

Log in to post a comment.