fcl-pdf: New features
Summary
A collection of proposed features for fpPDF.pp
Changes
1. Line Join Style
TPDFLineJoinStyle = (pljsMiterJoin, pljsRoundJoin, pljsBevelJoin);
TPDFPage.SetLineJoinStyle(AStyle: TPDFLineJoinStyle);
2. Line End Cap
Note: previously, this can only be set when line width is changed.
TPDFLineCapStyle = (plcsButtCap, plcsRoundCap, plcsProjectingSquareCap);
TPDFPage.SetLineCapStyle(AStyle: TPDFLineCapStyle);
3. Line Miter Limit
TPDFPage.SetMiterLimit(AMiterLimit: TPDFFloat);
4. Custom line dash pattern
TPDFPage.SetPenStyle(ADashArray: TDashArray; const ALineWidth: TPDFFloat);
TPDFDocument.AddLineStyleDef(ALineWidth: TPDFFloat; AColor: TARGBColor = clBlack; ADashArray: TDashArray = []): Integer;
Example:
curPage.SetPenStyle([7, 2, 5, 2], 1);
idx := curDoc.AddLineStyleDef(1, clRed, [8, 1]);
5. TPDFFloat Font Size
TPDFPage.SetFont()
can now accept floating points for font size.
6. TTF Fonts
- underline/strikethrough will use font metrics to determine position and line width
- added bold/italic simulation for fonts that does not have bold/italic files
TPDFPage.SetFont(AFontIndex : Integer; AFontSize : TPDFFloat; const ASimulateBold: Boolean = False; const ASimulateItalic: Boolean = False);
Patch & Test Project
Attached is a patch and a test project that will generate a PDF demonstrating the above features.