Skip to content

πŸ“ [Core] Define Explicit Document SpacingΒ #128

Description

@ahmdkaml

✨ Overview

Ensure that every spacing value in the document layout is explicitly defined and consistently applied across both the preview and PDF rendering pipelines.

No spacing should be left to framework, renderer, control, or platform defaults.

The preview and exported PDF must produce the same document layout and spacing.

🎯 Goals

  • Explicitly define all spacing used by the document layout.
  • Remove reliance on implicit or renderer-specific spacing defaults.
  • Ensure spacing between modules is deterministic.
  • Ensure spacing within modules is deterministic.
  • Ensure page margins and layout spacing are explicitly accounted for.
  • Use the same spacing model for preview and PDF rendering.
  • Ensure changes to spacing are reflected identically in both outputs.

πŸ“¦ Requirements

Every spacing value that affects document layout should have an explicit source, including:

  • Page margins
  • Module margins
  • Module padding
  • Spacing between modules
  • Spacing between submodules
  • Text spacing
  • Line spacing
  • Paragraph spacing
  • Header and footer spacing
  • Page and section spacing

The rendering system should not depend on undocumented defaults from the UI framework, PDF library, font renderer, or operating system.

πŸ”„ Preview and PDF Consistency

The preview and PDF renderer must use the same layout and spacing information.

Document
    ↓
Explicit Layout / Spacing Model
    ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Preview    β”‚      PDF      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓               ↓
       Same spacing and layout

A document rendered in the preview should maintain the same spacing when exported to PDF.

🎯 Expected Result

There should be no unexplained spacing differences between the preview and exported PDF.

If a spacing value exists in the final document, it should be possible to trace it back to an explicit value or rule in the document/layout model.

🚫 Out of Scope

Redesigning the overall document layout system.
Adding new visual spacing features.
Introducing arbitrary spacing solely to make individual documents look correct.

The goal is to make the existing layout explicit, deterministic, and consistent across rendering targets.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions