comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Bold text (in terminal) from Ada?
Date: Tue, 11 Oct 2022 11:49:09 +0300	[thread overview]
Message-ID: <jqkp05Fn8h5U1@mid.individual.net> (raw)
In-Reply-To: <77f28b34-63ef-4903-a111-026968c0918dn@googlegroups.com>

On 2022-10-11 11:06, reinert wrote:
> Any simple way to print out bold text from an Ada program?
> In case, how?
> 
> Assume linux.
> 
> reinert


Print the corresponding ANSI control sequence to turn on bold mode 
before you print the text, then print the ANSI control sequence to turn 
off bold mode.

See https://www.linux.org/threads/ansi-codes-and-colorized-terminals.11706/.

Example:

with Ada.Characters.Latin_1;
with Ada.Text_IO;
procedure Be_Bold
is
    use Ada.Characters, Ada.Text_IO;
begin
    Put ("This is a very ");
    -- Bold mode:
    Put (Latin_1.ESC); Put ("[1m");
    Put ("bold");
    -- Normal mode:
    Put (Latin_1.ESC); Put ("[0m");
    Put_Line (" program.");
end Be_Bold;


  parent reply	other threads:[~2022-10-11  8:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11  8:06 Bold text (in terminal) from Ada? reinert
2022-10-11  8:43 ` Jeffrey R.Carter
2022-10-11  8:49 ` Niklas Holsti [this message]
2022-10-12  0:11 ` Stephen Leake
2022-10-12  4:36   ` reinert
2022-10-12  6:17     ` Emmanuel Briot
2022-10-14  2:46       ` onox
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox