[Mono-list] How to use Gdk.FontSelection???

Francisco M. Marzoa fmmarzoa at gmx.net
Tue Nov 23 17:55:45 EST 2010


Hi again,

I've realized that FontName contains everything in one string: the font
family, the slant, the weight and the size. I tried to write a regular
expresions to extract all the values, although I've had no success.

The scheme is as follows (for example):

Sans Bold Italic 10

The main problem to solve this with one regular expression is that both
Bold and Italic may not be there, so you can get "Sans Bold 10" or "Sans
Italic 10" or just "Sans 10", and I've not clear if there's a way to
tell within a regular expression that a whole word -not just a char- is
optional (like {0,1} for chars).

Of course I can solve it another way, using some regular expresions or
String class substring related functions, but doing it with just one
regular expressions looks more geek, isn't it? ;-)

Best regards,


El 22/11/10 20:52, Francisco M. Marzoa escribió:
> Hello,
>
> I'm trying to use an object Gdk.FontSelection -not dialog- on my
> application. I create it within a frame and it looks fine, the problem
> is that I do not know how to set/get the selected font, the font size,
> etc. from code.
>
> I've tried something as simple as:
>
> Gtk.FontSelection fs = new Gtk.FontSelection();
> ...
> fs.FontName = "Arial"
>
> But "Arial" font is not selected. I've also try with:
>
> fs.SetFontName ("Arial");
>
> With same results.
>
> Anyway on Mono documentation there are only two writable properties and
> one public method on Gtk.FontSelection, that does not fullfill the
> requeriments of getting/setting font family, font slang, font weight and
> font size.
>
> ???
>
> Thanks a lot in advance,
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>   



More information about the Mono-list mailing list