nanogui: Thread: Kaffe port issues


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Kaffe port issues
From: "Roman Guseynov" ####@####.####
Date: 14 Jul 2000 14:58:44 -0000
Message-Id: <OF58216716.7574960F-ON4225691B.0032F49B@cms.vinnica.ua>

Hi Greg,
     I've compiled Microwin-88pre11 and really happy about changes you've
made! Thanx for good work.

I have just another set of issues to discuss.

1. Function GetTextExtentExPoint() is extremely needed to make fonts (TTFs)
rendering. I've implemented some substitutions for now but they are too
"straightforward" and diffuse coded. So I think there must be a real
implementation and it should be fundamentally reworked. Is this function
implementation expexcted in 88 release?

2. To make Kaffe rendering gifs and jpegs with transparency there should be
BitBlt() with SRCAND, SRCINVERT ROPs support. Again, I've hacked it out and
it working for 16bpp (fblin16.c) and X11 screen only (scr_x11.c). Also,
PatBlt() (at least with BLACKNESS) needed. I've inserted its implementation
it BitBlt() temporarily. But it is not correct and should be reworked. Does
it expected to be these funcs in 88 release? The same is about StretchBlt()
but I have no any versions of it now so it should be done from scratch.

3. Kaffe does not draw filled rects properly without this checking inserted
at the beginning of GdFillRect() function:
     if ((width<=0)||(height<=0)) return;

4. Is it difficult to support antialiased TTFs in MWin's Win32 API? I've
added such a support but I think it will not work in any circumstances. Or
it will be supported in new release? Maybe it will be good to turn on
antialiasing only when font's requested size is greater than defined value.

5. "Bold" and "Italic" styles for TTFs are also extremely desirable. I've
implemented them in CreateFontIndirect() by just selecting another font
file. I hope you'll include styles support in release.

6. There are some problems with TTF fonts aligning in MWin. I've made some
changes and it works now for Kaffe but I don't sure about it is right in
general:

devfont.c: GdConvertEncoding():

     /* ORIGINAL BEGIN
               cc = utf8_to_utf16((unsigned char *)istr, cc,
                    oflags==MWTF_UC16? ostr: buf16);
     ORIGINAL END */
     // UNDER_KAFFE BEGIN
               cc = utf8_to_utf16((unsigned char *)istr, cc,
                    oflags==MWTF_UC16?(unsigned short*) ostr: buf16);
     // UNDER_KAFFE END

devfont.c: GdGetTextSize():

     /* ORIGINAl BEGIN
          unsigned long  buf[256];
     ORIGINAl END */
     // UNDER_KAFFE BEGIN
          unsigned short buf[256];
     // UNDER_KAFFE END

devfont.c: freetype_gettextsize():

     /* ORIGINAL BEGIN
               if (TT_Load_Glyph (pf->instance, pf->glyph, curchar,
                    TTLOAD_DEFAULT) != TT_Err_Ok)
                         continue;
     ORIGINAL END */
     // UNDER_KAFFE BEGIN
               if (TT_Load_Glyph (pf->instance, pf->glyph, curchar,
                    TTLOAD_SCALE_GLYPH|TTLOAD_HINT_GLYPH) != TT_Err_Ok)
                         continue;
     // UNDER_KAFFE END

winfont.c: GetTextMetrics():

          /* FIXME many items are guessed for the time being*/
          lptm->tmHeight = fi.height;
     /* ORIGINAL BEGIN
          lptm->tmAscent = fi.height - fi.baseline;
          lptm->tmDescent= fi.baseline;
     ORIGINAL END */
     /* UNDER_KAFFE BEGIN */
          lptm->tmDescent = fi.height - fi.baseline;
          lptm->tmAscent= fi.baseline;
     /* UNDER_KAFFE END */

wingdi.c: MwExtTextOut():

          /* this whole text alignment thing needs rewriting*/
          if((hdc->textalign & TA_BASELINE) == TA_BASELINE) {
     /* ORIGINAL BEGIN
               // this is not right...
               flags |= MWTF_TOP;
     ORIGINAL END */
     // UNDER_KAFFE BEGIN
               flags |= MWTF_BASELINE;
     // UNDER_KAFFE END

7. Another problem I found is about white text rendering. I cannot force
MWin to render white text i.e. when I try SetTextColor(hdc,
RGB(255,255,255)) and then TextOut(hdc,...) it is not text rendering at
all! Howewer RGB(255,250,255) works perfectly. I have no ideas why it is so
and how to solve it now. Any suggestions?

Thanx for assistance,

Regards,
- Roman

Subject: Re: Kaffe port issues
From: "Greg Haerr" ####@####.####
Date: 17 Jul 2000 04:48:50 -0000
Message-Id: <035301bfefaa$46131e00$15320cd0@gregh>

: 1. Function GetTextExtentExPoint() is extremely needed to make fonts (TTFs)
: rendering. I've implemented some substitutions for now but they are too
: "straightforward" and diffuse coded. So I think there must be a real
: implementation and it should be fundamentally reworked. Is this function
: implementation expexcted in 88 release?

Roman,
    I will try to write this function before the 0.88 final.  Can you 
please send me some source code that you are using for this
function?  Some parms are optional, and I want to see what
you are passing, particularly if some parameters are NULL.




: 
: 2. To make Kaffe rendering gifs and jpegs with transparency there should be
: BitBlt() with SRCAND, SRCINVERT ROPs support. Again, I've hacked it out and
: it working for 16bpp (fblin16.c) and X11 screen only (scr_x11.c). Also,
: PatBlt() (at least with BLACKNESS) needed. I've inserted its implementation
: it BitBlt() temporarily. But it is not correct and should be reworked. Does
: it expected to be these funcs in 88 release? The same is about StretchBlt()
: but I have no any versions of it now so it should be done from scratch.

You might send me what you've done.  I might be able to write
a quick emulation layer above the screen driver, but it will be too
slow, I believe.  Send me your code for the time being, and I'll
look at it.

For PatBlt, I might be able to build something that will work
for 0.88.  Can you please send the Kaffe code that calls it?
Does it only use BLACKNESS?  Please send me your code
that makes it work for the time being.

As for StretchBlt, I know we need it, but it will not make it
into 0.88.




: 
: 3. Kaffe does not draw filled rects properly without this checking inserted
: at the beginning of GdFillRect() function:
:      if ((width<=0)||(height<=0)) return;

I'll add this.



: 
: 4. Is it difficult to support antialiased TTFs in MWin's Win32 API? I've
: added such a support but I think it will not work in any circumstances. Or
: it will be supported in new release? Maybe it will be good to turn on
: antialiasing only when font's requested size is greater than defined value.

No, this should work, but the problem is that the engine/devfont.c
code used to look at the foreground/background colors rather
than actually using an antialias blit direct to the screen.  I think
I commented out the devfont.c code because of other problems.
We can make this work, but probably not in 0.88.



: 
: 5. "Bold" and "Italic" styles for TTFs are also extremely desirable. I've
: implemented them in CreateFontIndirect() by just selecting another font
: file. I hope you'll include styles support in release.

Yes, I'd like to, but I'll probably push the fontmapper to another
release.  If you want to send me what you've got, I could include
it in 0.88 however.



: 
: 6. There are some problems with TTF fonts aligning in MWin. I've made some
: changes and it works now for Kaffe but I don't sure about it is right in
: general:

I need to study this, I will respond shortly.


: 
: 7. Another problem I found is about white text rendering. I cannot force
: MWin to render white text i.e. when I try SetTextColor(hdc,
: RGB(255,255,255)) and then TextOut(hdc,...) it is not text rendering at
: all! Howewer RGB(255,250,255) works perfectly. I have no ideas why it is so
: and how to solve it now. Any suggestions?

That is very strange.  Do you have a quick sample program to demonstrate
this, or does it just fail under Kaffe?  I will look into this also.

Thanks for all your porting efforts, you're doing a great job!  Sorry I've
been a bit slow responding lately, there's just been so much going on,
especially with the new ViewML browser release and all....

Regards,

Greg



[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.