Tips for better font rendering in Linux?

1,333 views
Skip to first unread message

Christian Joudrey

unread,
Sep 28, 2011, 11:03:11 AM9/28/11
to phan...@googlegroups.com
Hey guys,

This is mainly QT related, but I figured it would be good to ask in this group.

Take for example the following render:

PhantomJS (RedHat): http://i.imgur.com/PItcC.png

There are a few small differences between the font rendering:
  • See BUILD APPS THAT COMMUNICATE. PhantomJS version seems to have more letter-spacing and word-spacing.
  • Bolded text seems lighter in the PhantomJS version.
Is this simply an issue with the fonts I installed in RedHat or is there settings at the OS level that I can tweak to obtain better results?

- Chris

Javismiles

unread,
Aug 26, 2013, 7:23:39 PM8/26/13
to phan...@googlegroups.com, cmal...@gmail.com
I've been having similar issue, did you find any solution?
I attach image with example of my issues,
comparison-browser-server.jpg

Andrew Hamilton

unread,
Aug 27, 2013, 5:27:47 PM8/27/13
to phan...@googlegroups.com, cmal...@gmail.com
Sorry I'm not of much help, but I've been dealing with cruddy font-rendering in Phantom for a while now. Nothing I've done seems to have an effect. And I'm not even dealing with fancy fonts: even basic fonts like Arial look so... wrong. I'll probably be working through this for the rest of the week so I'll post anything I find. 

So far, "Infinality patches" did nothing (though I'm not sure it's even configured correctly), dozens of tweaks to hinting and such have made noticeable difference, none of it good... I've also verified my font caches and have the Microsoft set loaded and functional. 

I'd really like to find a way to verify that its even using the proper font, since pulling font-family from an element doesn't provide which one is being rendered. This would allow me to at least make sure there isn't some sort of disconnect between the my OS and the qt-headless-phantom-magic that I don't quite grasp. 

Javier Ideami

unread,
Aug 27, 2013, 5:43:09 PM8/27/13
to phan...@googlegroups.com, cmal...@gmail.com
thank you for these thoughts Andrew, 

- infinality is also doing nothing for me, if i want to uninstall infinality, how can i return to the state before i installed infinality, how can i uninstall it in linux centos?

- Ive heard that Phantom 2.0 may be coming out in 1 month, maybe that will improve the font rendering?

- Is there any similar alternative to Phantom.js? i guess not, i heard about Cutycap but features of phantom seem much better

I am wondering what system mural.ly uses as their renders are so perfect and its also webfonts and html5

thank you again
Jav






--
You received this message because you are subscribed to a topic in the Google Groups "phantomjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phantomjs/ph0m-9rNTjY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs.
For more options, visit https://groups.google.com/groups/opt_out.



--
Javier Ideami
Founder Ideami Studios & Posterini.com
San Francisco, CA

Andrew Hamilton

unread,
Aug 28, 2013, 9:31:24 AM8/28/13
to phan...@googlegroups.com, cmal...@gmail.com
1) I'm not entirely sure how you installed Infinality, so I can't really help you there. 

2) I've heard nothing confirming a release date for Phantom 2. There is a separate branch, QT5 has been pulled in, it's buggy and being worked on. That was a few weeks ago I believe. 

3) The closest alternative is Slimer, built using the Gecko engine, if that works for you: http://slimerjs.org/ It's not truly headless though, which may be a deal breaker for me if Casper can't launch it properly. If I can get it running, I'll post my findings. 
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

James Greene

unread,
Aug 29, 2013, 3:45:57 PM8/29/13
to phan...@googlegroups.com, Christian Joudrey
Why are you asking about SlimerJS on the PhantomJS mailing list?  They are mutually exclusive (though admittedly similar) tools and codebases. :-\

Sincerely,
    James Greene



On Thu, Aug 29, 2013 at 2:26 PM, Javier Ideami <ide...@gmail.com> wrote:
i have installed Xvfb  on my centos 6, to test slimerjs, and when i try to create a screen, it comes back with this strange font error, any idea how to fix it?

Xvfb :99 -ac -screen 0 1024x768x16
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
[dix] Could not init font path element catalogue:/etc/X11/fontpath.d, removing from list!
[dix] Could not init font path element built-ins, removing from list!

Fatal server error:
could not open default font 'fixed'



On Thu, Aug 29, 2013 at 11:25 AM, Javier Ideami <ide...@gmail.com> wrote:
after more research conclusion is clear, SlimerJS should be the answer to solve the problems, i need to install it on centos and try it, cross fingers :)


On Thu, Aug 29, 2013 at 10:30 AM, Javier Ideami <ide...@gmail.com> wrote:
so after much investigations, i found a linux expert and what we found out is that if we run native firefox on centos there are no problems, no artifacts and it looks great, image attached, 
instead the artifacts seem to be coming from the way phantom.js renders things, which is a real pity, is there any way to fix that? this is what the expert also wrote to me

"i think what the problem is that phantom is using ghostscript, like all other free pdf generators that I have ever seen do, and there are a couple of things happening.

Its funny that script with phantom is called rasterizer because, from my viewpoint anyway, converting a pixel bitmap, the screen, into something more akin to a vector graphic, postscript, is opposite. (pdf is basically compressed/encapsulated postscript). If it were true postscript, like the file I will attach, it would probably be ok, but ghostscript is not postscript. Adobe/Apple/et.al. probably put million(s) of man hours in on it. Postscript saved Apple from extinction. 

So for one, you are picking up artifacts of imperfect conversion from the bitmap to the page description language. And then its substituting the free gs character outlines for the mega-dollar adobe versions. Remember Adobe Type Manager? 

When I think about it in that light, it almost seems to become familiar. Get some nice raster (png,bmp,tiff) files and convert them with gs and see if they don't have the same artifacts. "

image attached showing that render on native firefox on centos linux works great without artifacts


On Thu, Aug 29, 2013 at 2:18 AM, Javier Ideami <ide...@gmail.com> wrote:
hi friends

i have some new interesting information

i did a test outside of my web app and i was very surprised because
results came out very similar


better than inside my app, how is this possible i thought,
i just noticed some distorsions in some shapes, but not that much,
see for example the Letters  O  on some words have some odd cutouts

then i tried adding more css3 scale transforms


and now the distorsion in shape of word is much more clear

What is interesting is that the first versions above are quite acceptable,

it may be that the css3 transforms in my web app are making the problem worse

do you have any data on how css3 transforms are affecting the font rendering on Phantom.js?

thank you very much
Jav

--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.

Javier Ideami

unread,
Aug 29, 2013, 3:52:39 PM8/29/13
to phan...@googlegroups.com, Christian Joudrey
apologies you are right, 

Message has been deleted

Javismiles

unread,
Sep 3, 2013, 1:13:12 AM9/3/13
to phan...@googlegroups.com, cmal...@gmail.com
i recommend infinality.net font patches, they solved my font quality rendering problems in linux, they are awesome



On Wednesday, September 28, 2011 8:03:11 AM UTC-7, Christian Joudrey wrote:
Reply all
Reply to author
Forward
0 new messages