Optimize my ~/.config/fontconfig/fonts.conf for Philips PHL 275E1, AMD Radeon RX 6400 and Hyprland (Wayland):
Assistant
Here's an optimized ~/.config/fontconfig/fonts.conf for your setup with Philips PHL 275E1 monitor, AMD Radeon RX 6400 GPU, and Hyprland (Wayland).
Considerations
The Philips PHL 275E1 is a 2560×1440 27" IPS display with a typical DPI ~109; good subpixel rendering is possible but you may want to experiment with rgba and lcdfilter.
AMD Radeon RX 6400 should fully support standard font rendering features in Wayland.
Hyprland (a Wayland compositor) tends to ignore or handle fontconfig differently than X11, so you want consistent but sensible settings.
You had contradictory and duplicate rules in your original config.
Using rgba:none disables subpixel antialiasing, which is okay if you prefer grayscale antialiasing (sometimes better on high DPI).
lcdlegacy filtering is usually for older displays; for IPS/newer displays, lcddefault or lcdshaped may look better.
Optimized fonts.conf
xml
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Font rendering settings -->
<match target="font">
<!-- Enable antialiasing -->
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
<!-- Disable embedded bitmap fonts for cleaner rendering -->
<edit mode="assign" name="embeddedbitmap">
<bool>false</bool>
</edit>
<!-- Enable hinting -->
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
<!-- Use slight hinting, better for LCD displays -->
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
<!-- Subpixel rendering setting -->
<edit mode="assign" name="rgba">
<!-- Changed from none to rgb for subpixel on LCD panel -->
<const>rgb</const>
</edit>
<!-- LCD filter - lcddefault is more modern than lcdlegacy -->
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
<!-- Font substitutions -->
<match target="pattern">
<test name="family" qual="any">
<string>Helvetica</string>
</test>
<edit binding="same" mode="assign" name="family">
<string>Arimo</string>
</edit>
</match>
<dir>~/.local/share/fonts</dir>
</fontconfig>
Explanation and recommendations
Antialias:true enables smoothing.
Embeddedbitmap:false disables bitmap fonts which typically look bad on LCDs.
Hinting: Enabled with hintslight to keep characters sharp but not overly distorted.
RGBA: Now set to rgb because Philips PHL 275E1 is an LCD with RGB stripe; subpixel rendering greatly improves clarity.
LCD filter:lcddefault generally strikes a good balance. You can try lcdshaped if you want a slightly sharper but potentially uneven look, or lcdlegacy if artifacts appear.
Helvetica -> Arimo: Arimo is a metrically compatible free substitute for Helvetica, which is often missing on Linux.
Removed duplicate/redundant <match> blocks for clarity and maintainability.
Optional: Adjust DPI per your actual display DPI
Hyprland and Qt toolkits often allow DPI overrides (e.g., Hyprland config or environment variables like GDK_DPI_SCALE), but fontconfig typically does not handle DPI settings itself beyond hinting.
If you want to experiment further:
Change rgba to none for grayscale AA if subpixel rendering causes color fringes.
Change lcdfilter to lcdshaped or lcdlegacy to see if you prefer the difference.
Try toggling embeddedbitmap to true if you see missing or ugly fonts that are bitmap-only.
Let me know if you want me to generate a more complex config with platform-specific tweaks or font-specific rules!