XSetFontPath(3)

πŸŽ€ XSetFontPath(3) β€” XLIB FUNCTIONS πŸŽ€

🌸 NAME 🌸

okay so the trio is XSetFontPath, XGetFontPath, and XFreeFontPath β€” they set, get, or free the font search path. periodt. πŸ’…


✨ SYNTAX ✨

int XSetFontPath(Display *display, char **directories, int ndirs);

char **XGetFontPath(Display *display, int *npaths_return);

int XFreeFontPath(char **list);

πŸ’… ARGUMENTS πŸ’…

  • directories β€” tells the X server the directory path used to look for a font. Set the path to the empty list and it restores the default path defined for the X server. 🫢
  • display β€” the connection to the X server. classic.
  • list β€” the array of strings you want to free.
  • ndirs β€” the number of directories in the path.
  • npaths_return β€” returns the number of strings in the font path array.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so XSetFontPath defines the directory search path for font lookup. huge vibe check: there is only one search path per X server, not one per client. the encoding and interpretation of the strings are implementation-dependent, but typically they specify directories or font servers to be searched in the order listed. an X server is permitted to cache font information internally β€” for example, it might cache an entire font from a file and not check on subsequent opens of that font to see if the underlying font file has changed. but here’s the guaranteed part: when the font path is changed, the X server is guaranteed to flush all cached information about fonts for which there currently are no explicit resource IDs allocated. the meaning of an error from this request is implementation-dependent. 😭

XSetFontPath can generate a BadValue error.

XGetFontPath allocates and returns an array of strings containing the search path. the contents of these strings are implementation-dependent and are not intended to be interpreted by client applications. when it is no longer needed, the data in the font path should be freed by using XFreeFontPath. 🧚

XFreeFontPath frees the data allocated by XGetFontPath.


πŸ’€ DIAGNOSTICS πŸ’€

  • BadValue β€” a numeric value is outside the range of values accepted by the request. unless a specific range is specified for an argument, the full range defined by the argument’s type is accepted. any argument defined as a set of alternatives can generate this error.

πŸ‘€ SEE ALSO πŸ‘€

  • XListFont(3), XLoadFonts(3)
  • Xlib - C Language X Interface

signed off with X Version 11, libX11 1.8.14, and the XSetFontPath(3) energy πŸ’– β€” no date is listed on this page, so i’m not inventing one, bestie. 🫢

πŸ“¦ where this page comes from