[Libreoffice] definition of line caps for dashed lines

Regina Henschel rb.henschel at t-online.de
Fri Dec 9 02:38:32 PST 2011


Hi,

Thorsten Behrens schrieb:
> Regina Henschel wrote:
>> So the question is, how should the new property linecap work on
>> dashed lines? It is possible, that a document sets linecap = 'round'
>> and dash style = 'rect', which are contradictory. I have found no
>> rule in the ODF1.2 spec to solve it.
>>
> Hi Regina,
>
> nice catch, sounds like a defect in the spec to me - my take is,
> dash style is superseded by the svg linecaps.

That is my thought too. I suggest to write a mail to OASIS to remove 
attribute draw:style. (I would write it, if there is a consensus to do so.)

I don't know what to do with our 'enum DashStyle' and the element 
'style' in 'struct LineDash' in the API. It does not correspond exactly 
to ODF. It seems to me, that it is currently only used for import/export 
with the MS-formats.

'enum DashStyle' has the values RECT, ROUND, RECTRELATIVE, and 
ROUNDRELATIVE, and the ODF has for 'draw:style' the values 'rect' and 
'round' and 'svg:stroke-linecap' has the values 'butt', 'round' and 
'square', where 'butt' is without cap.

I know no lines, where dashes are actually rounded. Or do I miss something?


>
>> Microsoft Office has a line property "Endetyp" (German) with values
>> 'Flach', 'Rund', and 'Rechteck' which corresponds to the linecap
>> property. Microsoft Office applies the property to each dash, but
>> the caps are not added to the dashes. Rounding is cut of the flat
>> size of the inner dashes and only added to the outer dashes.
>>
> Do I get that right, you say MSO only applies the caps to the very
> ends of the line? At least for MSO2007, I see round caps also on all
> dash elements.

In MS2010 it adds the cap only to the end. If the style is set to 
'round' then the inner dashes are transformed in a way, that the 
rounding is cut from the dashes, so that the space remains the same as 
for 'flat'. In case of 'rectangle' you see no difference to 'flat' for 
the inner dashes, but only the outer end gets a half square added in 
case of 'rectangle'.

That is different to the way the browser render the svg:stroke-linecap. 
Browser really add the caps, so that the space between the dashes become 
smaller.

There are some decisions needed:
(1) Should the element 'style' of 'struct LineDash' be preserved or 
should it be superseded with svg:stroke-linecap and a corresponding 
property 'LineCap' of 'Service LineProperties'? [Both produce some 
follow up questions.]
(2) Should the rounding for inner dashes be added to the dashes and 
reduce the space (svg kind) or should the rounding be taken from the 
dashes and preserve the space (MS kind)?

Kind regards
Regina





More information about the LibreOffice mailing list