jcyuan / tgfx

A lightweight 2D graphics library for rendering texts, geometries, and images with high-performance APIs that work across various platforms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TGFX Logo

license PRs Welcome codecov autotest build GitHub release (latest SemVer)

Introduction

TGFX (Tencent Graphics) is a lightweight 2D graphics library designed for rendering texts, geometries, and images. It provides high-performance APIs that work across a variety of hardware and software platforms. TGFX was initially created as a core component of the PAG project and has since become the default graphics engine for the libpag library, starting from version 4.0. Its main objective is to offer a compelling alternative to the Skia graphics library while maintaining a much smaller binary size. Over time, it has found its way into many other products, such as Hippy, Tencent Docs and various video-editing apps.

Platform Support

Vector Backend GPU Backend Target Platforms Status
FreeType OpenGL All complete
CoreGraphics OpenGL iOS, macOS complete
Canvas2D WebGL Web complete
CoreGraphics Metal iOS, macOS in progress
FreeType Vulkan Android, Linux planned

Branch Management

  • The main branch is our active developing branch which contains the latest features and bugfixes.
  • The branches under release/ are our stable milestone branches which are fully tested. We will periodically cut a release/{version} branch from the main branch. After one release/{version} branch is cut, only high-priority fixes are checked into it.

System Requirements

  • iOS 9.0 or later
  • Android 4.4 or later
  • macOS 10.13 or later
  • Windows 7.0 or later
  • Chrome 69.0 or later (Web)
  • Safari 11.3 or later (Web)

Build Prerequisites

  • Xcode 11.0+
  • GCC 7.0+
  • CMake 3.10.2+
  • Visual Studio 2019
  • NDK 19.2.5345600 (Please use this exact version of NDK, other versions may fail.)

Dependency Management

TGFX uses depsync tool to manage third-party dependencies.

For macOS platform:

Run the script in the root of the project:

./sync_deps.sh

This script will automatically install the necessary tools and synchronize all third-party repositories.

For other platforms:

First, make sure you have installed the latest version of node.js (You may need to restart your computer after this step). And then run the following command to install depsync tool:

npm install -g depsync

And then run depsync in the root directory of the project.

depsync

Git account and password may be required during synchronizing. Please make sure you have enabled the git-credential-store so that CMakeList.txt can trigger synchronizing automatically next time.

Build & Run

We recommend using CLion IDE on the macOS platform for development. After the synchronization, you can open the project with CLion and build the TGFX library.

For macOS platform:

There are no extra configurations of CLion required.

For Windows platform:

Please follow the following steps to configure the CLion environment correctly:

  • Make sure you have installed at least the [Desktop development with C++] and [Universal Windows Platform development] components for VS2019.
  • Open the File->Setting panel, and go to Build, Execution, Deployment->ToolChains, then set the toolchain of CLion to Visual Studio with amd64 (Recommended) or x86 architecture.

Note: If anything goes wrong during cmake building, please update the cmake commandline tool to the latest version and try again.

Support Us

If you find TGFX is helpful, please give us a Star. We sincerely appreciate your support :)

License

TGFX is licensed under the BSD-3-Clause License

Star History Chart

Contribution

If you have any ideas or suggestions to improve TGFX, welcome to open a discussion / issue / pull request. Before making a pull request or issue, please make sure to read Contributing Guide.

About

A lightweight 2D graphics library for rendering texts, geometries, and images with high-performance APIs that work across various platforms.

License:Other


Languages

Language:C++ 93.5%Language:Objective-C++ 2.9%Language:TypeScript 1.6%Language:CMake 0.8%Language:Shell 0.4%Language:Objective-C 0.4%Language:JavaScript 0.2%Language:Python 0.1%Language:HTML 0.0%Language:CSS 0.0%