RESOLVED Q2 - Surface-Font trouble

General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.
Post Reply
D.Bane
Posts: 78
Joined: Thu Jul 29, 2010 2:51 pm

RESOLVED Q2 - Surface-Font trouble

Post by D.Bane »

Hi, again :)

I got used to the surface and watching the code. I can not even believe that I would prefer it over the GUI. The only problem for now that I have is the Font object and surface...

In the splash class I wanted to use surface.WriteTextf(), surface.CenterTextf(), I even tried printf() just to make sure it does not work... The reason I wanted to use them is that I wanted to make the First letter be capital letter, but bigger then the rest of the letters. So instead of "ECERE" you get something more resembling "Ecere".

For example, I know how to change the color of the font, but I would like to know how can I make some part of the text that is written on the form bold, and some of different size.

When I tried to change the font of the Form1 form1{} I got all the text bold, or all of the text changed in size.

Is there a way to influence the font just like surface.SetForeground(color)..so something like setFontButNotForAll() which would change the font used to write on the surface, but it will not change the main font of the Window class. In short, to work just like the surface.SetForeground(color);

Thank you and best regards,
D.Bane.
Last edited by D.Bane on Wed Feb 08, 2012 8:22 am, edited 1 time in total.
No army is to big, if the heart is beating strong.
There's no bad luck, it's just easier to blame someone else.
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Q2 - Surface-Font trouble

Post by jerome »

You will find the answer to this in the original Splash screen thread.
It is the distinction between FontResource and the Surface's drawing Font object.
It is possible to use other FontResource than the window's default font.
D.Bane
Posts: 78
Joined: Thu Jul 29, 2010 2:51 pm

Re: Q2 - Surface-Font trouble

Post by D.Bane »

Hi,

Yes, I took a look at your response to the splash control and I like the Fonts part as well as other insights into the Ecere.

Thank you.
D.Bane.
No army is to big, if the heart is beating strong.
There's no bad luck, it's just easier to blame someone else.
Post Reply