Please evaluate this method...
If you haven't installed custom/personal fonts on your system, then your font fingerprint will be generic enough for your system to not be unique. Installing one personal font is enough to make you unique. I haven't found any extensions (including the Firefox privacy.resistFingerprinting and Enhanced Privacy Protection = Strict mode) that work and some may cause errors in the javascript to make you stand-out.
So my solution is to simply not use the ~/.fonts directory for personal fonts. Create your own directory for them and the system will never know about them and therefore be seen by any application that you do not explicitly configure it to use. So, for Gimp, I can just add my special font directory. Other apps may not be configurable like that but I'll deal with that on a case-by-case basis.
Here is the script I used (created by ChatGPT) to test if my personal fonts are detectable:
(async function() {
// Base fonts to test against (commonly available on all systems)
const baseFonts = ["monospace", "sans-serif", "serif"];
// Range of test fonts (you can use `fc-list` output to expand this list programmatically)
const testFonts = [
"Arial", "Verdana", "Times New Roman", "Georgia", "Courier New", "Comic Sans MS", "Trebuchet MS",
"Impact", "Lucida Console", "Garamond", "Tahoma", "Palatino", "Brush Script MT", "PERSONAL-FONT"
];
// Detected fonts will be stored here
const detectedFonts = [];
// Create a hidden iframe to isolate font rendering context
const iframe = document.createElement('iframe');
iframe.style.width = "1px";
iframe.style.height = "1px";
iframe.style.border = "none";
document.body.appendChild(iframe);
// Use the iframe's context to ensure isolation
const doc = iframe.contentDocument || iframe.contentWindow.document;
const canvas = doc.createElement('canvas');
const ctx = canvas.getContext('2d');
// Text for consistent font measurement
const sampleText = "abcdefghijklmnopqrstuvwxyz0123456789";
// Pre-compute the width of each base font
const baseWidths = {};
baseFonts.forEach(baseFont => {
ctx.font = `16px ${baseFont}`;
baseWidths[baseFont] = ctx.measureText(sampleText).width;
});
// Function to test if a font is different from the base fonts
function detectFont(font) {
for (let baseFont of baseFonts) {
ctx.font = `16px ${font}, ${baseFont}`;
const testWidth = ctx.measureText(sampleText).width;
if (testWidth !== baseWidths[baseFont]) {
return true; // Font detected
}
}
return false; // Font not detected
}
// Detect fonts
testFonts.forEach(font => {
if (detectFont(font)) {
detectedFonts.push(font);
}
});
// Clean up the iframe to avoid leaving artifacts on the page
document.body.removeChild(iframe);
// Output the results
console.log("Detected Fonts:", detectedFonts);
})();
Can also use the amiunique site to test how many fonts it detected. Please critique this method.
Update
Some packages/apps may not have installed fonts in the home .fonts dir, so check your system fonts folder to see if any packages installed links to their font directories. Either uninstall the packages or move the font dirs if the app allows that. If you can't move them, then you may be able to disable them temporarily while you aren't using them, such as with Fonts Management in Fedora.
Update
I also installed a VM for my OS to get the default system fonts and setup my system to match it. A font directory can be quickly disabled by renaming it with a leading dot, ".". Then call "fc-cache -fv" to refresh the font cache. No FF browser restart required.