This is needed when fcft/tllist are built as subprojects, since then
we must ensure their unit tests are executed, or we’ll get “profile
count data file not found” errors.
Before this, we assumed gcc was being used. The build would fail if
clang (or something else) was used.
Now, we check whether we’re compiling with gcc or clang, and disable
PGO if it’s neither of them.
Furthermore, we’re now adding the necessary flags needed to do PGO
with clang.
Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for
PGO:ing with clang. PGO is disabled if it isn’t available. It would be
nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs
doesn’t appear to support such a thing.
Finally, the -Wno-missing-profile flag, and its friends, have been
removed; instead we execute “footclient --version” (and “foot
--version”, in partial PGO builds) to ensure all generated binaries
have been executed before we do the final build (with
-Db_pgo=use). This fixes build failures with clang >= 11.x.
When resizing the font on-the-fly, we now do a complete
font-reload (this is basically what fcft_size_adjust() did anyway).
To get the correct size, we maintain the current size ourselves.
We get the initial size from the user-provided font pattern, by
converting the string to an FcPattern, and using FcPatternGet() to
retrieve both the FC_SIZE and FC_PIXEL_SIZE attributes. These
attributes are then removed from the pattern, and the pattern is
converted back to a string.
The terminal struct maintains a copy of the font sizes. These are
initially set to the sizes from the config.
When the user resizes the font, the terminal-local sizes are
adjusted. To ensure the primary and user-configured fallback fonts are
resizes equally much, convert any pixel sizes to point sizes at this
point.
When the font size is reset, we reload the font sizes from the
config (thus once again returning actual pixel-sizes, if that's what
the user has configured).