10 module function png_get_term_string(this) result(x)
11 class(png_terminal),
intent(in) :: this
12 character(len = :),
allocatable :: x
14 n = len_trim(this%m_id)
15 allocate(
character(len = n) :: x)
24 module function png_get_filename(this) result(txt)
25 class(png_terminal),
intent(in) :: this
26 character(len = :),
allocatable :: txt
28 n = len_trim(this%m_fname)
29 allocate(
character(len = n) :: txt)
30 txt = trim(this%m_fname)
38 module subroutine png_set_filename(this, txt)
39 class(png_terminal),
intent(inout) :: this
40 character(len = *),
intent(in) :: txt
42 n = min(len_trim(txt), gnuplot_max_path_length)
45 this%m_fname(1:n) = txt(1:n)
47 this%m_fname =
"default.png"
57 module function png_get_command_string(this) result(x)
59 class(png_terminal),
intent(in) :: this
60 character(len = :),
allocatable :: x
63 type(string_builder) :: str
67 call str%append(
"set term pngcairo enhanced ")
68 call str%append(
" font ")
70 call str%append(this%get_font_name())
72 call str%append(to_string(this%get_font_size()))
74 call str%append(
" size ")
75 call str%append(to_string(this%get_window_width()))
77 call str%append(to_string(this%get_window_height()))
78 call str%append(new_line(
'a'))
79 call str%append(
"set output ")
81 call str%append(this%get_filename())
83 x = char(str%to_string())