Skip to content

GuitarPrometheus::Render::LayoutSettings

GuitarPrometheus::Render::LayoutSettings

Tunable knobs for the layout engine. More…

#include <LayoutEngine.h>

Public Functions

Name
floatperPartHeightPx() const
Vertical pixels consumed by a single part in a stacked system: the staff’s height plus the top + bottom margins around it.
LayoutSettingsdesktopDefaults()
Defaults tuned for the desktop score panel at typical window sizes.
LayoutSettingstestDefaults()
Smaller / less-padded defaults for unit tests where pixel-density doesn’t matter.

Public Attributes

Name
floatstaffHeightPx
Total height between top and bottom of the 5 staff lines.
floatpixelsPerQuarter
Horizontal spacing per quarter note of music.
floatsystemMarginPx
Left + right system padding outside the first / last barlines.
floattopMarginPx
Vertical padding above the staff (room for ledger lines + future part labels).
floatnoteHeadRadiusPx
Half-width of a notehead (filled or hollow) in pixels.
floatstemLengthPx
Length of stems for stemmed notes (Quarter and shorter).
floatclefGutterFactor
Multiplier on staffHeightPx for the leading-clef gutter on the first measure.

Detailed Description

struct GuitarPrometheus::Render::LayoutSettings;

Tunable knobs for the layout engine.

Controls staff dimensions, the tick→pixel transform, and the basic stem / notehead geometry.

All distances are in pixels at the renderer’s logical resolution. Default values are tuned to render 4 measures of lesson-riff-v14.xml’s Clean Guitar at a roughly comfortable size on a 900-pixel-wide window. Callers can scale up / down by adjusting pixelsPerQuarter (the dominant horizontal driver).

Public Functions Documentation

function perPartHeightPx

inline float perPartHeightPx() const

Vertical pixels consumed by a single part in a stacked system: the staff’s height plus the top + bottom margins around it.

function desktopDefaults

static inline LayoutSettings desktopDefaults()

Defaults tuned for the desktop score panel at typical window sizes.

Default-constructed [LayoutSettings](/api-reference/classes/structguitarprometheus_1_1render_1_1layoutsettings/){} produces the same values; this factory exists for call-site clarity.

function testDefaults

static inline LayoutSettings testDefaults()

Smaller / less-padded defaults for unit tests where pixel-density doesn’t matter.

Lets layout tests assert on round-number geometries without depending on the desktop UX defaults drifting.

Public Attributes Documentation

variable staffHeightPx

float staffHeightPx = 48.0f;

Total height between top and bottom of the 5 staff lines.

variable pixelsPerQuarter

float pixelsPerQuarter = 120.0f;

Horizontal spacing per quarter note of music.

variable systemMarginPx

float systemMarginPx = 40.0f;

Left + right system padding outside the first / last barlines.

variable topMarginPx

float topMarginPx = 40.0f;

Vertical padding above the staff (room for ledger lines + future part labels).

variable noteHeadRadiusPx

float noteHeadRadiusPx = 6.0f;

Half-width of a notehead (filled or hollow) in pixels.

variable stemLengthPx

float stemLengthPx = 40.0f;

Length of stems for stemmed notes (Quarter and shorter).

variable clefGutterFactor

float clefGutterFactor = 1.5f;

Multiplier on staffHeightPx for the leading-clef gutter on the first measure.


Updated on 2026-05-29 at 07:39:52 +0000