D-Naveenz / Console-Text-Format-lib

C library for text formats and alignments and text-based graphics.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Console Text Format lib (libcontf)

v1.2

Description

Console-Text-Format-lib is a C library that can handle different text formats and alignments. It also has the ability to create text-based graphics. Developers have to go through a difficult path to deal with the strings of the C language. It will be more difficult in console programs. Therefore, this library helps to reduce the size of the code for printing.

When you want to print text in the center of the console window, you will do the following; But do you believe you can find the right center using the tab spaces?

printf("\t\t\tLet's hope this is a ceter-aligned text.");
Available Features of the current version
  1. Text alignment of the output (left, center, right)
    Text Alignments
  2. Change the buffer width of the formatted text Format Text with buffer
  3. Draw borders (left & right) of the formatted text.
    It will help to create text arts, tables, shapes, etc.
    Text with borders
  4. Draw horizontal lines with user-defined settings (line format, size, ends)
    separator
    Draw lines
  5. Ability to combine text format functions with line drawing functions. Print a cell
How to use libcontf
  1. Add the static library and the header to your c project It is better if you make a folder (ex:include) for headers in your workspace folder.
  2. Add the include path to project in your IDE or text editor.

    VsCode: c_cpp_properties.json

    "includePath": [
         "${default}",
         "${workspaceFolder}/include"
     ],
  3. include the header (contf.h) to your code.
  4. Compile the code with including the header and the library
    gcc -g {C file} -I {include folder} -L {library folder} -lcontf -o {output file}

    VsCode: tasks.json

    "args": [
         "-g",
         "${file}",
         "-I",
         "${workspaceFolder}\\include",
         "-L",
         "${workspaceFolder}",
         "-lcontf",
         "-o",
         "${fileDirname}\\${fileBasenameNoExtension}.exe"
     ],
  5. Make sure to don't run the program in intergrated terminals.
    libcontf won't initialize in intergrated terminals.

    VsCode: launch.json

    "externalConsole": true,

Copyright (c) 2021 Naveen Dharmathunga

About

C library for text formats and alignments and text-based graphics.

License:MIT License


Languages

Language:C 66.3%Language:PowerShell 33.7%