FcPatternBuild(3)
β¨ FcPatternBuild(3) β¨
okay so bestie, we're in the FcPatternBuild(3) part of the fontconfig manual today β three functions that literally just assemble patterns out of arguments for you. it's giving factory-line energy, no cap π
πΈ NAME πΈ
FcPatternBuild, FcPatternVaBuild, FcPatternVapBuild β create patterns from arguments π
π¦ SYNOPSIS π¦
#include <fontconfig/fontconfig.h>
FcPattern * FcPatternBuild (FcPattern *pattern, ...);
FcPattern * FcPatternVaBuild (FcPattern *pattern, va_list va);
void FcPatternVapBuild (FcPattern *result, FcPattern *pattern, va_list va);
π DESCRIPTION π
So what these icons actually do is build a pattern out of a whole little guest list of objects, types and values. And when I say "each value gets specified with three arguments", I mean it fr fr β three, every single time, like a trio of besties who refuse to be separated π«Ά
- Object name β a string that literally describes the property you're adding.
- Object type β one of the
FcTypeenumerated values, periodt. - Value β and heads up, this one is not an
FcValue. It's the raw type, exactly as you'd pass it to any of theFcPatternAdd<type>functions. and it must match the type of that second argument, or it's gonna be a whole situation π
The argument list is terminated by a null object name β and no, you don't need to pass an object type or a value along with it, she just ends there, iconic queen behavior π. The values get added to pattern, and if pattern is null, a brand new pattern gets created instead. Either way? The pattern gets returned to you. slay β¨
Example, because we love a visual:
pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *) 0);
FcPatternVaBuild is your girl when the arguments are already sitting there in the form of a va_list varargs value β no unpacking required. And FcPatternVapBuild? That's a macro version of FcPatternVaBuild that returns its result directly in the result variable. lowkey convenient, highkey underrated π§
ngl if you get the type mismatch in step 3 wrong, that's on you β the manpage warned you, bestie π
and that's the page!! brought to you by Fontconfig 2.17.0, dated 27 June 2025 β go forth and build those patterns, main character π₯π
π¦ where this page comes from
- fedora 43: fontconfig-devel 2.17.0-3.fc43 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- fedora 43: fontconfig-devel 2.17.0-3.fc43 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- fedora 44: fontconfig-devel 2.17.0-4.fc44 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- fedora 44: fontconfig-devel 2.17.0-4.fc44 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms