FcPatternGet(3)

πŸ’… FcPatternGet(3) β€” the section 3 girlies know πŸ’…

okay so picture this: you're deep in a fontconfig pattern (FcPattern, iconic struct of all time), and you just wanna peek at one little value inside it. that's literally this function. it's the "hey bestie can I see that" of the fontconfig API 🫢


✨ NAME ✨

FcPatternGet β€” return a value from a pattern. that's it. that's the whole job. no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <fontconfig/fontconfig.h>

FcResult FcPatternGet (FcPattern *p, const char *object, int id, FcValue *v);

look at her. FcResult coming back out, p the pattern, object the property name, id the index, v where the answer lands. she's giving organized. she's giving functional. periodt ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's important so listen up πŸ“:

FcPatternGet returns in v the id'th value associated with the property object. like, the value at that index for that property name. that's the whole vibe check.

⚠️ okay this part is the main character of the whole page, fr fr: the value returned is not a copy. it refers to the data stored within the pattern directly. so it's pointing right back into the pattern's own storage β€” not a cute little duplicate you get to keep.

and because of that: applications must not free this value. not "should maybe consider not" β€” must not. do not free it. do not free() her. do not touch her with a deallocator. she is not yours to destroy πŸ˜­πŸ’€ the pattern owns her, you're just borrowing a glance. iykyk.

so yeah: peek, use, don't free. slay πŸ”₯πŸ‘‘


that's the whole page bestie, you ate that πŸ’–

this little beauty comes to you from Fontconfig 2.17.0, dated 27 June 2025 β€” mwah, mwah, bye πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from