MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ add_fallback_font() [2/2]

MAYAFLUX_API bool MayaFlux::Portal::Text::add_fallback_font ( std::string_view  family,
std::string_view  style 
)

Locate a system font by family and style, then register it as a fallback.

Delegates font path resolution to find_font, then calls the path-based overload.

Parameters
familyFont family name, e.g. "Noto Sans CJK".
styleStyle hint, e.g. "Regular".
Returns
true on success.

Definition at line 110 of file Text.cpp.

111{
112 const auto path = find_font(family, style);
113 if (!path) {
114 MF_ERROR(Journal::Component::Portal, Journal::Context::API,
115 "add_fallback_font: could not locate '{}{}{}' on this system",
116 family,
117 style.empty() ? "" : " ",
118 style);
119 return false;
120 }
121 return add_fallback_font(*path);
122}
#define MF_ERROR(comp, ctx,...)
MAYAFLUX_API std::optional< std::string > find_font(std::string_view family, std::string_view style={})
Locate a system font file by family name and optional style.

References add_fallback_font(), MayaFlux::Journal::API, find_font(), MF_ERROR, and MayaFlux::Journal::Portal.

+ Here is the call graph for this function: