fortplot_ascii_utils Module

ASCII terminal plotting backend - Utility Functions

This module contains utility functions used by the ASCII plotting backend, including character manipulation, text rendering, and output formatting.

Author: fortplot contributors



Variables

Type Visibility Attributes Name Initial
character(len=*), public, parameter :: ASCII_CHARS = ' .:-=+*#%@'

Derived Types

type, public ::  text_element_t

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: text
integer, public :: x
integer, public :: y
real(kind=wp), public :: color_r
real(kind=wp), public :: color_g
real(kind=wp), public :: color_b

Functions

public function get_char_density(char)

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: char

Return Value integer

public function get_blend_char(char1, char2)

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: char1
character(len=1), intent(in) :: char2

Return Value character(len=1)


Subroutines

public subroutine render_text_elements_to_canvas(canvas, text_elements, num_text_elements, plot_width, plot_height)

Render stored text elements onto the ASCII canvas

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(inout) :: canvas(:,:)
type(text_element_t), intent(in) :: text_elements(:)
integer, intent(in) :: num_text_elements
integer, intent(in) :: plot_width
integer, intent(in) :: plot_height

public subroutine print_centered_title(title, width)

Print centered title to terminal

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: title
integer, intent(in) :: width

public subroutine write_centered_title(unit, title, width)

Write centered title to file

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
character(len=*), intent(in) :: title
integer, intent(in) :: width