scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
font.cpp File Reference

Implementation of the TrueType font API (see font.h). More...

#include <scimesh/font.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <map>
#include <mutex>
#include <stdexcept>
#include "stb_truetype.h"
Include dependency graph for font.cpp:

Go to the source code of this file.

Classes

struct  scimesh::Font::Impl
 Shared font state: the font bytes, the parsed font and the glyph cache. More...
 

Namespaces

namespace  scimesh
 

Macros

#define STBTT_assert(x)   ((void)0)
 

Functions

std::string scimesh::default_font_path ()
 Path of the bundled default font, or as overridden by the SCIMESH_FONT environment variable.
 
std::string scimesh::resolve_font_path (const std::string &path)
 Turn a possibly empty font path into a path that exists.
 
Font scimesh::cached_font (const std::string &path, float pixel_size)
 Load a font, re-using an already loaded one when possible.
 
void scimesh::clear_font_cache ()
 Drop all fonts from the process-wide font cache.
 

Detailed Description

Implementation of the TrueType font API (see font.h).

Glyph rasterization is done by stb_truetype; the implementation is compiled here (and only here) so that the stb symbols stay out of the public headers and out of the library's exported symbols (STBTT_STATIC).

Definition in file font.cpp.

Macro Definition Documentation

◆ STBTT_assert

#define STBTT_assert (   x)    ((void)0)

Definition at line 30 of file font.cpp.