Erbsland Color Terminal for C++
  • Getting Started
  • Usage
  • Reference
  • Demos
    • Minimum Effort
    • Terminal Chronicle
    • Command Line Help
    • Display All Attributes
    • Display All Colors
    • Frame Color Animations
    • Retro Plasma
    • Frame Weaver
    • Grid Layout
    • Key Input Demo
    • HTML Viewer
    • Log Viewer
    • Text Gallery
      • Use This Demo When You Need…
      • Run the Demo
      • Captured Output (80x25)
      • Features Demonstrated
      • Related Demos
      • Relevant Source Files
    • UI Choice
    • UI Hello World
    • UI HTML Viewer
    • UI Sections
    • UI World View
    • Bitmap Showcase
    • Update Screen Modes
    • Find a Demo by Feature
    • Building the Demo Applications
    • Browse All Demo Pages
  • Implementation Notes
  • Contributing Guidelines
  • Requirements
  • Changelog
  • License
Erbsland Color Terminal for C++
  • Demos
  • Text Gallery
  • View page source

Text Gallery

text-gallery demonstrates the text rendering side of the library in one interactive full-screen page set. It combines framed panels, wrapped paragraphs, mixed-width Unicode text, animated bitmap-font titles, and compact footer prompts.

Use This Demo When You Need…

  • A support example for alignment, wrapping, and mixed-width Unicode text inside framed panels.

  • A practical reference for bitmap-font text via Font::defaultAscii().

  • A single demo that shows several text-rendering techniques working together in one retained buffer.

Run the Demo

Start the demo from the build directory:

$ ./cmake-build-debug/demo-apps/text-gallery

Use the left and right arrow keys to switch pages. Press Q to quit.

Captured Output (80x25)

╭──────────────────────────────────────────────────────────────────────────────╮
│    Text Gallery | alignment, wrapping, wide characters, and bitmap fonts     │
│                                                                              │
│ ┌─────────────Top Left──────────────┐ ┏━━━━━━━━━━━━━━Center━━━━━━━━━━━━━━━┓  │
│ │Small panels are an easy way to    │ ┃                                   ┃  │
│ │compare alignment and wrapping side│ ┃                                   ┃  │
│ │by side.                           │ ┃The same paragraph can be centered ┃  │
│ │                                   │ ┃  without a custom layout engine.  ┃  │
│ │                                   │ ┃                                   ┃  │
│ │                                   │ ┃                                   ┃  │
│ └───────────────────────────────────┘ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛  │
│                                                                              │
│ ╔═══════════Bottom Right════════════╗ ╭────────────Top Center─────────────╮  │
│ ║                                   ║ │ Wrapping respects the box width,  │  │
│ ║                                   ║ │while alignment still decides where│  │
│ ║                                   ║ │         each line starts.         │  │
│ ║                                   ║ │                                   │  │
│ ║    Right and bottom alignment stay║ │                                   │  │
│ ║readable even inside narrow frames.║ │                                   │  │
│ ╚═══════════════════════════════════╝ ╰───────────────────────────────────╯  │
│                                                                              │
│                                                                              │
│ [←][→] switch pages [Q] quit page 1/3                                        │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

The capture may not show the terminal output correctly. Here a screenshot:

../../_images/text-gallery3.jpg

Features Demonstrated

  • Text layout using Text together with multiple Alignment modes.

  • Unicode-aware wrapping and centering of mixed-width characters.

  • Bitmap-font rendering using Font::defaultAscii().

  • Animated title coloring with ColorSequence and TextAnimation.

  • Colored footer prompts assembled from String and Char elements.

Related Demos

  • Command Line Help for paragraph layout in a line-oriented command help format.

  • UI Hello World for a UI framework example with centered content.

  • Bitmap Showcase for a companion demo centered on bitmap-based rendering instead of text.

Relevant Source Files

If you want to explore the implementation, start with demo/text-gallery/src/TextGalleryApp.cpp.

This file contains the complete layout logic for the panels, titles, and footer prompts shown in the demo.

Previous Next

© Copyright 2026, Tobias Erbsland - Erbsland DEV.

Built with Sphinx using a theme provided by Read the Docs.