LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-31-2019, 03:31 PM   #1
sirabhorn
Member
 
Registered: Jan 2012
Distribution: Debian, Slackware, CentOS
Posts: 45

Rep: Reputation: Disabled
GTK/pango installation messed up my font


My C++/SDL program uses dejavu sans mono ttf-font which is copied to its directory. After installing some GTK and Pango packets with apt-get, the font seemed to have changed. I have removed every font configuration file which might have changed while installing those packets (based on file timestamps information) but the font does not seem to return to its original state.

The most notable change in the font is that the letter "m" looks bad now. You can see a sample text here: https://i.imgur.com/yB7IT07.png


And here is the list of my installed packets with string "pango" or "gtk" appearing in them. Many of these are part of some dependency hell, so it is not easy to remove them. But it can be tried if you think specific packets might have caused it: https://pastebin.com/auYdaC9R


Unfortunately I have updated Debian to Buster after those installs so the apt's & dpkg's logs seem not show anymore dates old enough to observe which exact packets I installed when the font changed.
 
Old 08-31-2019, 09:59 PM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
What directory is "its directory" that you copied to? Most apps depend on standard locations for ttf fonts as per fontconfig. App directories are not one of those standard locations.

In Buster if you look within /etc/fonts/conf.d/60-latin.conf you should see the default monospace font is Bitstream Vera Sans Mono, with DejaVu Sans Mono in second place. That makes those top priority as the default monospace font system-wide. Whichever of the two is installed will be default, if only one. DejaVu Sans fonts are all forks of Bitstream Vera, so typically look very much alike if both can be seen onscreen at the same time.

Possibly global hinting and anti-aliasing settings have changed since you upgraded. Those I haven't checked.

i.imgur.com is inaccessible to me. All the more common pastebins are, e.g.:
 
Old 09-01-2019, 07:53 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by sirabhorn View Post
My C++/SDL program uses dejavu sans mono ttf-font
How does it use the font? How does it render it? All by itself, or does it use some system wide library?
 
Old 09-01-2019, 10:00 AM   #4
sirabhorn
Member
 
Registered: Jan 2012
Distribution: Debian, Slackware, CentOS
Posts: 45

Original Poster
Rep: Reputation: Disabled
Quote:
Possibly global hinting and anti-aliasing settings have changed since you upgraded. Those I haven't checked.
Okay, now I managed to change it how the fonts appear in my program.

But I missed it at which point it actually changed.

I changed LXDE Desktop's font settings (Antialiasing, Hinting, Sub-pixel geometry) from both user and root accounts and tried with and without rebooting.

The change was effective at least once, unfortunately towards a worse direction, the text in my program looks more thin now (whereas previously mostly letter "m" had become thin). I tried to change it towards opposite direction but yet without results.

In any case, I'm not sure now at which point (by using user or root account, after a boot or without it) those changes take effect in my program. Fonts as seen on the desktop are changed immediately when I make changes from LXDE's menus.

(It is possible that some settings change the font so little that differences are difficult to observer.)

Quote:
What directory is "its directory" that you copied to? Most apps depend on standard locations for ttf fonts as per fontconfig. App directories are not one of those standard locations.
It's just a normal user directory, like /home/username/my_own_program

In my program I can tell to SDL-ttf library which ttf-font file I want to use and the path points to this font copied to the same directory as other program related files. It seems to make no difference if I use the font directly from where the font files usually are.

Quote:
i.imgur.com is inaccessible to me. All the more common pastebins are, e.g.:
Try this one then (it's a screenshot of my text, not a text paste, check those m-letters again) https://i.postimg.cc/mZcsjZRX/font-error.png

...though as I said, now the font has changed again.

Quote:
How does it use the font? How does it render it? All by itself, or does it use some system wide library?
My program uses SDL-ttf library to prepare fonts for the main functions of SDL main library which render them on the screen.
 
Old 09-01-2019, 10:37 AM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
Quote:
Originally Posted by sirabhorn View Post
Try this one then (it's a screenshot of my text, not a text paste, check those m-letters again) https://i.postimg.cc/mZcsjZRX/font-error.png
Yet another terrible upload/sharing site, making difficult to see the raw image.

Truly terrible looking fonts. What resolution is the screen you are working on, 1024x600? 1366x768? Seriously ugly.

Is your program a game? Why choose a monospace font? Maybe a proportional DejaVu would be better.

Have you tried not copying those .ttf file(s) to the local directory? Virtually every Linux distro, maybe all, includes DejaVu Sans Mono in a standard installation.

I'm not a programmer, so can't help with SDL-ttf library issues.
 
Old 09-01-2019, 11:47 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by mrmazda View Post
Yet another terrible upload/sharing site, making difficult to see the raw image.
both worked fine for me:
Code:
feh https://i.postimg.cc/mZcsjZRX/font-error.png
feh https://i.imgur.com/yB7IT07.png
 
Old 09-01-2019, 11:59 PM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
Quote:
Originally Posted by ondoho View Post
both worked fine for me
Fine for you. Imgur never works "fine" for me. All I get is ads and links surrounding blank space where an image or log belongs. Decent pastebins hosted by distros and FOSS sources like I linked to don't frustrate people with ads and irrelevant links. The other did the same thing.
 
Old 09-02-2019, 12:57 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ you misquoted me.
I wrote
Quote:
both worked fine for me:
Code:
feh https://i.postimg.cc/mZcsjZRX/font-error.png
feh https://i.imgur.com/yB7IT07.png
note the colon: I was refering to the possibility to view the raw image without using any web page bloat - that is what you were complaining about. I can download both raw images directly into an image viewer.

Clicking on the link directly, the imgur link goes to the raw image, the postimg link does indeed redirect to a browser page. No ads for me.

Generally speaking, I think you need to install some addons to get more control over the www.

Now, back on topic.
 
Old 09-02-2019, 01:47 AM   #9
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
Misquoted how exactly?

I don't need more add-ons. I need fewer, less opportunity for RAM exhaustion, conflicts and crashing. "Add-ons" may be what's blocking those sites from working.

If I had been presented with any visible raw image links by the those sites I would have used them. That's actually the root problem of which complained, image links that don't work, are invisible, or don't exist. We don't need scripting for viewing troubleshooting uploads or inviting more invasions of privacy. The linked pastebin sites fill the actual need.

Code:
> feh
If 'feh' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf feh
Apparently there's no zoom for feh, so those images are too small to be useful here using it.

Have we hijacked OP's thread enough yet?
 
Old 09-07-2019, 11:25 AM   #10
sirabhorn
Member
 
Registered: Jan 2012
Distribution: Debian, Slackware, CentOS
Posts: 45

Original Poster
Rep: Reputation: Disabled
Okay, at this point I know for sure that the problem (like those pitiful "m" letters in the screenshot linked below) is something that is independent of Desktop Environment's font configuration values (antialiasing, hinting, sub-pixel geometry and dpi). That error appears no matter in which position those settings are.

Also the error happens no matter if I use LXDE or Fluxbox so it probably isn't related to the desktop environment.

Any ideas which configuration it could be?

https://i.imgur.com/yB7IT07.png
 
  


Reply

Tags
font, gtk, pango



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error in the creation of `etc/pango/pango.modules` okeyla Linux - Newbie 3 07-02-2011 08:06 PM
pango-1.16.4 compile error (pango-querymodules) nigel_1820 Linux - Software 1 07-23-2007 01:10 AM
font problem after gtk, pango and cairo update Lord_Grave Linux - Software 0 06-03-2007 05:21 AM
Freerock uninstall stole GTK looking for up-to-date pango, atk, gtk, glib and xft tgz Oholiab Slackware 8 09-18-2005 11:57 AM
Pango wants >=glib-2.4.0, I installed glib 2.4.7 and pango still says I need >=2.4.0 Locura Red Hat 5 11-01-2004 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration