Issue 111547 - Subpixel positioning for better font rendering in WYSIWYG mode
Summary: Subpixel positioning for better font rendering in WYSIWYG mode
Status: ACCEPTED
Alias: None
Product: Writer
Classification: Application
Component: viewing (show other issues)
Version: OOo 3.2
Hardware: Unknown All
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on: 108684
Blocks:
  Show dependency tree
 
Reported: 2010-05-12 04:28 UTC by loonyphoenix
Modified: 2017-05-20 11:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description loonyphoenix 2010-05-12 04:28:40 UTC
I have recently come across a great article about font rasterization:
http://www.antigrain.com/research/font_rasterization/

And I'm wondering why OpenOffice.org doesn't use that algorithm to display fonts 
in the Print Layout mode. Currently, Openoffice seems to use variable distance 
between characters to fit the pixel grid, which doesn't look good:
http://habreffect.ru/files/252/7943c2ed9/openoffice-fonts.png

Instead, horizontal hinting and pixel alignment could be disabled altogether, 
utilizing subpixel rendering to achieve three times the screen resolution in 
that direction. The article goes into great depths as to why a small resulting 
fuzziness is a small price to pay for all the benefits it could bring.

I'm going to provide several examples on what this would mean for those who are 
unwilling to read the lengthy article (though I highly recommend it).

Smooth scaling:
http://www.antigrain.com/research/font_rasterization/text_ft_antigrain.png
Legible small fonts:
http://www.antigrain.com/research/font_rasterization/sample_arial_01.png
Exact positioning (smooth font shift by 3 pixels in 30 steps):
http://www.antigrain.com/research/font_rasterization/sample_arial_1tenth_shift.p
ng
Fancy effects without bluriness:
http://www.antigrain.com/research/font_rasterization/truetype_ft_lcd_bold1.png
http://www.antigrain.com/research/font_rasterization/sample_georgia_03_distorted
.png

I think that is pretty impressive. And it is possible with modern technology; a 
sample program, written three years ago, which demonstrates the abilities of the 
algorithm, is located here:
http://www.antigrain.com/research/font_rasterization/truetype_test_02_ft.zip

It's a Windows application, but it can be compiled for Linux, too. And it runs 
fine in Wine.

So, once again, what benefits this algorithm would provide:

"1. You can kern symbols with sub-pixel precision, not worrying about 
introducing extra blurriness.
2. You can freely scale the text as you want, with 100% guarantee of preserving 
a stable text layout that always fits other graphic elements.
3. You can always be sure that the calculated text width exactly corresponds 
with what you will see on screen and paper.
4. You can apply fancy vector effects such as "faux bold" and "faux italic" 
being sure the text will not look any blurrier."

What needs to be done to achieve that:

"1. Use horizontal RGB sub-pixel anti-aliasing for LCD flat panels.
2. Use vertical hinting only and completely discard the horizontal one.
3. Use accurate glyph advance values, calculated at a high resolution for 
unhinted glyphs.
4. Use accurate, high resolution values from the kerning table."

I have asked in the freetype mailing list, and it seems that all the building 
blocks needed for this to work have been around long ago, it's just that toolkit 
or end-user application uses it yet:
http://lists.nongnu.org/archive/html/freetype/2010-05/msg00003.html

Thanks for your attention.
Comment 1 hdu@apache.org 2010-05-12 08:02:02 UTC
Subpixel positioning and display are good ideas indeed. The way WriterEngine and EditEngine think about 
this somewhat hinders that, aka issue 108684.
Comment 2 hdu@apache.org 2010-05-12 08:02:44 UTC
.
Comment 3 Marcus 2017-05-20 11:33:21 UTC
Reset assigne to the default "issues@openoffice.apache.org".