On OSX, white text is outlined in black

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

On OSX, white text is outlined in black

Frédéric
Hi,
I write a white text on a coloured background. On GTK and MSW, it
works well. On OSX, the white text has its contour drawn in black so
that if the text is small, it is unreadable (see attached picture).

I draw on a wxWindow using the default font that I just turn bold. How
can I really get a white text without any black contour?

Kind regards,

F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

font_outline.png (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Stefan Csomor
Hi

    I write a white text on a coloured background. On GTK and MSW, it
    works well. On OSX, the white text has its contour drawn in black so
    that if the text is small, it is unreadable (see attached picture).
   
    I draw on a wxWindow using the default font that I just turn bold. How
    can I really get a white text without any black contour?
   
it could be we run into emulated bold if there's no exact bold font, where I increase the size of the outline, could you please post your code ?

Thanks,

Stefan
 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Frédéric
> it could be we run into emulated bold if there's no exact bold font, where I increase the size of the outline, could you please post your code ?

You are right, I am using the default font of wxWindow + Bold:
SetFont(GetFont().Bold())

So it means we need to account for the foreground colour.

F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Frédéric
> You are right, I am using the default font of wxWindow + Bold:
> SetFont(GetFont().Bold())
>
> So it means we need to account for the foreground colour.

I forgot to say that I also to that:
SetBackgroundColour(*wxWHITE);

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Frédéric
> > You are right, I am using the default font of wxWindow + Bold:
> > SetFont(GetFont().Bold())
> >
> > So it means we need to account for the foreground colour.
>
> I forgot to say that I also to that:
> SetBackgroundColour(*wxWHITE);

Any idea how to have the bold font outline of the same colour as the text?

Kind regards,

F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Stefan Csomor
Hi

    > > You are right, I am using the default font of wxWindow + Bold:
    > > SetFont(GetFont().Bold())
    > >
    > > So it means we need to account for the foreground colour.
    >
    > I forgot to say that I also to that:
    > SetBackgroundColour(*wxWHITE);
   
I cannot reproduce the problem you are having with the standard system font, as there is a real bold version. If I create a font however that doesn't have a bold version,

    wxFont geneva(36,wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD,false, "Geneva");
    SetFont(geneva);

 then I can reproduce it. The problem is the fact that only the fill color can be taken from the context, but not the stroke color, I'll have to change that in a fallback way, because the implementation that also sets the strokecolor will be slower.

Best,

Stefan

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Frédéric
> I cannot reproduce the problem you are having with the standard system font, as there is a real bold version. If I create a font however that doesn't have a bold version,
>
>     wxFont geneva(36,wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD,false, "Geneva");
>     SetFont(geneva);
>
>  then I can reproduce it. The problem is the fact that only the fill color can be taken from the context, but not the stroke color, I'll have to change that in a fallback way, because the implementation that also sets the strokecolor will be slower.


How do you actually emulate bold? That seems awfully difficult?
It seems rather strange that my standard font has no bold...
Cheers,
F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Stefan Csomor
    How do you actually emulate bold? That seems awfully difficult?
    It seems rather strange that my standard font has no bold...

You increase the width of the stroke of the glyph, that's the recommended way of doing it. You could eg try with Helvetica, that one for sure has a bold variant.

Best,

Stefan

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Stefan Csomor
Hi Frédéric

could you please retest with current master ?

Thanks,

Stefan

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Frédéric
> could you please retest with current master ?

I will, thanks.

Frédéric

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: On OSX, white text is outlined in black

Frédéric
In reply to this post by Stefan Csomor
> could you please retest with current master ?

It's perfect like that. The font looks bold with the right color
(white in my case).
Thanks a lot!
F

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users