mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 11:49:17 +02:00
* Patch from Petr-K to allow setting line cap style (bug ID 33999)
git-svn-id: trunk@39466 -
This commit is contained in:
parent
38c30a557d
commit
e54474dd28
@ -65,6 +65,7 @@ type
|
|||||||
TPDFPaperType = (ptCustom, ptA4, ptA5, ptLetter, ptLegal, ptExecutive, ptComm10, ptMonarch, ptDL, ptC5, ptB5);
|
TPDFPaperType = (ptCustom, ptA4, ptA5, ptLetter, ptLegal, ptExecutive, ptComm10, ptMonarch, ptDL, ptC5, ptB5);
|
||||||
TPDFPaperOrientation = (ppoPortrait,ppoLandscape);
|
TPDFPaperOrientation = (ppoPortrait,ppoLandscape);
|
||||||
TPDFPenStyle = (ppsSolid,ppsDash,ppsDot,ppsDashDot,ppsDashDotDot);
|
TPDFPenStyle = (ppsSolid,ppsDash,ppsDot,ppsDashDot,ppsDashDotDot);
|
||||||
|
TPDFLineCapStyle = (plcsButtCap, plcsRoundCap, plcsProjectingSquareCap);
|
||||||
TPDFPageLayout = (lSingle, lTwo, lContinuous);
|
TPDFPageLayout = (lSingle, lTwo, lContinuous);
|
||||||
TPDFUnitOfMeasure = (uomInches, uomMillimeters, uomCentimeters, uomPixels);
|
TPDFUnitOfMeasure = (uomInches, uomMillimeters, uomCentimeters, uomPixels);
|
||||||
|
|
||||||
@ -143,6 +144,7 @@ type
|
|||||||
TPDFDocumentObject = Class(TPDFObject)
|
TPDFDocumentObject = Class(TPDFObject)
|
||||||
Private
|
Private
|
||||||
FDocument : TPDFDocument;
|
FDocument : TPDFDocument;
|
||||||
|
FLineCapStyle: TPDFLineCapStyle;
|
||||||
Public
|
Public
|
||||||
Constructor Create(Const ADocument : TPDFDocument); override; overload;
|
Constructor Create(Const ADocument : TPDFDocument); override; overload;
|
||||||
Procedure SetWidth(AWidth : TPDFFloat; AStream : TStream);
|
Procedure SetWidth(AWidth : TPDFFloat; AStream : TStream);
|
||||||
@ -953,6 +955,7 @@ type
|
|||||||
FCatalogue: integer;
|
FCatalogue: integer;
|
||||||
FCurrentColor: string;
|
FCurrentColor: string;
|
||||||
FCurrentWidth: string;
|
FCurrentWidth: string;
|
||||||
|
FLineCapStyle: TPDFLineCapStyle;
|
||||||
FDefaultOrientation: TPDFPaperOrientation;
|
FDefaultOrientation: TPDFPaperOrientation;
|
||||||
FDefaultPaperType: TPDFPaperType;
|
FDefaultPaperType: TPDFPaperType;
|
||||||
FFontDirectory: string;
|
FFontDirectory: string;
|
||||||
@ -1070,6 +1073,7 @@ type
|
|||||||
Property FontDirectory: string Read FFontDirectory Write FFontDirectory;
|
Property FontDirectory: string Read FFontDirectory Write FFontDirectory;
|
||||||
Property Sections : TPDFSectionList Read FSections;
|
Property Sections : TPDFSectionList Read FSections;
|
||||||
Property ObjectCount : Integer Read FObjectCount;
|
Property ObjectCount : Integer Read FObjectCount;
|
||||||
|
Property LineCapStyle: TPDFLineCapStyle Read FLineCapStyle Write FLineCapStyle;
|
||||||
Published
|
Published
|
||||||
Property Options : TPDFOptions Read FOptions Write FOPtions;
|
Property Options : TPDFOptions Read FOptions Write FOPtions;
|
||||||
Property LineStyles : TPDFLineStyleDefs Read FLineStyleDefs Write SetLineStyles;
|
Property LineStyles : TPDFLineStyleDefs Read FLineStyleDefs Write SetLineStyles;
|
||||||
@ -2557,6 +2561,7 @@ constructor TPDFDocumentObject.Create(const ADocument: TPDFDocument);
|
|||||||
begin
|
begin
|
||||||
inherited Create(ADocument);
|
inherited Create(ADocument);
|
||||||
FDocument:=ADocument;
|
FDocument:=ADocument;
|
||||||
|
FLineCapStyle := FDocument.LineCapStyle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPDFDocumentObject.SetWidth(AWidth: TPDFFloat; AStream : TStream);
|
procedure TPDFDocumentObject.SetWidth(AWidth: TPDFFloat; AStream : TStream);
|
||||||
@ -2567,7 +2572,7 @@ begin
|
|||||||
S:=FloatStr(AWidth)+' w'; // stroke width
|
S:=FloatStr(AWidth)+' w'; // stroke width
|
||||||
if (S<>Document.CurrentWidth) then
|
if (S<>Document.CurrentWidth) then
|
||||||
begin
|
begin
|
||||||
WriteString('1 J'+CRLF, AStream); // line cap set to rounded edge
|
WriteString(IntToStr(Ord(FLineCapStyle))+' J'+CRLF, AStream); //set line cap
|
||||||
WriteString(S+CRLF, AStream);
|
WriteString(S+CRLF, AStream);
|
||||||
Document.CurrentWidth:=S;
|
Document.CurrentWidth:=S;
|
||||||
end;
|
end;
|
||||||
@ -4886,6 +4891,7 @@ begin
|
|||||||
FZoomValue:='100';
|
FZoomValue:='100';
|
||||||
FOptions := [poCompressFonts, poCompressImages];
|
FOptions := [poCompressFonts, poCompressImages];
|
||||||
FUnitOfMeasure:=uomMillimeters;
|
FUnitOfMeasure:=uomMillimeters;
|
||||||
|
FLineCapStyle := plcsRoundCap;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPDFDocument.StartDocument;
|
procedure TPDFDocument.StartDocument;
|
||||||
|
Loading…
Reference in New Issue
Block a user