Skip to content

Text-styling properties configuration #328

@raysan5

Description

@raysan5

Beside the font used, raygui supports multiple text-styling properties for controls text drawing. At this moment some text-styling properties can be configured by-control while some other properties are global for all controls.

Per-control properties:

  • TEXT_PADDING: Control text padding, not considering border
  • TEXT_ALIGNMENT: Control text horizontal alignment inside control text bound (after border and padding)

Global properties:

  • TEXT_SIZE: Text size (glyphs max height)
  • TEXT_SPACING: Text spacing between glyphs
  • TEXT_LINE_SPACING: Text spacing between lines
  • TEXT_ALIGNMENT_VERTICAL: Text vertical alignment inside text bounds (after border and padding)
  • TEXT_WRAP_MODE: Text wrap-mode inside text bounds

In any case, those properties can be set by user before drawing each control for a per-control configuration but in the case of per-control properties they are saved individually with the style while with the global properties they must be set at runtime depending on the user needs.

Also, all those properties determine how GetTextBounds() is calculated and how GuiDrawText() behaves (functions used by all controls).

I'm considering unifying all those properties per-control or global but I'm seing multiple issues... because some current per-control properties should probably stay configured per control...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions