A lightweight TrueType font rendering library
Go to file
Thomas Oltmann 24737d2922
Merge pull request #23 from caramelli/master
Add the pkg-config file
2023-03-10 16:26:45 +01:00
.github/workflows CI build on Windows 2022-06-26 20:13:28 +02:00
resources Add egyptian hieroglyphs as example of SMP to glass.utf8, along with a font. 2022-06-20 18:29:50 -06:00
util Allow parsing of non-BMP utf-8 characters to utf-32. 2022-06-20 18:28:47 -06:00
VisualC Got the stress app running on Windows. 2020-07-26 13:43:19 +02:00
.gitignore 'make dist' build target 2022-06-26 21:38:40 +02:00
CHANGELOG.md Down-bumped version number to v0.10.2 since there were few changes. 2022-06-25 19:39:37 +02:00
config.mk Separate build options for library & extra apps. 2021-01-21 12:49:54 +01:00
demo.c Add egyptian hieroglyphs as example of SMP to glass.utf8, along with a font. 2022-06-20 18:29:50 -06:00
libschrift.pc.in Add the pkg-config file 2023-02-19 15:44:40 +01:00
LICENSE Updated copyright notice for year 2022. 2022-06-22 11:51:10 +02:00
Makefile Add the pkg-config file 2023-02-19 15:44:40 +01:00
README.md Slight README cleanup. 2022-06-25 19:33:51 +02:00
schrift.3 Down-bumped version number to v0.10.2 since there were few changes. 2022-06-25 19:39:37 +02:00
schrift.c Down-bumped version number to v0.10.2 since there were few changes. 2022-06-25 19:39:37 +02:00
schrift.h Updated copyright notice for year 2022. 2022-06-22 11:51:10 +02:00
stress.c stress.c: fix type of gid, should be SFT_Glyph instead of unsigned long 2022-12-12 07:47:01 -07:00
TODO.md Updated Changelog & ToDos w.r.t the new demo. 2021-01-21 12:40:19 +01:00

libschrift

libschrift is a lightweight TrueType font rendering library.

libschrift aims to:

  • Be as simple and easy-to-use as possible. See: https://www.suckless.org/philosophy/
  • Make correct (as in artifact-free, Unicode-aware etc.) font rendering easy to achieve.
  • Be reasonably secure, which especially means to not crash, leak memory / resources or expose major security vulnerabilities on corrupted / malicious / random inputs.

Features

  • Unicode support
  • Very small! (~1500 LoC)
  • No dependencies on anything other than the C standard library (POSIX / WINAPI are only used for memory mapping, which is not essential)
  • Compatible with any C99 compiler
  • Highly portable! Some versions have been tested on Linux, OpenBSD, FreeBSD, Windows, iOS, and macOS!

Limitations

  • Unicode is the only supported text encoding.
  • Support for most TrueType (.ttf) and certain OpenType (.otf) fonts. No bitmap or PostScript fonts.
  • No hinting. Especially no auto-hinting as found in FreeType2.
  • No color emojis.

Building

On Unix-like systems including Mac OS, you can use make && make install to install libschrift as a system-wide library. Since it is statically linked, you only need the library files for development. Users of your projects do not need to install libschrift.

On Windows, you can either use the provided MSVC project, or compile with make via MSYS, or simply compile manually.

Alternatively, you can always copy-paste schrift.c and schrift.h into your own projects source folder.

Documentation

For documentation on how to use libschrift in your own projects, refer to the schrift(3) man page, the source code of the bundled demo, as well as the header file schrift.h.

You can view the man page in your browser at http://tomolt.github.io/libschrift/

Progress

In terms of both security and performance, libschrift is already pretty solid. However, it is still missing some important features, like right-to-left text support.

Visual Quality

A screenshot of the demo program: demo screenshot

Contributing

Bug Reports, Suggestions, Questions, Criticism, Pull Requests and Patches are all welcome!

You can also support the project by buying me (Thomas Oltmann) a coffee, if you'd like:

Buy Me A Coffee