Experimental Font-accelerated PPC Version

mikelove

皇帝
Staff member
Just posted here:

http://www.pleco.com/beta/pd2b1-ppcaccel2.zip

Haven't done every optimization at our disposal yet, but this version should be quite a lot faster thanks to the fact that we're now caching font characters in memory rather than manually reloading them from the font file every time they're drawn. Rendering can be a little funky, though, larger characters aren't anti-aliased even when smaller ones are and some characters are vertically displaced in a more significant way than they were before, but if you find the performance in the current version makes it completely unusable the speed increase might make up for the slightly wacky display (which will of course be corrected soon).
 

mikelove

皇帝
Staff member
Second version of this posted at:

http://www.pleco.com/beta/pd2b1-ppcaccel2.zip

This cleans up pretty much all of the graphical glitches in font rendering that we know about (including the dreaded vertical lines), and also switches to what we think is a significantly better looking anti-aliasing algorithm (a bit more like that in Mac OS X) which looks great on regular-resolution screens and absolutely gorgeous on VGA ones. And keeps the previous speed improvements while adding a few more.
 

ldolse

状元
The second version runs much better, the beta is getting closer to being usable. It's still slower than 1.0 on my system, but not by so much now. One thing I noticed is that in many scenarios it paints the screen twice, I think this is adding to the perception of slowness. This was easier to see with the older versions, with the new version you have to find a pretty long definition to notice it.

The aliasing for larger characters, like magnified headwords is really fuzzy. The Roman alphabet (definition text, not pinyin) is pretty fuzzy as well, and with the current aliasing it seems physically larger and generally stands out more than the chinese text that's in the definition. The chinese text should at a minimum have the same weight as the roman text, and I wouldn't mind it being slightly larger. In general I find the aliasing that Windows Mobile was doing with Cleartype to be really nice - I'd like to see 2.0 getting closer to that if possible.

The space between the edge of the screen and the definition text is a bit disconcerting. There basically isn't any, I think in general there is a single pixel of whitespace, but in many cases the character will run right into the edge of the screen. The opposite side of the definition view next to the list divider provides plenty of whitespace, though it's pretty variable how much - it would probably be ok to shave a pixel or two off on that side to make room opposite.

Last nit isn't font rendering exactly, but word breaks. The ABC definitions will list synonyms with slashes sometimes, which creates very large strings with no space to break on, so it breaks in the middle of the word. For example see 爱不上 - this definition has the text 'irrelevant/extraneous'. If you expand the list view you'll see the break problem. I think the solution here is just to break on the '/' character. There are better examples (i.e. longer strings) in the dict, but I couldn't find one as I was writing this.
 

mikelove

皇帝
Staff member
Thanks for the detailed feedback. We're not seeing this double-drawing here... can you think of a specific operation that causes the definition to be drawn twice? Are you sure it's not just flicker from the old definition being cleared?

On the subject of anti-aliasing, at some point we're going to add a preference to let you toggle between all 4 of FreeType's anti-aliasing options: none, Windows-like grayscale (as used in Beta 1), Mac-like grayscale (as used in this experimental version), and ClearType-like subpixel rendering. The subpixel renderer is a bit tricky to get right and might also cause an additional performance hit so we're taking some extra time with that, but it's definitely supported by FreeType so it's certainly something we should be able to do.

Good point about word breaks, it would be trivially easy to add slashes to the list of punctuation that lines should be broken on (and we probably should have done so a long time ago). And good point also about whitespace; since the text field renderer was originally designed on Palm, which adds an extra pixel or two of blank space to the left of every screen (or did pre-Centro anyway), we hadn't really factored in how it goes right up to the edge on Windows Mobile.
 

ldolse

状元
I should rephrase on the double drawing - it's not the whole screen that gets repainted, it's the definition text. I think it might be related to line breaking, in some cases the second time it paints I seem to recall the definition the breaking is slightly different, though that doesn't always seem to be the case.

It's really easy to see in most entries on the older builds, the latest one requires a long entry to easily see it. I recall 坐 in the ABC dictionary had a nice long definition text that made it pretty easy to see.

Using an HTC Hermes running AKU2 code.
 

daniu

榜眼
Hi!

Tested this new version yesterday. Yeah ... much better. We are getting pretty close to a BETA ...

However I also can reproduce the redrawing on my Dell Axim X51V:

Open Pleco2 - Setting is Ying wen - OX - on the right side I got the list with A, blablabla aback, abacus, abandon, abashed. Switching to "abandon" from whatever shows the effect. My PDA is set to Power safe through CPU-speed - just in case that does have any effect on the possibility to see the bug. The horizontal line between the list and the definition is so that the right frame ends exactly under the left corner of the arrow pointing downward symbol (the one that does not work yet - at least on my Pleco ...)

AH ... just after writing that I played a bit with this dividing line and found out that actually ... the effect only shows up if there is a scroll bar in the left frame ...

Great work though
Daniel
 

sfrrr

状元
mikelove said:
Second version of this posted at:

http://www.pleco.com/beta/pd2b1-ppcaccel2.zip

This cleans up pretty much all of the graphical glitches in font rendering that we know about (including the dreaded vertical lines), and also switches to what we think is a significantly better looking anti-aliasing algorithm (a bit more like that in Mac OS X) which looks great on regular-resolution screens and absolutely gorgeous on VGA ones. And keeps the previous speed improvements while adding a few more.

And why am I getting a 401 error when I try to download the ppcaccel version??

I've been trying to get my hands on it for the past 3?4? days and have received only 401 errors, not files.

Sandra
 

mikelove

皇帝
Staff member
Any chance you might be using the old link? ppcaccel.zip was disabled once I uploaded ppcaccel2.zip, so make sure you're downloading that one.
 
I get this error:

Not Found
The requested URL /beta/pd2b1-ppcaccel2.zip was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


I clicked the correct link (both of the links are the same in the first two posts) and put in the correct login info.
 
So after looking at the file name, pd2b1, I assume the beta 2 download included the optimizations already and that this file was taken down because beta 2 is available. Let me know if that is correct. Thanks!
 
Well I installed the beta 2 and there is still lots of font tearing like beta 1. Pleco 1 is very smooth.

I wonder if the beta2 actually included this new code... any word Mike?
 

mikelove

皇帝
Staff member
Yes, the file was taken down because Beta 2 included all of the optimizations in it. courtlandre, are you sure you actually installed Beta 2? Choose About from the Help menu - what version does it say you're running? Does it make any difference if you reboot your Pocket PC? Also, go into Preferences and try changing the font anti-aliasing setting - does that improve matters any?
 
mikelove said:
Yes, the file was taken down because Beta 2 included all of the optimizations in it. courtlandre, are you sure you actually installed Beta 2? Choose About from the Help menu - what version does it say you're running? Does it make any difference if you reboot your Pocket PC? Also, go into Preferences and try changing the font anti-aliasing setting - does that improve matters any?

Yes, I am using beta 2 ;p

Which "anti-aliasing settings" are you talking about? I tried changing the win-grey to mono and it didn't speed it up. I also tried changing cleartype settings in the setting on my PPC and it did nothing.
 

mikelove

皇帝
Staff member
That's odd... how slow is it? Have you tried moving the font into main memory (if it's not there already) to see if that makes any difference? Are the fonts actually rendering slowly or are they just flickering a lot (rendering multiple times, in other words)?
 
mikelove said:
That's odd... how slow is it? Have you tried moving the font into main memory (if it's not there already) to see if that makes any difference? Are the fonts actually rendering slowly or are they just flickering a lot (rendering multiple times, in other words)?

The best explanation I can think of is this: When your computer (laptop, desktop) does not have the graphic drivers installed, screen rendering is slow when scrolling. This is what its like with 2.0.

The font is under windows/fonts, but even when using the English dictionary rendering is slow. Is it possible that pleco is trying to use another chinese font that is installed? My OS supports chinese and japanese characters, so maybe that is messing it up.

Has nobody had this same problem? I will wait for pleco beta 3 and try it then to see what happens.

Update: The font is installed in windows/fonts. However it was also on my memory card, after deleting it, pleco no longer displays chinese characters even after a reset.

Update 2: Even without the font working on plecobeta 2, everything with pleco 1.0 works fine.
 

mikelove

皇帝
Staff member
Hmm... best explanation I can think of for this is that some Pocket PC device vendors haven't done as good a job as others at implementing driver support for Microsoft's Device Independent Bitmap system, which is what we use to draw font characters. There's a very nice fast graphics library for Windows Mobile called GapiDraw which would likely get us around this problem, so we'll take a stab at reimplementing the font drawing system through that and if it works well we'll buy a license for it and include it in Beta 3. Beta 2 is still not quite as fast as I'd like it to be even on our 620 MHz Axim, so this is probably a good idea anyway.
 
Top