6 Replies Latest reply on Dec 3, 2012 5:27 AM by Laubender

    [Indd CS5.5 v7.5.3] Textframes: Convert To Ellipse depends on Inset Spacing Settings: Bug? Feature?

    Laubender Adobe Community Professional & MVP

      Hello, all!

       

      While fiddling with some convert to shape options in InDesign CS5.5 (OSX 10.6.8), I came across a phenenomen when doing that with text frames.
      See the following screen shots:

       

      1. Two square text frames with different inset spacing settings will be converted to two different ovals:

       

      ConvertShapeToEllipse_BugOrFeature.png

       

       

      2. There is a method in the madness. See the overlapping objects and their inset spacing settings:

       

      OverlappingResults.png

       

       

      Clearly you can see that it depends on the inset spacing settings what will happen. If the inset spacing settings are all even on all sides of the square text frame, converting a square to an oval will get you a circle. If not, you end up with an oval that uses the first value of the inset spacing together with the rectangle that form all inset spacing settings of the original text frame to determine its shape.

       

      The same applies, if you convert to triangles or polygons (I have shifted the bottom polygon a bit to the right to show the effect more clearly):

       

      OverlappingResults_Polygon.png

       

      Question is: do we have here a bug or a feature?

      Should I send a bug report?
      Or does someone base a part of his/her workflow on that "feature"?

       

      Uwe

        • 1. Re: [Indd CS5.5 v7.5.3] Textframes: Convert To Ellipse depends on Inset Spacing Settings: Bug? Feature?
          Peter Spier Most Valuable Participant (Moderator)

          I would say this falls more towards feature than bug. Ovals, after all, can only have a single inset value as they don't have defined  top, bottom, left and right segments, and the behavior you've discovered at least matches the new shape to the aspect ratio of the text block itself.

           

          If you wanted to have unbalanced insets inside an oval you'd need to do something similar to what Dave Saunders did with text wrap around ovals in his Wrap Nudger script. It would be interesting to see if someone can come up with a way to calculate a smooth, but offset, inset for an oval without using two frames.

          • 2. Re: [Indd CS5.5 v7.5.3] Textframes: Convert To Ellipse depends on Inset Spacing Settings: Bug? Feature?
            Manish-Sharma Employee Moderator

            Its is a feature request.

             

            I don't know scripting but in InDesign there is pre-defined script called "PathEffects" which has a option to make Oval.

            If you run the scripts on your samples again then the result would be the same, once I read the scripting notes I didn't see anything significant highlighting the text box property maniplulating the Anchor point calculation.

             

            You know scripting better then I do, having a look on the script code may help you understand it.

            • 3. Re: [Indd CS5.5 v7.5.3] Textframes: Convert To Ellipse depends on Inset Spacing Settings: Bug? Feature?
              Laubender Adobe Community Professional & MVP

              @Manish – I think it depends on expectations of the user. If I take a simple rectangle and convert to oval and do the same to a text frame I would expect the same result. Geometrical spoken…
              That there are inset spacing values that could change the result as a side effect will come as a big surprise…

               

              In scripting there is a pre-defined method documented for converting shapes: convertShape(). There are several options ("arguments") to this method. One of it is "ConvertShapeOptions.CONVERT_TO_OVAL". If you are using this method, there is no difference if you compare the results to the feature in the UI of InDesign.

               

              The following script snippet uses the simple convertShape() method:

               

              //ConvertShapeToOval_ByScript.jsx
              
              //Make sure that only one object is selected:
              if(app.selection.length === 0 || app.selection.length > 1){alert("You have selected "+app.selection.length+" object(s). "+"Select ONE SINGLE object. END.");exit(0);};
              
              //Convert selection to oval:
              app.selection[0].convertShape(ConvertShapeOptions.CONVERT_TO_OVAL);
              

               

              To get it "right" (based on user expectations), you have to do some extra code.

              But I have to warn you. The following simple snippet will bring false results for rotated and sheared objects.

               

              //ConvertShapeToOval_ByScript_UsingGeometricBounds.jsx
              //DESCRIPTION:WARNING! Will get false results on rotated and sheared objects!
              
              //Make sure that only one object is selected:
              if(app.selection.length === 0 || app.selection.length > 1){alert("You have selected "+app.selection.length+" object(s). "+"Select ONE SINGLE object. END.");exit(0);};
              
              //Convert selection to oval:
              var gB = app.selection[0].geometricBounds;
              app.selection[0].convertShape(ConvertShapeOptions.CONVERT_TO_OVAL);
              app.selection[0].geometricBounds = gB;
              


              For rotated and sheared objects I have not found a quick solution right out of my head. I have to investigte that issue…
              Here a screen shot what will happen, if you use the second snippet on not-rotated and rotated objects.

               

              From left to right:

               

              1. original object,

              2. object converted by script using geometric bounds,

              3. "expected" result by the user

               

              ConvertShapeToOval_ByScript_UsingGeometricBounds.png

               

               

              Uwe

              • 4. Re: [Indd CS5.5 v7.5.3] Textframes: Convert To Ellipse depends on Inset Spacing Settings: Bug? Feature?
                Laubender Adobe Community Professional & MVP

                @Peter and Manish.

                Alright. The following script snippet should do the conversion to an oval the "right" way. Be it rotated, sheared or not…

                 

                //ConvertShapeToOval_SELECTION_SNIPPET.jsx
                //Uwe Laubender
                
                
                //Make sure that only one object is selected:
                if(app.selection.length === 0 || app.selection.length > 1){alert("You have selected "+app.selection.length+" object(s). "+"Select ONE SINGLE object. END.");exit(0);};
                
                
                //*** THAT will prevent getting the wrong geometric bounds values:
                
                
                //Store rotation and Shear angles
                var rAngle = app.selection[0].rotationAngle;
                var sAngle = app.selection[0].shearAngle;
                
                //Temporarily apply 0 to both:
                app.selection[0].rotationAngle = 0;
                app.selection[0].shearAngle = 0;
                
                //Store the geometric bounds:
                var gBounds = app.selection[0].geometricBounds;
                
                
                //***
                
                
                //Then convert shape:
                app.selection[0].convertShape(ConvertShapeOptions.CONVERT_TO_OVAL);
                app.selection[0].geometricBounds = gBounds;
                
                
                //Then restore rotation angle and shear angle:
                app.selection[0].rotationAngle = rAngle;
                app.selection[0].shearAngle = sAngle;
                

                 


                There are some options for converting. And if you apply them in a series to the object, you'll see that the inset properties of the original text frame are not lost over the whole process:

                 

                From rectangle to oval to triangle and back to rectangle (all on one and the same object).