Implementing SVG attribute "stroke-miterlimit" ( tdf#48066)
Armin Le Grand
armin_le_grand at me.com
Wed Mar 30 07:54:07 UTC 2016
Am 24.03.2016 um 16:35 schrieb Regina Henschel:
> Hi Armin,
> I need an advice/opinion _where_ to hold the information:
Definitely in drawinglayer::attribute::LineAttribute, same place where
basegfx::B2DLineJoin is held. A double, defaulted to 15.0 and read
access will be fine. For setting it, add a 5th parameter to the
constructor, defaulted to 15.0. The LineAttribute is a read-only, not
later changeable class to keep things simple. It is better/safer to
create another one when a value needs to be changed than starting to
keep track of changes and add notification or other stuff.
> I cannot calculate whether to exchange 'miter' with 'bevel' directly
> in svgreader, because there only properties for the whole path are
> handled, but such exchange only happens for a single line pair of the
> path. So I think, the exchange needs to be in createAreaGeometry part
> //check and create linejoin. Is that right?
> createAreaGeometry gets all needed information already in distinct
> parameters. The division in single parameters is done inside
> PolygonStrokePrimitive2D::create2DDecomposition part // create fat
> line data. There I need access to 'miterlimit'. How should I hold this
> information? Should I extend LineAttribute, or somethink else?
> Kind regards
> Armin Le Grand schrieb:
>> Hi Regina,
>> AFAIK it is partially used, but not completely. I know of some cases in
>> renderers where today a fixed default of 15.0 is used. Various
>> GraphicSystems use various definitions for it, take care. It would be
>> necessary to define a definition for it for LO, import where available
>> and use where available. Some sub-systems can use it, e.g. Gdiplus or
>> cairo, export to SVG, but no tMetafile (at least not ours). There is
>> definitely no UI for it.
>> Am 24.03.2016 um 01:39 schrieb Regina Henschel:
>>> Hi all,
>>> the following is, what I have found so far, but it might have errors.
>>> So please correct me.
>>> If two lines build a corner, the corner-style can be None, Rounded,
>>> Beveled or Mitered. That is the property "draw:stroke-linejoin" in ODF
>>> and "stroke-linejoin" in SVG. But SVG has the additional property
>>> "stroke-miterlimit". Using it, the author can determine how sharp the
>>> corner can be before it is turned into kind Beveled. I see no such
>>> property in ODF. LibreOffice turns automatically to kind Bevel using
>>> the default value of svg:stroke-miterlimit.
>>> The API has the struct "StrokeAttributes" in css::rendering. It has
>>> the element "MiterLimit". I do not know any UI for it and don't know,
>>> if and how it is usable at all. The service "LineProperties" in
>>> css::drawing does not provide such property.
>>> In OOXML it is the attribute "lim" in element a:miter (18.104.22.168).
>>> This svg-attribute is read on SVG import. And it could be evaluated by
>>> the method basegfx::tools::createAreaGeometry(), if it got a value
>>> into the already prepared parameter. But between these two ends there
>>> is currently no way to transport the information. The line properties
>>> Width, Color, LineCap and LineJoin are transported via class
>>> So my question is, how to transport the "Miterlimit"-information?
>>> Add a member to class LineAttribute?
>>> Add a member to PolygonStrokePrimitive2D and an additional new
>>> parameter into the chain of calls and constructions?
>>> Only fix svg-import or care for other things too? What would I have to
>>> Kind regards
>>> LibreOffice mailing list
>>> LibreOffice at lists.freedesktop.org
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
ALG (PGP Key: EE1C 4B3F E751 D8BC C485 DEC1 3C59 F953 D81C F4A2)
More information about the LibreOffice