After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 351207 - shadow and outline font styles
shadow and outline font styles
Status: RESOLVED WONTFIX
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: Big feature
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 353293
 
 
Reported: 2006-08-13 22:10 UTC by Behdad Esfahbod
Modified: 2009-01-04 02:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example of outlined text on a green background (114.68 KB, image/png)
2006-08-14 01:13 UTC, Travis Reitter
Details
Example of outlined text on a dark grey background (102.36 KB, image/png)
2006-08-14 01:14 UTC, Travis Reitter
Details
Example of outlined text on an image background (244.83 KB, image/jpeg)
2006-08-14 01:17 UTC, Travis Reitter
Details

Description Behdad Esfahbod 2006-08-13 22:10:33 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.
Comment 1 Behdad Esfahbod 2006-08-13 22:11:15 UTC
Enhancement indeed.
Comment 2 Travis Reitter 2006-08-14 01:13:56 UTC
Created attachment 70840 [details]
Example of outlined text on a green background
Comment 3 Travis Reitter 2006-08-14 01:14:30 UTC
Created attachment 70841 [details]
Example of outlined text on a dark grey background
Comment 4 Travis Reitter 2006-08-14 01:17:18 UTC
Created attachment 70842 [details]
Example of outlined text on an image background
Comment 5 Travis Reitter 2006-08-14 01:26:37 UTC
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.
Comment 6 Behdad Esfahbod 2006-08-14 05:12:02 UTC
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.
Comment 7 Behdad Esfahbod 2006-08-14 05:13:46 UTC
And then we can add a generic filter API to the pangocairo layer to allow for adding arbitrary effects.
Comment 8 James Cloos 2006-08-14 09:04:37 UTC
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.

Comment 9 Travis Reitter 2006-08-14 15:45:29 UTC
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.
Comment 10 James Cloos 2006-08-16 06:49:42 UTC
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.)
Comment 11 Behdad Esfahbod 2009-01-04 02:17:07 UTC
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()".