Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

tommyettinger/BearLibTerminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  • 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

  • Replacepip withpip3 orpython3 -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 terminalterminal.open()terminal.printf(2, 1, "Hello, world!")terminal.refresh()while terminal.read() != terminal.TK_CLOSE:    passterminal.close()

Lua

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

local terminal = require "BearLibTerminal"

Building

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

To build BearLibTerminal you will need CMake and a recent GCC/MinGW compiler. For Linux any GCC version 4.6.3 and abovewill do. For Windows there are several MinGW builds with various quirks, usingTDM-GCC ormingw-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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp