1. Products
  2.   Font
  3.   C++
  4.   BAWR
 
  

Free C++ Fonts Processing API to Create TrueType Fonts

Open Source C++ Library allows Software Developers to Create TrueType Fonts, PNG Textures, Atlas Maps and ImGui Font Loaders

The BAWR Library is an exceptional tool that has revolutionized SVG (Scalable Vector Graphics) and Font Icon processing in C++. It offers software developers a comprehensive set of features and functionalities to efficiently manipulate and utilize these graphical assets within their C++ applications. With its user-friendly interface and robust capabilities, the BAWR Library has become a go-to choice for programmers seeking to incorporate rich and visually appealing icons into their projects.

The BAWR Library is an open source C++ library designed specifically for handling SVG and Font Icons. It simplifies the process of working with these graphical assets, allowing software developers to seamlessly integrate them into their applications. There are several important features part of the library, such as TrueType fonts creation from SVG collections, PNG textures creation from SVG collections, embedding binaries, ImGui Font Loader generation, C++ Atlas Maps creation, applying a transformation to SVG files, creating C++ Font constants as Macros, and many more.

BAWR Library significantly reduces the time and effort required to process and integrate icons into your C++ applications. By utilizing the library's extensive set of functions and classes, developers can easily load, parse, manipulate, and render SVG and Font Icons, thereby enhancing the visual experience of their software. Its comprehensive set of features, simplicity of integration, and support for both SVG and Font Icons make it a powerful tool for developers. Give BAWR Library a try, and unlock a world of possibilities for creating stunning icon-based interfaces in your C++ projects.

Previous Next

Getting Started with BAWR

The recommended way to use BAWR is using GitHub. Please use the following command for a smooth installation of the library.

Install BAWR via GitHub

  git clone https:://github.com/mnesarco/bawr.git
cd bawr
 

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

Generate TrueType Fonts using C++ API

The open source BAWR library makes it easy for software developers to create and manage TrueType fonts inside C++ applications with just a couple of lines of code. It also provides robust support for Font Icons, allowing software developers to load and utilize popular icon fonts such as Font Awesome, Material Design Icons, and more. With the BAWR Library, software developers can easily incorporate Font Icons into their applications, making it simpler to customize and scale icons dynamically. The following examples shows how software developers can generate TrueType Fonts with just a couple of lines of code.

Generate Truetype Fonts via C++

class MyFont( Font ):

    # Generated font copyright notice [Mandatory]
    copyright = "Copyright 2020 Frank D. Martinez M."

    # Font name [Mandatory]
    name = "my-icons"

    # Font family [Mandatory]
    family = "my-icons"

    # First font glyph code [Optional] (default = 0xe000)
    # start_code = 0xe000

    # List of tuple of the icon sets included in this font [Mandatory]
    collections = (BootstrapIcons, MyIcons)

    # Global font transformation [Optiona] (See: Font transformations)
    transformation = []

    # Output format [Optional] (default = ['ttf'])
    output_formats = ['ttf']

    # Verbose output. Shows glyph generation details [Optional] (default = False)
    verbose = False

SVG Parsing and Rendering via C++

The BAWR Library excels at parsing SVG files, extracting essential elements, and rendering them with precision. It supports a wide range of SVG features, including paths, shapes, gradients, filters, and transformations. This enables software developers to accurately display SVG icons in their applications, providing high-quality visuals that scale seamlessly across different screen resolutions. The library also provides robust support for Font Icons, allowing developers to load and utilize popular icon fonts such as Font Awesome, Material Design Icons, and more.

Generate an Optimized PNG Atlas in C++ Apps

class MyAtlas( Atlas ):

# [Optional] width of the atlas image (default = 512)
width = 512

# [Mandatory] sizes of the icons to be generated and included in the atlas
sizes = (16, 32, 64)

# [Mandatory] References to collections (icon sets) to be included
    collections = (BootstrapIcons, MyIcons)

# [Optional] name prefix for the generated files (default = font.name)
# name = ...

# [Optional] Embed the Atlas png into a C++ source.
class MyCppAtlasEmbed( CppEmbedded ):
    source = "${BAWR_OUTPUT_DIR}/atlas.png"

Font Icon Composition & Manipulation via PHP

The open source BAWR Library allows software developers to combine multiple icons to create more complex visual elements inside C++ applications. This feature is particularly useful when designing unique UI components or generating dynamic icons based on user preferences. In addition to SVG icons, BAWR Library also supports Font Icons. It provides a range of utilities to extract font glyphs, determine their metrics, and render them on various surfaces. Moreover, it also offers a comprehensive set of tools to manipulate icons. Whether users need to resize, rotate, or apply color transformations to icons, the library provides intuitive functions to accomplish these tasks efficiently.