CudaText
CudaText copied to clipboard
Ubuntu OS: Font selection of 'Fira Code' with Light style gives only 'Fira Code' regular style
I'm using FiraCode font and prefer Light weight font style.
Regular weght font selection
Light weght font selection
Unfortunately application doesn't follow the font selection, but always use Regular font weight.

Hereafter the Sublime text editor screenshot with FiraCode Light weight font style.

This is behaviour of Lazarus IDE (I get font name/style via TFontDialog only). can you please
-
install Lazarus LATEST via fpcUpDeluxe https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases
-
repeat the issue in the Lazarus IDE source editor (it has font selection dialog too)
-
create the same issue on Lazarus forum in this part? https://forum.lazarus.freepascal.org/index.php/board,26.0.html (part for GTK2 version)
-
specify widgetset: GTK2 or Qt5
Lazarus font dialog is here: Tools / Options, then in tab - Editor / Display / "Default editor font"

you can also try Font Changer addon.

I confirm issue on Ubuntu: I cannot select 'Litght' version because it don't have separate name like 'FiraCode Light', only one name here: FiraCode
But I have it in the left list in Font Dialog.

do you, guys, have these files in /usr/share/fonts/TTF?
-rw-r--r-- 1 root root 319368 янв 29 22:04 FiraCode-Bold.ttf
-rw-r--r-- 1 root root 288380 янв 29 22:04 FiraCode-Light.ttf
-rw-r--r-- 1 root root 283684 янв 29 22:04 FiraCode-Medium.ttf
-rw-r--r-- 1 root root 289624 янв 29 22:04 FiraCode-Regular.ttf
-rw-r--r-- 1 root root 285428 янв 29 22:04 FiraCode-Retina.ttf
-rw-r--r-- 1 root root 304248 янв 29 22:04 FiraCode-SemiBold.ttf
fc-list "Fira Code" | egrep -o 'FiraCode.*'
FiraCode-SemiBold.ttf: Fira Code,Fira Code SemiBold:style=SemiBold,Regular
FiraCode-Retina.ttf: Fira Code,Fira Code Retina:style=Retina,Regular
FiraCode-Bold.ttf: Fira Code:style=Bold
FiraCode-Light.ttf: Fira Code,Fira Code Light:style=Light,Regular
FiraCode-Medium.ttf: Fira Code,Fira Code Medium:style=Medium,Regular
FiraCode-Regular.ttf: Fira Code:style=Regular
also look here: https://unix.stackexchange.com/questions/392380/how-do-i-alias-one-of-the-weights-of-a-font-family-with-fontconfig
I have only /usr/share/fonts/truetype but (I installed FiraCode) I cannot find Fira*
I confirm issue on Ubuntu: I cannot select 'Litght' version because it don't have separate name like 'FiraCode Light', only one name here: FiraCode
I suppose there should be the way to select font style from the font selection dialog.
I do not install fonts globally, but put font files into the $HOME/.fonts directory.
Currently I'm using FiraCode variable font (FiraCode-VF.ttf file) , but tried also with separate files (FiraCode-xxxx.ttf).
fc-list "Fira Code" | egrep -o 'FiraCode.*'
output:
FiraCode/FiraCode-VF.ttf: Fira Code,Fira Code Light
FiraCode/FiraCode-VF.ttf: Fira Code,Fira Code Light:style=Bold
FiraCode/FiraCode-VF.ttf: Fira Code,Fira Code Light:style=Medium
FiraCode/FiraCode-VF.ttf: Fira Code,Fira Code Light:style=Regular
FiraCode/FiraCode-VF.ttf: Fira Code,Fira Code Light:style=SemiBold
FiraCode/FiraCode-VF.ttf: Fira Code,Fira Code Light:style=Light,Regular
as a temporary solution, try to use non-variable version. (maybe uninstall variable first)
user@user-HP-Pavilion-g6-Notebook-PC:~/.local/share/fonts$ fc-list "Fira Code" | egrep -o 'FiraCode.*'
FiraCode-Regular.ttf: Fira Code:style=Regular
FiraCode-Light.ttf: Fira Code,Fira Code Light:style=Light,Regular
FiraCode-Medium.ttf: Fira Code,Fira Code Medium:style=Medium,Regular
FiraCode-SemiBold.ttf: Fira Code,Fira Code SemiBold:style=SemiBold,Regular
FiraCode-Bold.ttf: Fira Code:style=Bold
FiraCode-Retina.ttf: Fira Code,Fira Code Retina:style=Retina,Regular
as a temporary solution, try to use non-variable version. (maybe uninstall variable first)
I tried already. This doesn't help.
FiraCode/FiraCode-Medium.ttf: Fira Code,Fira Code Medium:style=Medium,Regular
FiraCode/FiraCode-Retina.ttf: Fira Code,Fira Code Retina:style=Retina,Regular
FiraCode/FiraCode-Bold.ttf: Fira Code:style=Bold
FiraCode/FiraCode-SemiBold.ttf: Fira Code,Fira Code SemiBold:style=SemiBold,Regular
FiraCode/FiraCode-Regular.ttf: Fira Code:style=Regular
FiraCode/FiraCode-Light.ttf: Fira Code,Fira Code Light:style=Light,Regular
maybe try fc-cache -f or restart. or sudo dpkg-reconfigure fontconfig-config
fc-cache -f
fc-list "Fira Code" | egrep -o 'FiraCode.*'
FiraCode/FiraCode-Medium.ttf: Fira Code,Fira Code Medium:style=Medium,Regular
FiraCode/FiraCode-Retina.ttf: Fira Code,Fira Code Retina:style=Retina,Regular
FiraCode/FiraCode-Bold.ttf: Fira Code:style=Bold
FiraCode/FiraCode-SemiBold.ttf: Fira Code,Fira Code SemiBold:style=SemiBold,Regular
FiraCode/FiraCode-Regular.ttf: Fira Code:style=Regular
FiraCode/FiraCode-Light.ttf: Fira Code,Fira Code Light:style=Light,Regular
Font selection dialog still doesn't work and I have it different from you. But now I'm able to select the light-wight font manually in the user.json
"font_name__linux" : "Fira Code Light",
Most probably this is Lasarus font issue, as I don't have problem like this with any other application I'm using: pluma editor, far2linux manager, st terminal, libreoffice etc.
"font_name__linux" : "Fira Code Light", does the trick.
"font_name__linux" : "Fira Code Light",does the trick.
Yes, but with separate ttf files only. And it will be not worse to have font settings like: Fira Code Variable Font.
Font selection dialog still doesn't work and I have it different from you
I have compiled CudaText with Qt5. Maybe your dialog is different, because you are using GTK version?
We are limited in Lazarus - we use TFontDialog and fixed set of styles: normal/bold.
There should be possible to use freetype library (which is cross-platform) directly or via some wrapper like LazFreeType, but probably this does not worth the time.
lazarus issue 6 years old: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/29596
"Mantis submitter username: p_daniel
The same issue with weight: it's not possible to choose fonts with width different from "Regular" and "Bold". However, all this works fine in Win32 interface, because Win32 version of TFontDialog returns a string that contains stretch and weight."
I have compiled CudaText with Qt5
For some reason it doesn't work on my PC, just freezes after launch...
$ cudatext ↑
qt5ct: using qt5ct plugin
qt5ct: D-Bus global menu: no
"Mantis submitter username: p_daniel"
But he didn't provide the patch.
For some reason it doesn't work on my PC, just freezes after launch...
what if you will run strace cudatext ?
what if you will run
strace cudatext?
Well, I tried to launch cudatext this way:
strace cudatext 2>cudatext.trc
and again had to kill the process, as even after 15 minutes it doesn't show any window and application had 100% CPU utilization. Trace log file contains a lot of lines like this:
openat(AT_FDCWD, "/usr/share/fonts/truetype/kacst/KacstOffice.ttf", O_RDONLY) = 9
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
newfstatat(9, "", {st_mode=S_IFREG|0644, st_size=73680, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 73680, PROT_READ, MAP_PRIVATE, 9, 0) = 0x7f63683eb000
close(9) = 0
munmap(0x7f63683eb000, 73680) = 0
For some reason the QT5 based application tried to scan the whole font directories ($HOME/.fonts as well).
what if you will run
strace cudatext?Well, I tried to launch cudatext this way:
strace cudatext 2>cudatext.trc
@froloffw7
try runing dbus-monitor and launching cudatext