Repository navigation
Description
When attempting to install the systemfonts package via pak::pak('r-lib/systemfonts'), I encountered compilation errors related to Freetype functions/constants. Below are the detailed error logs, along with my current Freetype version info and relevant context:
1. Compilation Error Logs
ft_cache.cpp: In function 'std::string enc_to_string(FT_Encoding_)':
ft_cache.cpp:221:10: error: 'FT_ENCODING_PRC' was not declared in this scope; did you mean 'FT_ENCODING_SJIS'?
221 | case FT_ENCODING_PRC: return "prc";
| ^~~~~~~~~~~~~~~
| FT_ENCODING_SJIS
ft_cache.cpp: In member function 'FontFaceInfo FreetypeCache::font_info()':
ft_cache.cpp:257:24: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'FT_Int' {aka 'int'} [-Wsign-compare]
257 | for (size_t i = 0; i < face->num_charmaps; ++i) {
| ~~^~~~~~~~~~~~~~~~~~~~
ft_cache.cpp:292:7: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
292 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'std::vector FreetypeCache::cur_axes()':
ft_cache.cpp:456:3: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
456 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'void FreetypeCache::has_axes(bool&, bool&, bool&)':
ft_cache.cpp:476:5: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
476 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'int FreetypeCache::n_axes()':
ft_cache.cpp:489:5: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
489 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'bool FreetypeCache::is_variable()':
ft_cache.cpp:500:5: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
500 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'void FreetypeCache::set_axes(const int*, const int*, size_t)':
ft_cache.cpp:545:3: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
545 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
make: *** [/data1/workspace/wind/miniconda3/envs/seurat4/lib/R/etc/Makeconf:200: ft_cache.o] Error 1
ERROR: compilation failed for package ‘systemfonts’
Current Freetype Version in My Environment
Some suggestions mentioned updating Freetype, but I want to confirm:
-
Whether updating Freetype is the definitive fix for these errors?
-
If so, what minimum Freetype version is required?
-
Are there alternative workarounds (e.g., compiling flags, package versions) if updating Freetype is not feasible in my environment?
This issue matches #149 exactly, but none of the suggested fixes (e.g., Freetype update) have worked—I still get the FT_ENCODING_PRC/FT_Done_MM_Var undefined errors. Any other workarounds or compatible versions to try?
Looking for reply. : )
Activity
SSSJe commentedon Aug 18, 2026
After spending some time investigating, I noticed an issue with the Freetype library in my Conda environment.
In my build process, I encountered an error like 'FT_ENCODING_PRC' was not declared.

grep -R "FT_ENCODING_PRC" /path/to/includeThis macro is typically defined in freetype/ftmm.h (or possibly freetype2/freetype/ftmm.h). To verify its presence, I performed the following checks:
find "$CONDA_PREFIX/include" -name "ftmm.h ls -lh "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h" wc -c "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h" grep -n "FT_ENCODING_PRC" \ "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h""As shown in the screenshot below,
ftmm.hcontains no definition forFT_ENCODING_PRC. This suggests that the installed **Freetype ** might be incomplete or corrupted. To resolve this, I reinstalled Freetype :conda install --override-channels -c conda-forge freetype=2.14.3After a successful installation, I verified again:
grep -n "FT_ENCODING_PRC" \ "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h" | headThis time, everything is ok. : )
Maybe this will serve as a reference.