GP2X Sub-pixel Font Rendering


Been done before, but on the GBA it was used to allow very large text displays.

It could probably work well for the GP2X but I think the current console does well at 320x240 ish.

Unless someone wants a 80+ column 40+ row display?
 
kingconga42 posted on Mar 1 2006 at 10:43 PM said:
i saw this on metafilter, and thought it might be of interest to gp2x developers-
http://grc.com/ctwhat.htm
I hacked SDL_ttf a few months back to render sub-pixel anti-aliased fonts.
While doing so breaking bold and italic styles and all the blended font methods, so it's not really usable for anything but text on one-color backgrounds. :)

I'm working an a text reader (plain text, no fancy html or rtf) to replace the monster that comes with the gp2x. Rendering is identical to that of Xorg+freetype. Really is a joy to read.
Here's what it looks like, compared to gamepark's doing:
 
Last edited by a moderator:
eWoud posted on Mar 2 2006 at 02:30 AM said:
kingconga42 posted on Mar 1 2006 at 10:43 PM said:
i saw this on metafilter, and thought it might be of interest to gp2x developers-
http://grc.com/ctwhat.htm
I hacked SDL_ttf a few months back to render sub-pixel anti-aliased fonts.
While doing so breaking bold and italic styles and all the blended font methods, so it's not really usable for anything but text on one-color backgrounds. :)

I'm working an a text reader (plain text, no fancy html or rtf) to replace the monster that comes with the gp2x. Rendering is identical to that of Xorg+freetype. Really is a joy to read.
Here's what it looks like, compared to gamepark's doing:

Nice. :blink:
 
Last edited by a moderator:
eWoud posted on Mar 2 2006 at 01:30 AM said:
kingconga42 posted on Mar 1 2006 at 10:43 PM said:
i saw this on metafilter, and thought it might be of interest to gp2x developers-
http://grc.com/ctwhat.htm
I hacked SDL_ttf a few months back to render sub-pixel anti-aliased fonts.
While doing so breaking bold and italic styles and all the blended font methods, so it's not really usable for anything but text on one-color backgrounds. :)

I'm working an a text reader (plain text, no fancy html or rtf) to replace the monster that comes with the gp2x. Rendering is identical to that of Xorg+freetype. Really is a joy to read.
Here's what it looks like, compared to gamepark's doing:

Is there a text reader for the gp32 that uses sub pixel rendering? I've been thinkng about putting some books on my gp32.

CHRIS
 
Last edited by a moderator:
christo930 posted on Mar 2 2006 at 04:16 AM said:
eWoud posted on Mar 2 2006 at 01:30 AM said:
kingconga42 posted on Mar 1 2006 at 10:43 PM said:
i saw this on metafilter, and thought it might be of interest to gp2x developers-
http://grc.com/ctwhat.htm
I hacked SDL_ttf a few months back to render sub-pixel anti-aliased fonts.
While doing so breaking bold and italic styles and all the blended font methods, so it's not really usable for anything but text on one-color backgrounds. :)

I'm working an a text reader (plain text, no fancy html or rtf) to replace the monster that comes with the gp2x. Rendering is identical to that of Xorg+freetype. Really is a joy to read.
Here's what it looks like, compared to gamepark's doing:

Is there a text reader for the gp32 that uses sub pixel rendering? I've been thinkng about putting some books on my gp32.

CHRIS
The text reader for the gp32 is very very nice.
 
Last edited by a moderator:
so it's not really usable for anything but text on one-color backgrounds.

horizontal text on one color backgrounds only, if i understand correctly...

yeah, a better text reader would be great too... wasnt there a pdf reader in the works somewhere?
 
kingconga42 posted on Mar 2 2006 at 06:09 AM said:
so it's not really usable for anything but text on one-color backgrounds.

horizontal text on one color backgrounds only, if i understand correctly...

yeah, a better text reader would be great too... wasnt there a pdf reader in the works somewhere?


Yeah it uses the RGB triplet of an LCD to simulate higher resolution. Since each pixel is made of 3 vertical bars you can make finer lines by just choosing the color of the pixel. For a *simple* example normally it would be impossible to make the letters "x" or "y" with only 3 pixels but using this method you can do it. This is why it only works horizontal, and only for text and you are limited in color choices.

By knowing what colors light what triplets and the intensity of the triplets you can do more complex anti-aliasing of fonts by manipulating these.


subpix.png
 
Last edited by a moderator:
The site given by the OP (http://www.grc.com/cleartype.htm) explains things really well. (I read it a few months back already, when I was messing with this on my ipaq). Everyone interested in this subject should read it and try the demo.



Personally, I prefer an old fashioned 4x6 font with 'sharp' edges over a blurry sub-pixel rendered one of roughly the same size. At 320x240 resolution a 4x6 font still gives you 80x40 characters and you can use all the colours. Things look a little funny as you don't have room for ascending and descending parts of letters, but it's readable.



Of course, for larger characters, smoothing the edges this way does look nice, and works well as you have some 'body' to the letters to hide the colour fringes without getting too blurry.


P.

Ceterum censeo davec's post with picture is superfluous; it doesn't add anything to the original post's link. It's not a simple example, but an oversimplified one. His 'x' would just look like a purple green purple vertical line; it doesn't take the proportion of the pixels and the overall color in to account.
 
DaveC posted on Mar 2 2006 at 08:08 AM said:
kingconga42 posted on Mar 2 2006 at 06:09 AM said:
so it's not really usable for anything but text on one-color backgrounds.

horizontal text on one color backgrounds only, if i understand correctly...

yeah, a better text reader would be great too... wasnt there a pdf reader in the works somewhere?


Yeah it uses the RGB triplet of an LCD to simulate higher resolution. Since each pixel is made of 3 vertical bars you can make finer lines by just choosing the color of the pixel. For a *simple* example normally it would be impossible to make the letters "x" or "y" with only 3 pixels but using this method you can do it. This is why it only works horizontal, and only for text and you are limited in color choices.

By knowing what colors light what triplets and the intensity of the triplets you can do more complex anti-aliasing of fonts by manipulating these.


subpix.png


you really think, somebody could read a 3 pixel letter? ...
 
Last edited by a moderator:
A 3x1 pixel letter at that.

To be honest I prefer anti-aliasing to sub-pixel rendering (on a laptop screen, at least). Sub-pixel just looks muddy and sometimes messes up (the K in Courier New for example).
 
kingconga42 posted on Mar 2 2006 at 08:09 AM said:
so it's not really usable for anything but text on one-color backgrounds.
horizontal text on one color backgrounds only, if i understand correctly...
Freetype does have a vertical render mode for LCDs (FT_RENDER_MODE_LCD_V), but SDL_ttf doesn't support anything vertical. Hacking sub-pixel rendering into every part would take a lot of work.
kingconga42 posted on Mar 2 2006 at 08:09 AM said:
yeah, a better text reader would be great too... wasnt there a pdf reader in the works somewhere?
Ask theoddbot, he was working on a poppler-based pdf reader.

IMHO pdf is complete overkill for ebooks, and 320x240 really is too small for that.
Having rtf and html support would be nice though. I might add them later on (or contact !reader's author).
 
Last edited by a moderator:
taras posted on Mar 2 2006 at 02:02 PM said:
A 3x1 pixel letter at that.

To be honest I prefer anti-aliasing to sub-pixel rendering (on a laptop screen, at least). Sub-pixel just looks muddy and sometimes messes up (the K in Courier New for example).

You can have both and really AA should be always included for rendering vector fonts.

That was me who was experimenting with it. I have done two algos and they were general - could be used to scale everything including any bitmaps. Results weren't too hot thought. Mostly it is usefull for fonts smoothing but it's has potential for subpixel horizontal scrolling. But it is an academic debate because even it doesn't reallly improve animation by enough amount to be able to say it's better. But processing cost aren't exactly small so just as I said - it was an interesting experiment but nothing more.

I should make the sources (actually it was Python code) available. Have to clean up the program and add some kind of console interface first. Could done it ages ago if not my laziness . :rolleyes:

For text console 6x8 font will allow 53 columns of text for gp2x. The 5x8 will give you 64 columns of text and will be still readable. Eventually just preprocess the images of these fonts with subpixel rendering. So plain bitmaps for text display will do just fine. For me 53 columns for text writing/editing in Vim would be fine.
 
Last edited by a moderator:
synkro posted on Mar 2 2006 at 10:00 AM said:
you really think, somebody could read a 3 pixel letter? ...

No, it was just an example, not saying anyone should actually do that ;)
 
Last edited by a moderator:
On a related matter... does anyone know what the text says under the GP2X logo on the green (1.0.1) boot screen? It looks like Something something US something.....
 
taras posted on Mar 2 2006 at 10:11 AM said:
On a related matter... does anyone know what the text says under the GP2X logo on the green (1.0.1) boot screen? It looks like Something something US something.....

it's just a little ad that says what it can do..." play divx movies, mame, etc" or something...i know i posted the exact text somewhere. if you go to the gp2x.com you can zoom in on the flash image, i'm guessing its roughly the same text. just for decoration anyway.

radek: wouldn't trying to use sub-pixels when rendering bitmaps create big color distortions? even on b&w text, the intended target for sub-pixel rendering (because all in all the extra "colored" sub-pixels balance each other out), the color distortion bothers me a little. but that's just me. either way it seems like using it on bitmaps would lead to a weird sort of color distortion at the edges of things. or did your algorithm take that into account (by, say, not using it when an edge happens between similar colors)?

just curious. sorry if that doesn't make any sense.
 
Last edited by a moderator:
rokdcasbah posted on Mar 2 2006 at 05:00 PM said:
radek: wouldn't trying to use sub-pixels when rendering bitmaps create big color distortions?
radek seems to mean he'll pre-render the characters of a fixed-width font. As long as you don't move them by 'sub-pixel' amounts or try to use differnt fg/bg colors than pre-rendered for, this should work fine.

Look at the explanation on http://www.grc.com/ctwhat.htm
Scroll down to the two example images (search string: "Standard Whole-Pixel Windows TrueType rendering"). now imagine making a ransom note by cutting out letters of the lower image (instead of out of a newspaper)... That's basically what he's proposing.

P.
 
Last edited by a moderator:
Back
Top