Skip to content

Latest commit

 

History

95 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

💻 Ascii-Text-Generator:


Compiler 10 Seattle 10 1 Berlin 10 2 Tokyo 10 3 Rio
10 4 Sydney 11 Alexandria 12 Athens
Components PNGImage pas FIGlet pas LabelLien pas
Discription Ascii Text Generator
Last Update
License Freeware


      :::::::::: :::::::::::  ::::::::  :::        :::::::::: ::::::::::: 
      :+:            :+:     :+:    :+: :+:        :+:            :+:     
      +:+            +:+     +:+        +:+        +:+            +:+     
      :#::+::#       +#+     :#:        +#+        +#++:++#       +#+     
      +#+            +#+     +#+   +#+# +#+        +#+            +#+     
      #+#            #+#     #+#    #+# #+#        #+#            #+#     
      ###        ###########  ########  ########## ##########     ###     

                  :::       :::     :::      ::::::::  
                  :+:       :+:   :+: :+:   :+:    :+: 
                  +:+       +:+  +:+   +:+  +:+        
                  +#+  +:+  +#+ +#++:++#++: +#++:++#++ 
                  +#+ +#+#+ +#+ +#+     +#+        +#+ 
                   #+#+# #+#+#  #+#     #+# #+#    #+# 
                    ###   ###   ###     ###  ########  

            :::    ::: :::::::::: :::::::::  :::::::::: ::: 
            :+:    :+: :+:        :+:    :+: :+:        :+: 
            +:+    +:+ +:+        +:+    +:+ +:+        +:+ 
            +#++:++#++ +#++:++#   +#++:++#:  +#++:++#   +#+ 
            +#+    +#+ +#+        +#+    +#+ +#+        +#+ 
            #+#    #+# #+#        #+#    #+# #+#            
            ###    ### ########## ###    ### ########## ### 

1. What is FIGlet?

FIGlet is a computer program that generates text banners, in a variety of typefaces, composed of letters made up of conglomerations of smaller ASCII characters (see ASCII art). The name derives from "Frank, Ian and Glenn's letters"

2. Where can I get FIGlet from?

http://www.figlet.org/

3. Where can I get more fonts for FIGlet?

Font Download : http://www.figlet.org/fontdb.cgi

Once you've installed the PNG components and successfully compiled the project, you need to download the fonts. Create a "Font" folder in the project folder and copy the *.fif files into this folder to render them. The "Fonts" folder can also be expanded with your own FIGlet fonts if desired. Simply copy the files into the folder; they should have the *.fif file extension so that the tool recognizes them.

I've included some fonts in the project that are suitable for testing. My collection of over a thousand font files is too large to upload here.

You can also create your own font set using an editor and use it in this program.
FIGlet File Editor : https://patorjk.com/figlet-editor/#/edit

4. How can I contribute?

5. Where does the name FIGlet come from?

"Frank, Ian and Glen's letters"

A FIGlet font is a decorative font composed of ASCII characters to display letters and numbers. FIGlet fonts are part of ASCII art. The name originally comes from a computer program called FIGlet (an acronym for Frank, Ian, and Glen's letters), which uses these fonts to create ASCII art. With the ASCii Text Creator, you can create FIGlet fonts at the touch of a button. There are 302 font arts available to choose from.




The tool can also export ASCII text in images, offering several features. RGB color values are adjustable, and a gradient can be generated.

Update Notes: 1.0.3

  • Text position setting
  • Replace chars in text
  • Add 400+ FIGlet font files
  • Create margin after text for image
  • Search FIGlet
  • Precisely matching the image
  • Exchange of individual or entire characters

Update Notes: 1.0.2

  • Export Formats: *.BMP; *.JPG; *.JPEG; *.PNG; *.GIF;
  • Invert Images
  • Edit Background Color
  • Select TTF Fonts
  • Transparent PNG Image

Build Images:

Editors are difficult to Render to an Image, but Pascal is powerful in this area. The Image is not drawn in a TImage component, but in memory.

  bmp := TBitmap.Create;
  bmp.Canvas.Rectangle(0,0,bmp.Width,bmp.Height);
  bmp.Canvas.Brush.Style := bsClear;
  bmp.Canvas.Brush.Color := Shape1.Brush.Color;
  bmp.Canvas.Font := Memo1.Font;
  lcr := 0;

  // Align the Text into the Bitmap
  if Memo1.Alignment = taLeftJustify then lcr := DT_LEFT;
  if Memo1.Alignment = taCenter then lcr := DT_CENTER;
  if Memo1.Alignment = taRightJustify then lcr := DT_RIGHT;

  TextRect.Left := 0;
  TextRect.Top := 0;

  // Draw Memo Text to Bitmap
  DrawText(bmp.Canvas.Handle,PChar(Memo1.Lines.Text), length(Memo1.Lines.Text),
           TextRect, DT_CALCRECT or DT_NOPREFIX or lcr);

  bmp.Width :=  TextRect.Right;
  bmp.Height := TextRect.Bottom;

  // If text is bigger than image then exit
  if (TextRect.Right > bmp.Width) or
     (TextRect.Bottom > bmp.Height) then begin
    ShowMessage('Text too large for image');
    bmp.Free;
    Exit;
  end;

  try
    // Put the text in the center of the bmp
    OffsetRect(TextRect,(bmp.Width - TextRect.Right) Div 2,
                        (bmp.Height - TextRect.Bottom) Div 2);
    // Draw Text
    DrawText(bmp.Canvas.Handle,PWideChar(Memo1.Lines.Text),
        length(Memo1.Lines.Text),TextRect,
        DT_NOPREFIX or lcr);

   Image := TImage.Create(self);
   Image.Picture.Bitmap.Assign(bmp);
   Image.Picture.Bitmap.SaveToFile(SaveDialog1.FileName + '.bmp');
  finally
  end;

The Hashtag Problem:

Because keyboard layouts in the past weren't the same as they are today, even though they use the same ASCII set, it's possible that a hashtag is drawn instead of a space. This isn't necessarily a bug, but simply a misinterpretation of the font set. The problem is that strings weren't defined as PWideChar in 1991, and today's Delphi compilers assume this, which is why this misinterpretation occurs.

In Delphi, PWideChar is a pointer to a null-terminated Unicode string of WideChar values. It enables seamless integration with C and C++ applications that expect such null-terminated Unicode strings. Because PWideChar variables are not reference-counted and are not copied, its use is unsafe and can lead to memory leaks or data corruption, so it should be used carefully.

The solution is to simply convert the hashtag into a space!
This is the part of the code in the "Commen.pas" File where the misinterpretation occurs.

function StrReplace(S, Old, New: string) : string;
begin
  Result := StringReplace(S, Old, New, [rfReplaceAll]);
end;
//--------------------------------------------------------------------
function StrReplaceI(S, Old, New: string) : string;
begin
  Result := StringReplace(S, Old, New, [rfReplaceAll, rfIgnoreCase]);
end;     
//--------------------------------------------------------------------
function SecondsToTime(sec: integer) : string;
var
  H, M, S: integer;
begin
  H := floor(sec/3600);
  M := floor((sec-3600*H)/60);
  S := sec-3600*H-60*M;
  If H < 10 then Result := '0'+Str(H) else Result := Str(H);
  If M < 10 then Result := Result+':0'+Str(M) else Result := Result+':'+Str(M);
  If S < 10 then Result := Result+':0'+Str(S) else Result := Result+':'+Str(S);
end;
//--------------------------------------------------------------------
function TimeToSeconds(Text: string) : integer;
var
  txt : string;
  Items: TStringList;
begin
  Items := TStringList.Create;
  txt := StringReplace(Text, ' ', '', [rfReplaceAll, rfIgnoreCase]);
  txt := StringReplace(Txt, '_', '', [rfReplaceAll, rfIgnoreCase]);
  Split(':', txt, Items);
  If Items[0] = '' then Items[0] := '0';
  If Items[1] = '' then Items[1] := '0';
  If Items[2] = '' then Items[2] := '0';
  result:= getInteger(Items[0])*3600+getInteger(Items[1])*60+getInteger(Items[2]);
  Items.Free;
end;

FIGcharacters:

FIGlet prints its input with large characters (called "FIGcharacters") composed of ordinary screen characters (so-called "sub-characters"). FIGlet output is generally reminiscent of the kind of "sign-natures" that many people like to put at the end of email and UseNet messages. It is also reminiscent of the output of some banner programs, although it is normally aligned, not sideways.

FIGlet can print in a variety of fonts, both left-to-right and right-to-left, with adjacent FIG characters kerned and squashed together in various ways. FIGlet fonts are stored in separate files, which can be denoted by the suffix ".flf." Most FIGlet font files are stored in FIGlet's standard fonts directory.

The file format for FIGlet fonts is specified in the FIGfont Version 2 FIGfont and FIGdriver standard. The fonts are stored in ASCII files with the filename extension flf. Their content consists of a header and a list of the individual characters. The header essentially contains formatting options, a specification of the character set size and character dimensions. It can also contain free comments from the author. Optionally, the file contents can be compressed in ZIP format.

A key aspect of FIGlet fonts are the formatting rules, which are defined by specifying numerical values in the file header. They determine how the individual characters behave when placed next to or on top of each other. In addition to simple options such as "Full size" (all characters are placed next to each other without modification) and "Fitting" (unnecessary spaces between characters are removed), these include, in particular, the so-called "smushing rules." Using these rules, you can specify, for example, that adjacent characters / and \ can be merged into a single |.

Have Fun with ASCII Art!

About

ASCii Text Art Creator & Convert to Image

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages