Skip to content

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);

line-join-styles

2. Line End Cap

Note: previously, this can only be set when line width is changed.

TPDFLineCapStyle = (plcsButtCap, plcsRoundCap, plcsProjectingSquareCap);
TPDFPage.SetLineCapStyle(AStyle: TPDFLineCapStyle);

line-end-caps

3. Line Miter Limit

TPDFPage.SetMiterLimit(AMiterLimit: TPDFFloat);

line-miter-limit

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]);

line-dash-patterns

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);

ttf-underline-strikethrough-default

ttf-underline-strikethrough-font-metrics

ttf-bold-italic-simulation

Patch & Test Project

Attached is a patch and a test project that will generate a PDF demonstrating the above features.

fcl-pdf-fixes-additions.patch

fcl-pdf-test-01.zip

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information