1
0
Fork
You've already forked fcft
0
forked from dnkl/fcft
A simple library for font loading and glyph rasterization using FontConfig, FreeType and pixman.
  • C 92.6%
  • Meson 5.3%
  • Shell 2.1%
Find a file
2021年04月17日 19:29:09 +02:00
.builds ci: freebsd: release: move -Dexamples=true to correct position 2021年04月11日 12:53:31 +02:00
doc doc: fcft_log_init(): document that fcft does not call openlog(3) 2021年04月17日 17:44:35 +02:00
example example: shm: include fcntl.h, to pull in O_RDWR + O_CLOEXEC 2021年04月11日 12:46:56 +02:00
fcft fcft: set/use FCFT_EXPORT in *.c, not fcft.h 2021年04月17日 17:33:54 +02:00
unicode license: add Unicode license file, closes #4 2020年07月28日 19:50:21 +02:00
.gitignore gitignore: subprojects directory 2020年09月16日 21:38:13 +02:00
.gitlab-ci.yml ci: install utf8proc, wayland and wayland-protocols dependencies 2021年04月11日 12:37:51 +02:00
.gitmodules tllist: remove submodule 2020年09月16日 21:32:48 +02:00
CHANGELOG.md log: fcft no longer calls openlog(3) when syslogging has been enabled 2021年04月17日 17:23:13 +02:00
fcft.c fcft: set/use FCFT_EXPORT in *.c, not fcft.h 2021年04月17日 17:33:54 +02:00
generate-unicode-precompose.sh meson: generate a table of pre-composed unicode characters 2020年05月09日 20:38:07 +02:00
generate-version.sh fcft: log fcft version when logging freetype+fontconfig version 2020年07月07日 11:48:02 +02:00
LICENSE license: add missing license (MIT) file. Closes #3 2020年07月25日 08:48:01 +02:00
log.c fcft: set/use FCFT_EXPORT in *.c, not fcft.h 2021年04月17日 17:33:54 +02:00
log.h log: improve logging configurability 2021年04月17日 12:17:51 +02:00
meson.build meson/pkgbuild: bump version to 2.3.90 2021年04月17日 17:38:10 +02:00
meson_options.txt example: otionally build an example (Wayland) program 2021年04月11日 12:31:31 +02:00
PKGBUILD meson/pkgbuild: bump version to 2.3.90 2021年04月17日 17:38:10 +02:00
README.md readme: add example program dependencies, and mention -Dexamples=true 2021年04月11日 12:50:41 +02:00
test.c log: fcft no longer calls openlog(3) when syslogging has been enabled 2021年04月17日 17:23:13 +02:00

fcft

Packaging status

fcft is a small font loading and glyph rasterization library built on-top of FontConfig, FreeType2 and pixman.

It can load and cache fonts from a fontconfig-formatted name string, e.g. Monospace:size=12, optionally with user configured fallback fonts.

After a font has been loaded, you can rasterize glyphs. When doing so, the primary font is first considered. If it does not have the requested glyph, the user configured fallback fonts (if any) are considered. If none of the user configured fallback fonts has the requested glyph, the FontConfig generated list of fallback fonts are checked.

The API is documented as man pages. These are built and installed when fcft is built as a standalone project, but not when built as a subproject.

Requirements

  • fontconfig
  • freetype
  • pixman
  • harfbuzz (optional)
  • tllist, unless built as a subproject

Features

  • Supports all fonts loadable by FreeType2
  • Antialiasing
  • Subpixel antialiasing
  • Color bitmap fonts (emoji fonts)
  • Font caching
  • Glyph caching
  • Kerning1

Not supported

  • Subpixel positioning

Remember, this is a simple library, not a full blown layout engine.

Projects using fcft

Integrating

You can either install fcft as a system library, or use it as a meson subproject (assuming your project is meson based, of course).

Installing

If you install fcft as a system library, you can use pkg-config to get the compiler flags needed to find and link against fcft.

Meson

If your project is meson based, you can use fcft as a subproject. In your main project's meson.build, do something like:

fcft=subproject('fcft').get_variable('fcft')executable('you-executable',...,dependencies:[fcft])

Or, if fcft has been installed as a system library, a regular

fcft=dependency('fcft')

will suffice. Optionally, you can combine the two; search for a system library first, and fallback to a subproject:

fcft=dependency('fcft',version:'>=0.4.0',fallback:'fcft')

Building

Run-time dependencies:

  • fontconfig
  • freetype2
  • pixman
  • harfbuzz (optional)
  • utf8proc2
  • wayland2
  • wayland-protocols2

Build dependencies:

  • Development packages of the run-time dependencies
  • meson
  • ninja
  • scdoc
  • tllist
  • check (optional, for unit tests)

For most users, this is typically enough:

meson build --buildtype=release
ninja -C build
ninja -C build test
sudo ninja -C build install

The tests require at least one latin font to be installed.

By default, fcft will be built with support for text-shaping if HarfBuzz is available. You can explicitly enable or disable this with the -Dtext-shaping=disabled|enabled|auto meson command line option.

If text-shaping is enabled, you might also want to enable the associated tests. Use -Dtest-text-shaping=true to do so. Note that these tests require an emoji font to be installed, and fc-match emoji must return that font first.

To build the example programs, use the -Dexamples=true meson command line option.

License

fcft is released under the MIT license.

fcft uses Unicode data files released under the Unicode, INC. License Agreement.


  1. only basic kerning supported (i.e. the old 'kern' tables, not the new 'GPOS' tables) ↩︎

  2. required by example programs ↩︎