kcm_fonts: add subpixel and hinting previews
This commit adds subpixel and hinting previews to kcm_fonts under Wayland. To properly support fractional scaling, PreviewRenderEngine now querys the scale from focus window, which returns the right scale for the currently active window (which should be the font settings page when the dropdown is clicked), rather than the primary screen which can only return the next higher integer scale. The DPI query is changed to query the active window's QScreen rather than X11. The naive reenablement has a bug where the preview image's size will grow larger than the bounding box of the preview text. It turns out that QImage::setDevicePixelRatio adds margins to the image, and removing that call solves the issue somehow. There are some minor display issues like the preview being blurry under fractional scales, but it at least works. Somehow. BUG: 432320 (cherry picked from commit be7af9da)
Please register or sign in to comment