Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

NFO-Editor

An "NFO editor" refers to a program used to create or modify NFO files,

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

NFO-Editor:

Compiler 10 Seattle 10 1 Berlin 10 2 Tokyo 10 3 Rio
10 4 Sydney 11 Alexandria 12 Athens
Components None

NFO-Editor is a small, fast, and flexible NFO viewer and text editor. It's a clone of Microsoft Notepad, but with extra settings and support for NFO files. TXT and NFO files can be assigned different fonts for optimal display. Unicode is also fully supported.

  • Export : Unicode, txt; nfo; bitmap;
  • Demo.exe included

Files with the NFO file extension are often generic ASCII text files that can be viewed with a simple text editor, for example. This usually allows you to display most of the information contained in the NFO file. However, since NFO files are often embellished with ASCII art, and the graphics and control characters used for this cannot be displayed correctly in a standard text editor, using an NFO file viewer is recommended.

History:

NFO files were first introduced by "Fabulous Furlough" of the elite PC warez organization called The Humble Guys, or THG. The THG group would first upload their package to their world headquarters, "Candyland BBS" or later "The P.I.T.S. BBS", to establish distribution immediately. Such organizations are also known as warez groups or crack groups. The first use came in 1990 on the THG release of the PC game Knights of Legend. This file was used in lieu of the more common README.TXT or README.1ST file names. The perpetuation of this file extension legacy was carried on by warez groups which followed after THG and is still in use to this day. Hence its strong presence on Usenet newsgroups that carry binaries and on P2P file trading networks.

The Humble Guys later became a demogroup, thus bringing the .nfo file tradition into the demoscene. More than forty thousand demoscene productions have an NFO file next to the program file.

Typical Files:

TrueType:

TrueType is an outline font standard developed by Apple in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript. It has become the most common format for fonts on the classic Mac OS, macOS, and Microsoft Windows operating systems.

The primary strength of TrueType was originally that it offered font developers a high degree of control over precisely how their fonts are displayed, right down to particular pixels, at various font sizes. With widely varying rendering technologies in use today, pixel-level control is no longer certain in a TrueType font.

When a TrueType font is selected, the font file is not installed on the system; instead, it is loaded into memory as a resource and removed when the program terminates.

  • Add TrueType to Memory

pascal
function RegisterFont(Datei: String): String;
 { First, create an FOT file, and then install it. }
var
  FotName: String;
  bErg: Boolean;
  iErg: Integer;
  a, b: Array[0..128] of Char;
begin
  Result:='';
  // rename font file
  FotName:=ChangeFileExt(Datei, '.FOT');
  StrPCopy(A,FotName);  StrPCopy(B, Datei);
  // check if file exists
  if not fileExists(Fotname) then
    bErg:=CreateScalableFontResource(0, a, b, '')
      else
    bErg:=true;

  if bErg then
  begin
    // create the font resource
    iErg:=AddFontResource(A);
    if iErg>0 then
    begin
      //
      SendMessage(hwnd_broadcast, wm_fontchange, 0,0);
      Result:=FotName;
    end;
  end;
 end;
  • Remove TrueType from Memory

pascal
function RemoveFont(Datei:String): boolean;
begin
  result:=RemoveFontResource(PChar(Datei));
  SendMessage(hwnd_broadcast, wm_fontchange, 0, 0);
end;

When the program is closed, the fonts still appear in the Windows dialog but are no longer available. The update is not complete until the system cache has been cleared or the system has been restarted.

Add custom TrueType fonts

You can also integrate your own TrueType file in a few simple steps.

pascal
begin
  // Create font address in RAM
  myFont := TFont.Create; 
    try
      // Load TrueType file in RAM
      AddFontResource(PChar('myTrueType.ttf'));

      // serves to notify all open Windows applications that fonts have
      // been added to or removed from the system.
      SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);

      // The TFont variable that must be declared in the upper part of the project: myFont : TFont;
      // The name must match the name of the TrueType font.
      // Open the TrueType file, and the actual name appears in the top left corner.
      myFont.Name := 'Px437 NEC APC3 8x16';

      // Initialize the TrueType fonts for the memo box.
      Memo1.Font := myFont;

      // Since there were no lowercase letters on consoles in the past, everything here is capitalized.
      Memo1.CharCase := ecUpperCase;
      
      // Memo Background Color
      Memo1.Color := clBlack;

      // Memo Font Color
      Memo1.Font.Color := clLime;
    except
      on E: Exception do
        ShowMessage(E.Message); // Windows Error Message when file missed
    end;
  myFont.Free;
end;

Simulate Consoles:

A computer console also known as a terminal or command line is a text window that allows you to interact directly with the operating system using typed commands. It dispenses entirely with graphical elements such as windows, icons, or mouse pointers.

TEncoding

The TEncoding class was introduced in Delphi 2009 (codename Tiburon) as part of the fundamental shift to Unicode strings. Since then, TEncoding has served within the Runtime Library (RTL) to convert text into various character encodings (such as UTF-8, UTF-16, or ANSI).

If you want to use an older version of Delphi, you must remove TEncoding; however, Unicode export will then cease to work, and some foreign languages ​​will no longer be displayed.

  • If you want to convert the strings into bytes using a specific encoding (e.g., UTF-8), you can do so like this…
pascal
uses
  System.SysUtils;

procedure ConvertStringToBytes;
var
  MyString: string;
  MyBytes: TBytes;
begin
  MyString := 'Hello Delphi!';
  MyBytes := TEncoding.UTF8.GetBytes(MyString);
  // Do something with MyBytes...
end;