What do you mean by ugly? That GDI text rendering is used on Windows instead of DirectWrite for some font families? This can be disabled in about:config by assigning `gfx.font_rendering.cleartype_params.force_gdi_classic_for_families` an empty value. Or do you mean that there's no subpixel positioning on non-Windows/macOS? That one has no fix, except when the text rendering part of WebRender goes into production.
AFAICT Firefox text rendering has always been fine on Linux. Chrome until a year or two ago had no subpixel antialiasing, different gamma for antialiasing, or whatever - its text rendering used to look ugly, or more neutrally: different from everything else.