Arabic text in search box is shifted upward on linux

I used Anki 24 for a long time. When I started testing Anki 26, I noticed that Arabic text is shifted upward (I know that line height for Arabic is higher than English in my system font (ubuntu)). This shift makes the upper part of the text invisible. I then confirmed that the issue is also present in Anki 25. I think it may be due to upgraded QT version.
Screenshot From 2026-05-19 09-30-58

This screenshot is from Anki 24.
Screenshot From 2026-05-19 09-30-23

This is from 25 and 26.

I know that for web (CSS), I can fix this issue by changing line-height property to 1, but I have no experience with QT.

Looks like something specific to Ubuntu or the font. Maybe setting the text margins can help if you’re interested in testing that.

After changing the system font to noto sans Arabic, the issue resolved, however, everything consumes more vertical space now:
Screenshot From 2026-05-20 06-57-19
I think when I used a font that doesn’t contain the Arabic glyphs, Qt was asking for the font height, it finds it a certain height. When I type an Arabic glyph, Qt doesn’t find the glyph in that font, it fallbacks to Noto Sans Arabic to borrow a glyph. Since Noto Sans Arabic has a larger line height, it overflows. However, I don’t know why Qt5 handles it better than Qt6.

Can I test that from the console?

For record, Rubik font returned vertical spaces to normal and solved the issue, I recommend it for anyone facing a similar problem:
image

Try something like this:

from aqt import mw, dialogs
from aqt.qt import *

browser = dialogs.open("Browser", mw)
browser.form.searchEdit.setTextMargins(QMargins(20, 20, 20, 20))

(I can’t see a difference on Windows with the default font).

I got:

AttributeError: 'QComboBox' object has no attribute 'setTextMargins'. Did you mean: 'setContentsMargins'?

Using setContentsMargins changes nothing. I think it’s not related to margins or padding, it’s related to line height (also called line spacing).