-
Notifications
You must be signed in to change notification settings - Fork 999
Description
Hi,
the latest 4.13 Linux wheels release do not contain dejavu fonts as previous version 4.12.
When using cv2.createTrackbar you will see no text at all, just an empty space where the text should be shown. You could follow the tutorial for example to reproduce https://docs.opencv.org/4.13.0/da/d6a/tutorial_trackbar.html
user@ubuntu-vm:~$ 7z l opencv_python-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | grep ttf
2025-07-04 16:51:08 ..... 672300 333386 cv2/qt/fonts/DejaVuSans-Bold.ttf
2025-07-04 16:51:08 ..... 611212 311752 cv2/qt/fonts/DejaVuSans-BoldOblique.ttf
2025-07-04 16:51:08 ..... 345204 164352 cv2/qt/fonts/DejaVuSans-ExtraLight.ttf
2025-07-04 16:51:08 ..... 611556 311964 cv2/qt/fonts/DejaVuSans-Oblique.ttf
2025-07-04 16:51:08 ..... 720012 361229 cv2/qt/fonts/DejaVuSans.ttf
2025-07-04 16:51:08 ..... 631992 310825 cv2/qt/fonts/DejaVuSansCondensed-Bold.ttf
2025-07-04 16:51:08 ..... 580168 298572 cv2/qt/fonts/DejaVuSansCondensed-BoldOblique.ttf
2025-07-04 16:51:08 ..... 576004 295438 cv2/qt/fonts/DejaVuSansCondensed-Oblique.ttf
2025-07-04 16:51:08 ..... 643852 314527 cv2/qt/fonts/DejaVuSansCondensed.ttf
user@ubuntu-vm:~$ 7z l opencv_python-4.13.0.92-cp37-abi3-manylinux_2_28_x86_64.whl | grep ttf
user@ubuntu-vm:~$
The code for this is still there
Line 243 in 4ddfc01
| # add fonts for Qt5 |
so maybe dejavu font is not installed and available anymore in the base image used in CI to run this job? I couldn't figure out for sure what image is used to build these wheels to confirm this.
Edit: the fonts are installed in the docker image and available in the location where setup.py expects it. To me it looks like the line after that is the problem as it expects to find the fonts in Qt cmake install dir but this version of Qt doesn't seem to install fonts anymore so I think this doesn't do anything. Instead we should probably just copy the .ttf from the system installation. For backwards compatibility with older Qt versions where apparently fonts where installed via cmake it could be done only if no fonts are found in qt cmake dir.
If I copy the .ttf files from previous installation of 4.12 to venv using 4.13 it works as expected.
Thanks!