Git Product home page Git Product logo

anima-os-dev / bearlibterminal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tommyettinger/bearlibterminal

0.0 0.0 0.0 968 KB

A library that creates a terminal-like window with feature-packed drawing of text and easy input handling. MIRROR.

Home Page: http://foo.wyrd.name/en:bearlibterminal

License: Other

Ruby 0.32% C++ 16.84% Python 0.56% C 79.49% Go 0.22% C# 0.53% Pascal 0.44% Objective-C++ 1.13% Makefile 0.37% CMake 0.11%

bearlibterminal's Introduction

BearLibTerminal provides a pseudoterminal window with a grid of character cells and a simple yet powerful API for flexible textual output and uncomplicated input processing.

Features

  • Unicode support: you can use UTF-8 or UTF-16/32 wide strings easily.
  • Support for bitmap and vector (TrueType) fonts and tilesets.
  • Extended output facilities: tile composition, alignment, offsets.
  • High performance (uses OpenGL).
  • Keyboard and mouse support.
  • Bindings for several programming languages: С/С++, C#, Go, Lua, Pascal, Python, Ruby.
  • Windows, Linux and OS X support.

Documentation

Using

Some notes about using it with various languages or compilers:

C/C++

Visual C++ projects should be linked against BearLibTerminal.lib import library (specify it in the additional linker dependencies).

MinGW projects should link against .dll directly (the .lib is just an import library for Visual C++, do not copy it):

g++ -I/path/to/header -L/path/to/dll main.cpp -lBearLibTerminal -o app.exe

Python

Python packages are available. You can install everything you need to use the library with

pip install bearlibterminal

Depending on the OS and Python installation, you might also want to

  • Replace pip with pip3 or python3 -m pip to select a correct version of Python.
  • Add --user flag to install package locally (i. e. user-wide).

Package contains both wrapper and an appropriate binary for the platform, so you do not need to copy anything else anywhere. Just import the library in the source:

from bearlibterminal import terminal

terminal.open()
terminal.printf(2, 1, "Hello, world!")
terminal.refresh()
while terminal.read() != terminal.TK_CLOSE:
    pass
terminal.close()

Lua

Wrapper for Lua is built-in. You need to use a regular (dynamic) Lua runtime and place BearLibTerminal binary in a suitable location (e. g. in the same directory as script). For Linux you'll also need to rename the .so to just 'BearLibTerminal.so' (dropping the 'lib' prefix). After that it would be possible to import the library the usual way:

local terminal = require "BearLibTerminal" 

Building

BearLibTerminal is a language-agnostic dynamic-link library (.dll/.so/.dylib), therefore you generally do not have to build it yourself and may simply use the prebuilt binaries.

To build BearLibTerminal you will need CMake and a recent GCC/MinGW compiler. For Linux any GCC version 4.6.3 and above will do. For Windows there are several MinGW builds with various quirks, using TDM-GCC or mingw-builds (a flavour of mingw-w64) is recommended. MinGW compiler MUST use Posix thread model.

License

The library is licensed mainly under the MIT license with a few parts under other permissive licenses.

bearlibterminal's People

Contributors

tommyettinger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.