Skip to content

Add Line Spacing (LineHeight) support to font designer and rendering pipeline#268

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/add-line-spacing-option
Draft

Add Line Spacing (LineHeight) support to font designer and rendering pipeline#268
Copilot wants to merge 3 commits intomasterfrom
copilot/add-line-spacing-option

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

The LineHeight property existed in the RDL data model (Style.cs, StyleInfo.cs) but was never surfaced in the designer UI or applied during rendering.

Changes

Designer UI (RdlDesign)

  • FontCtl.cs and StyleTextCtl.cs: Added a Line Height row with a combo box (preset values 8pt–72pt, plus free text), and an fx expression button for dynamic expressions. Controls are added programmatically after InitializeComponent() to avoid .resx modifications.
  • Reads/writes LineHeight XML node on load/save, validates input via DesignerUtility.ValidateSize, and resets dirty flag in Apply().
  • Added FontCtl_Show_InvalidLineHeight string resource for the validation error.

Rendering

PageDrawing.cs (screen/print):

  • When si.LineHeight > 0, delegates to new DrawStringWithLineHeight() which word-wraps text into lines via GetWrappedLines() and draws each line with the configured spacing. Vertical alignment (top/middle/bottom) is computed from total line height.

RenderPdf_iTextSharp.cs (PDF):

  • lineSpacing = si.LineHeight > 0 ? si.LineHeight : si.FontSize — used for both line startY offset and all vertical-alignment calculations.
<!-- Example: RDL Style node with LineHeight set -->
<Style>
  <FontFamily>Arial</FontFamily>
  <FontSize>10pt</FontSize>
  <LineHeight>18pt</LineHeight>
</Style>
Original prompt

This section details on the original issue you should resolve

<issue_title>Add Font > Line spacing callback</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
Im currently frustrated on not having an option to Change Line spacing. besides the font. and paddings
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 19, 2026 13:56
…peline

Co-authored-by: majorsilence <656288+majorsilence@users.noreply.github.com>
…leTextCtl

Co-authored-by: majorsilence <656288+majorsilence@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to change line spacing in font settings Add Line Spacing (LineHeight) support to font designer and rendering pipeline Feb 19, 2026
Copilot AI requested a review from majorsilence February 19, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Font > Line spacing callback

2 participants