Created attachment 97026 [details] Proposed "Rounded rectangle"-type callout with customizable shape Currently the shape of the "rounded rectangle"-type callouts is fixed. (a) Only the "beak" part of the callout can be moved. (b) The rounding looks ugly (not symmetrical), especially for small heights Often the "beak" of the callout becomes too thin or too thick, and looks ugly. But the user has no control on it. This is a major limitation in making the presentation attractive. DESIRED: Please see the attached file for a sample of better-shaped callout. This simulated callout has the following features: 1. Handles to control the rounding radius (separate for x and y directions) 2. Handles to move the "beak" along the periphery of the rectangle (this also controls the base-width of the beak)
changed to enhancement
This custom shape is defined in svx/source/customshapes/EnhancedCustomShapeGeometry.cxx, it is the msoWedgeRRectCallout. Introduction to custom shapes: http://books.evc-cit.info/odbook/custom_shapes_article.odt
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting) [NinjaEdit]
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
For totally new shapes you need no knowledge in C++. You only need the ODF specification to define such shape. New kind of shapes can be added to the Gallery. The shape in question should fit to the predefined custom shape "wedgeRoundRectCallout" of OOXML, but it doesn't. That should be changed in core, without introducing new handles.
Created attachment 147077 [details] Document with description and callout with circle corners The attached document provides a callout with quarter circles in the corners, which do not change to ellipse when you resize the shape. It behaves similar to the callout of PowerPoint. The shape uses the commands "logwidth" and "logheight". MS Office does not understand these commands, so the shape will not be shown by MS Office. If you are forced to use OOXML (docx or pptx), then you need to use the callout from the drawing toolbar. For all others my shape might be an improvement. This shape does not solve the entire request, because the circles are not sizeable and the callout pointer cannot be changed in its basis. But this shape is already very complex. You should think about using a rounded rectangle as callout and add the callout pointer manually by e.g. using a filled path.
See also bug 149077 regarding making the corners circular rather than elliptic quadrants.
I'm interested in working on this issue. Will update soon about this.
(In reply to Andras Timar from comment #2) > This custom shape is defined in > svx/source/customshapes/EnhancedCustomShapeGeometry.cxx, it is the > msoWedgeRRectCallout. > > Introduction to custom shapes: > http://books.evc-cit.info/odbook/custom_shapes_article.odt The book can be accessed via https://web.archive.org/web/20160315162313/http://books.evc-cit.info/odbook/custom_shapes_article.odt
Such shape should not be generated by changing msoWedgeRRectCallout. The shape msoWedgeRRectCallout was designed to be compatible with MS Office binary format. To be full compatible with current MS Office, it needs only the fix for bug 149007. Besides that, the shape should be kept unchanged. If you want a callout shape with handles as indicated in attachment 147077 [details] you should first try to generate such file in file format. We can then add it in a second step to the Gallery or to the floater "Callouts". The mentioned article http://books.evc-cit.info/odbook/custom_shapes_article.odt has only a very brief introduction about how to create own shapes. Find a more detailed description in the book "Custom Shape Tutorial" available from https://documentation.libreoffice.org/en/english-documentation-ii/ To keep the corner rounding circular it might be, that you need a property called "limo-stretch". That is not included in the book. Some information about it are in section "StretchX, StretchY" on page https://wiki.documentfoundation.org/Development/Custom_Shape_Orientation_Guide and in the presentation from LibreOffice Conference 2022 linked on that page. I'm not sure, whether the goal should really be to add all of the handles mentioned. Perhaps (in a first step?) only create a shape that allows to change the radius of the corner quarter circles. The callout shape is very complex, as the basis of the callout triangle jumps automatically depending on the position of the handle.
Hi Regina, could you please provide me with info about how the shape change can be done internally (via code change). I've read a book regarding creating custom shapes and I understood your proposal. Any pointers on this topic would be highly appreciated.
It should not be done by a _change_ of the existing shape, because the existing shape is needed without handles for interoperability with MS Office. So you need to create a _new_ shape type. Some time ago, the "sinusoid" shape was added. The discussion of that patch is in https://gerrit.libreoffice.org/c/core/+/165353. You can see in that patch, which parts in the code are affected by adding a new shape. But before you can add a shape in the syntax needed in svx/source/customshapes/EnhancedCustomShapeGeometry.cxx, you need to define the geometry of the shape in file format. Translating the file markup into the internal syntax is a second step. There exist no code for such translation, but you need to translate it manually. Some information about translation between file format and internal syntax is in the already mentioned article https://wiki.documentfoundation.org/Development/Custom_Shape_Orientation_Guide. You can simple skip those parts that refer to MS Office. So please first define the geometry, show an example here and then we can go the next step. Of cause you can use the existing shape as start when you define your own new shape. Another idea might be to first solve bug 149077. That way you would learn more about this callout shape and its internal syntax and after that you can make a new shape, that extends the callout shape with handles.