Bug 507268 - Strong lags with bitmap fonts and long strings and no word wrap
Summary: Strong lags with bitmap fonts and long strings and no word wrap
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: kwrite (other bugs)
Version First Reported In: 25.04.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-20 11:31 UTC by jpka
Modified: 2025-07-22 11:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Large ascii-only text file with long lines (240.23 KB, application/gzip)
2025-07-20 11:34 UTC, jpka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jpka 2025-07-20 11:31:33 UTC
SUMMARY

Hello.
I've noted that, using Kwrite, (and same with Kate), in some rare condition:
* Using bitmap fonts,
* And have long strings (> 2k chars each in my case),
* And with turned off dynamic word wrap. (View -> Word wrap),
i have strong lags when navigating/scrolling large text file. I've shared it here.

But, if i `gunzip` the `.pcf.gz` fonts, to make them `.pcf`, (and `fc-cache -fv`), the lags are disappear. I've tested with `ibm-fonts` like 8x8 BIOS font, and with Terminus.

I have Archlinux and XFCE; i also confirm this issue on other (similar) machine.
I can live with it, as i found this simple workaround with `gunzip`, so severity is low.


STEPS TO REPRODUCE

1. Have fresh Archlinux + XFCE.
2. Install `kwrite` and `kate` using `pacman`.
3. Install fonts: `pacman -S terminus-font`; `yay -S ibm-fonts`.
4. Open attached text file using `kwrite`.
5. Settings - Configure Kwrite - Editor font - `Ibm Bios 8x8 wide`.
6. View - Word wrap - turn off Dynamic word wrap.
7. Scroll document (PgUp/PgDn), see lags.
8. Close Kwrite.
9. `cd /usr/share/fonts/misc/` ; `gunzip i*` (use with care, do not run on production machine). `.pcf.gz` fonts should become `.pcf`.
10. `fc-cache -fv`
11. Repeat steps above and see there is no lags any more.


OBSERVED RESULT

Huge lags when scrolling on normal system (font in its normal `.pcf.gz` state)


EXPECTED RESULT

No text navigating lags, like using `gunzip` workaround.

SOFTWARE/OS VERSIONS
Windows: no
macOS: no
Linux/KDE Plasma: Archlinux + XFCE, but no KDE Plasma yet.
KDE Plasma Version: no
KDE Frameworks Version: no
Qt Version:
`qtdiag6`
Qt 6.9.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 15.1.1 20250425) on "xcb"
OS: Arch Linux [linux version 6.15.7-arch1-1]

Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 RDRAND RDSEED AES

Environment:
  QT_QPA_PLATFORMTHEME="qt5ct"

Features: QT_NO_EXCEPTIONS


ADDITIONAL INFORMATION

1. Only .bdf/.pcf(.gz) fonts are tested, `.otb` are not tested.
2. There is no any display issues with all these fonts (wrong letters/size/position...), only lags.
Thanks to dev teams for valuable and useful work and support.
Comment 1 jpka 2025-07-20 11:34:02 UTC
Created attachment 183376 [details]
Large ascii-only text file with long lines
Comment 2 Christoph Cullmann 2025-07-20 17:36:28 UTC
Hi, if unzipping the fonts helps, I don't think we can do anything there. That is then rather a freetype/fontconfig issue.

Perhaps it makes sense to report that to the distribution.

e.g. NixOS allows to tell that fonts shall be unpacked on install:

  # fonts for all users
  fonts = {
    # add default fonts
    enableDefaultPackages = true;

    # ensure we have an emulated global fontdir
    fontDir = {
      enable = true;
      decompressFonts = true;
    };

....
Comment 3 jpka 2025-07-22 11:31:19 UTC
Thanks! Use install script is good idea. I am make it works with Archlinux now: https://bbs.archlinux.org/viewtopic.php?pid=2252760
So this issue can be closed now.