1. Products
  2.   Font
  3.   C++
  4.   Font-Manager

Free C++ Library to Search & Substitute Fonts

Open Source C++ Font Library to Search, Load, Substitute & Manipulate Fonts File Formats using C++ commands

In the world of software development, attention to detail is paramount. One often-overlooked aspect is typography—the art and technique of arranging typefaces for enhanced readability and aesthetics. This is where the Font-Manager library steps in, offering a robust solution for font management in various applications. Font handling can be a complex task for developers, especially when dealing with different operating systems, rendering engines, and font formats. The Font-Manager library acts as a bridge, providing a unified interface to manage fonts seamlessly across platforms.

Font-Manager supports a wide range of platforms and technologies, making it highly versatile for developers working on different projects. There are several important features part of the library for handling fonts related tasks, such as retrieving information about available fonts, dynamically applying font styling to text elements, listing all available fonts, searching fonts with specified characteristics, smart font substitution techniques, integration with other design tools and frameworks, font detection & Installation, font activation & deactivation support and many more.

One of the key features of Font-Manager is its ability to locate and load fonts from various sources, such as system fonts, custom directories, or embedded resources. By abstracting the underlying platform-specific details, software developers can effortlessly access fonts without worrying about compatibility issues or complex file operations. This convenience empowers developers to focus on the core functionality of their applications while ensuring consistent and visually appealing typography. By incorporating Font-Manager into your projects, you can streamline font management and focus on creating visually stunning and engaging experiences.

Previous Next

Getting Started with Font-Manager

The recommended way to use Font-Manager is using npm. Please use the following command for a smooth installation of the library.

Install Font-Manager via npm

  npm install font-manager 

You can also install it manually; download the latest release files directly from GitHub repository.

Search and Load Fonts via C++ API

The open source Font-Manager library has included a very powerful set of features for handing available fonts inside C++ applications. The library allows software developers to search out a particular font by providing font description. The findFont() method can be used to search out the provided font description and will return the result if matches. The following example shows how software developers can search out a font with just a couple of lines of code.

Find & Display Font Info inside C++ Applications

// asynchronous API
fontManager.findFont({ family: 'Arial', weight: 700 }, function(font) { ... });

// synchronous API
var font = fontManager.findFontSync({ family: 'Arial', weight: 700 });

// output
{ path: '/Library/Fonts/Arial Bold.ttf',
  postscriptName: 'Arial-BoldMT',
  family: 'Arial',
  style: 'Bold',
  weight: 700,
  width: 5,
  italic: false,
  monospace: false }

Font Substitution inside C++ Apps

The open source Font-Manager library has included a useful features enabling software developers to search and substitute fonts inside their C++ applications. The library utilizes smart font substitution techniques to handle missing or unavailable fonts gracefully. In situations where a specific font is not available, the library can intelligently select a suitable alternative, maintaining the intended design and preserving the application's visual integrity. The following example shows how to substitute font with another one using C++ code.

How to Substitute Font with Another Font using C++ API?

// asynchronous API
fontManager.substituteFont('TimesNewRomanPSMT', '汉字', function(font) { ... });

// synchronous API
var font = fontManager.substituteFontSync('TimesNewRomanPSMT', '汉字');

// output
{ path: '/Library/Fonts/Songti.ttc',
  postscriptName: 'STSongti-SC-Regular',
  family: 'Songti SC',
  style: 'Regular',
  weight: 400,
  width: 5,
  italic: false,
  monospace: false }

Select & Render Fonts using C++ API

The Font-Manager library offers a rich set of functions to simplify font selection and rendering. Software developers can programmatically retrieve information about available fonts, including their names, styles, and supported languages. This capability allows applications to provide users with a curated list of fonts tailored to their specific requirements. Furthermore, Font-Manager enables developers to dynamically apply font styling to text elements, such as size, weight, and style attributes. Whether it's creating headlines, body text, or UI elements, the library ensures precise control over the visual appearance of text, enhancing user experience and readability.