Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 03-21-2014, 10:24 AM   #1
Gullible Jones
Registered: Apr 2011
Posts: 142

Rep: Reputation: 10
Variable width fonts and performance

Something I noticed while messing around with gtkperf...

500 text add operations with Dejavu Sans Mono font:

GtkTextView - Add text - time: 10.73

vs. 500 text add operations with Dejavu Sans variable width font:

GtkTextView - Add text - time: 35.29


Do variable width fonts necessarily render more slowly, or has this more to do with how GTK2 does font rendering?

(If the former, I wonder if variable width fonts are responsible for some of the sluggishness of GTK2 on computers with low spec CPUs.)
Old 03-21-2014, 01:17 PM   #2
Senior Member
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,648

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
That's an interesting result! I suspect it would apply with any graphics toolkit: the more complex the font, the more work there'll be to do. In the old days, text display could be really fast on the simplest machines because there were no vector fonts, only bit-map ones.
Old 03-21-2014, 11:29 PM   #3
Gullible Jones
Registered: Apr 2011
Posts: 142

Original Poster
Rep: Reputation: 10
Yeah, it looks like maybe font kerning is slow? I don't know. The results on my laptop with Ubuntu Sans vs. Ubuntu Mono are even more insane though:

GtkTextView - Add text - time: 33.74


GtkTextView - Add text - time: 5.15

Makes me think it might be worth switching to monospace fonts for most widgets on slower machines, if you can find ones that are easily readable. Those differences will add up.

Edit: what's more interesting is that appending the text slows down drastically as the amount of previous text increases. Not sure if that's a GTK2 problem, or a problem with the gtkperf program; I think it smacks a bit of data structure issues...

Last edited by Gullible Jones; 03-21-2014 at 11:32 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 7 Of The Best Ubuntu Terminal (Fixed Width) Fonts LXer Syndicated Linux News 0 07-19-2010 11:30 PM
TTY fonts with width smaller 8? MasterOfTheWind Linux - Software 0 10-16-2007 11:55 AM
Can we specify variable field width in a scanf() format string? skie_knite007 Programming 3 05-13-2005 01:56 PM
Huge spaces in all variable width fonts Dare Linux - Software 0 10-21-2004 01:45 PM
Missing fixed width fonts in KDE Romendo Linux - Software 0 12-09-2003 12:52 PM

All times are GMT -5. The time now is 09:57 PM.

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