GNOME Bugzilla – Bug 351207
shadow and outline font styles
Last modified: 2009-01-04 02:17:07 UTC
When the cairo user-font API is implemented, we can use that to cache arbitrary-drawn glyphs, and that allows for synthesizing shadowed and outlined font styles.
Enhancement indeed.
Created attachment 70840 [details] Example of outlined text on a green background
Created attachment 70841 [details] Example of outlined text on a dark grey background
Created attachment 70842 [details] Example of outlined text on an image background
The attachments above are (ugly, quickly gimped-up) examples of outlined vs. plain text. If we had support for outlines at a pango level, they would certainly look much better than this. The grey and image-background versions should give some motivation for the usefulness of high-contrast outlined text on top of images or backgrounds similar to the foreground font color. If Cairo ever ends up fast enough to outline a lot of text like this, and we could make outlines look good for small font sizes (might be impossible), I'd love to experiment with using this system-wide for application fonts.
The good thing about the cairo user-font api that will probably be in 1.4 is that it allows for arbitrary effects, but still using cairo's glyph cache, so performance will not be a huge concern.
And then we can add a generic filter API to the pangocairo layer to allow for adding arbitrary effects.
If this is done, do note that you often do not need to do a full outline to make text readable on a background; a half-outline or shadow will work as well, and tends to look better at smaller px/em sizes. And be sure to check out what is done for television, they’ve done a tremendous amount of research on the topic.
James: Could you point out some information of fonts, readability, and TV? I've had trouble finding anything relating to basically anything but traditional printed font readability.
Travis: I let my smpte membership expire a few years ago, so I no longer have access to the member-only section there. Without that I'd have to google for it, and I doubt I'd find anything more than anyone else can.... Beyond that, there was a thread on (one of) the freetype list(s) some time back (well before the move to savannah; I don't know whether the old archives are available anywhere) discussing that. A commercial competitor to freetype was mentioned; their site had several examples, since they were targetting the film and broadcast market. W/o the archives I cannot be certain, but a quick google suggests it may have been bitstream; if so their advert page is at: http://www.bitstream.com/font_rendering/products/font_fusion/tvmodes/ http://www.bitstream.com/font_rendering/products/font_fusion/zurichtt.html http://www.bitstream.com/font_rendering/products/font_fusion/gothickanji.html but that doesn't address the issues of colour, just of how to hint.... For the details I was thinking of, I presume SMPTE's site is going to have the best info, but only for members. ($135/year; except students only have to pay $35/yr. cf smpte.org.)
Humm, closing this wontfix for now. I've been thinking about it and we can't do it easily in a way that works for cursive scripts like Arabic and Indic. The correct way to do outline is to do "pango_cairo_layout_path(); cairo_stroke()".