GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::Font2DOptions Struct Reference

Configuration options for a Font2D. More...

#include <GREM/graphics_2d/Font2D.hpp>

Public Member Functions

constexpr bool operator== (const Font2DOptions &other) const =default
 Compare these options to another set of options for equality.

Public Attributes

resource::AtlasPackerOptions atlasPackerOptions
 Configuration options for the font's internal atlas packer.
bool useLinearFiltering = false
 Use bilinear filtering rather than nearest-neighbor interpolation when rendering text at a non-1:1 scale using this font.

Detailed Description

Configuration options for a Font2D.

Member Function Documentation

◆ operator==()

bool grem::graphics::Font2DOptions::operator== ( const Font2DOptions & other) const
nodiscardconstexprdefault

Compare these options to another set of options for equality.

Parameters
otherthe options to compare these to.
Returns
true if the options are equal, false otherwise.

Member Data Documentation

◆ atlasPackerOptions

resource::AtlasPackerOptions grem::graphics::Font2DOptions::atlasPackerOptions
Initial value:
{
.initialResolution = 128,
.padding = 1,
.alignment = 1,
}

Configuration options for the font's internal atlas packer.

◆ useLinearFiltering

bool grem::graphics::Font2DOptions::useLinearFiltering = false

Use bilinear filtering rather than nearest-neighbor interpolation when rendering text at a non-1:1 scale using this font.

When set to true, this will cause scaled text to appear smoother compared to regular blocky nearest-neighbor scaling. Using linear filtering can help reduce aliasing artifacts on the glyph edges, but also makes the text more blurry.

Note
Regardless of this option, The best results are usually achieved when text is rendered at an appropriate character size to begin with, rather than relying on scaling.

The documentation for this struct was generated from the following file: