That could be so fuuny, when it would not be so sad.
I want to check if font supports Cyrillyc symbols before install it. But with current build of gnome it's literally impossible.
And the bug there is almost for 20 years.
https://bugs.launchpad.net/ubuntu/+source/gnome-font-viewer/+bug/385335
That's a good challange to improve it. For personal use for the first time.
I never work with GTK before. Worth to check and try!
https://gitlab.gnome.org/GNOME/pango
https://gitlab.gnome.org/GNOME/gnome-font-viewer
First issue: for meson build command
meson.build:32:17: ERROR: Dependency lookup for libadwaita-1 with method 'pkg-config' failed: Invalid version, need 'libadwaita-1' ['>= 1.8'] found '1.5.0'.
└─ $ pkg-config --modversion libadwaita-1
1.5.0
└─ $ apt policy libadwaita-1-dev
libadwaita-1-dev:
Installed: 1.5.0-1ubuntu2
Candidate: 1.5.0-1ubuntu2
Version table:
*** 1.5.0-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
100 /var/lib/dpkg/status
Let's try to compile the new one:
git clone https://gitlab.gnome.org/GNOME/libadwaita.git
cd libadwaita
git checkout libadwaita-1-8 # or stay on main for the latest
meson setup builddir --prefix=/usr/local
meson compile -C builddir
sudo meson install -C builddir
Build failed.
meson.build:39:11: ERROR: Dependency lookup for glib-2.0 with method 'pkg-config' failed: Invalid version, need 'glib-2.0' ['>= 2.84.0'] found '2.80.0'.
That will be a long story. Let's try to use Gnome sdk via flatpak. This is really a good idea I didn't know before, since it do not install anything on my local OS, compile and run everything in sandbox.
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.gnome.Sdk//50
flatpak install flathub org.gnome.Platform//50
Make a coffee till all stuff will be downloaded.
Looking for matches…
ID Branch Op Remote Download
1. org.freedesktop.Platform.GL.default 25.08 i flathub < 143.9 MB
2. org.freedesktop.Platform.GL.default 25.08-extra i flathub < 144.0 MB
3. org.freedesktop.Platform.VAAPI.Intel 25.08 i flathub < 14.0 MB
4. org.freedesktop.Platform.codecs-extra 25.08-extra i flathub < 14.4 MB
5. org.gnome.Sdk.Locale 50 i flathub < 402.2 MB (partial)
6. org.gtk.Gtk3theme.Adwaita-dark 3.22 i flathub < 1.5 kB
7. org.gnome.Sdk 50 i flathub < 822.4 MB
Looking for matches…
ID Branch Op Remote Download
1. org.gnome.Platform.Locale 50 i flathub < 386.4 MB (partial)
2. org.gnome.Platform 50 i flathub < 410.2 MB
Then it's finally installed I can try to build it. Using this long command makes compilation AND execution of compiled program inside sandbox with some access (home,x11,session-bus).
flatpak run --devel --filesystem=home --socket=wayland --socket=fallback-x11 --socket=session-bus --share=network --command=bash org.gnome.Sdk//50
Check if versions of modules are coorect inside flatpak sandbox
pkg-config --modversion libadwaita-1
pkg-config --modversion glib-2.0
And now I can try build
cd /path/to/your/project
meson setup builddir
meson compile -C builddir
And you can run as usual or with debug messages:
./builddir/src/gnome-font-viewer
G_MESSAGES_DEBUG=all ./builddir/src/gnome-font-viewer
So the issue is here pango/pango/pango-language.c.
const char *
pango_language_get_sample_string (PangoLanguage *language)
{
const LangInfo *lang_info;
if (!language)
language = pango_language_get_default ();
lang_info = FIND_BEST_LANG_MATCH_CACHED (language,
lang_info,
lang_texts);
if (lang_info)
return lang_pool.str + lang_info->offset;
return "The quick brown fox jumps over the lazy dog.";
}
Then by changing language code to "uk" in gnome-font-viewer/src/sushi-font-widget.c we can receive this result!
sample_string = pango_language_get_sample_string (pango_language_from_string ("uk"));
if (check_font_contain_text (self->face, sample_string))
retval = TRUE;
Then after a couple of hours reading the code (without AI) and googling some stupid questions about GTK I've created a working version where the language could be selected! It's not ideal because I'm using a predefined list of the language codes. I've tried solution with getting all available langiuages from pango but the list was really huge and when I opened it GtkDropDown was not center vieew on the selected element. What a mess.
Here's my draft solution if anyone is interested.
https://gitlab.gnome.org/GNOME/gnome-font-viewer/-/merge_requests/103
My bad I can't use it right now in my OS Xubuntu since I'm on DISTRIB_DESCRIPTION="Ubuntu 24.04.4 LTS" and my Gnome version is 46. Hope new LTS will be released soon, this year upgrade worth it.