[gtkada] Font on Win32 cant load MS Sans Serif 8
Mark Gawler
markg at wler.co.uk
Fri Nov 26 20:04:44 CET 2004
> Mark Gawler schrieb:
>
>>I've written a small GtkAda Application, which works fine under Linux,
>> but
>>moving to a Windows NT platform the application runs but continually
>>streams out:
>>"Couldn't load font "MS Sans Serif 8" falling back to Sans 8"
>>
>>
>
> I've read Gtk+ on Windows wants TrueType Fonts. The following solves
the
> problem for me on Win98. For Windows 2000 and XP it is not needed.
>
>
> Use a resource file. In your code do something like this:
> Gtk.Main.Init;
> Gtk.Rc.Parse ("your_program_name.rc");
> ...
>
> And create your_program_name.rc for Windows like this:
>
> # Text style
> style "text"
> {
> font_name = "arial"
> text[NORMAL] = { 0.0, 0.0, 0.0 } # black
> fg[NORMAL] = { 0.0, 0.0, 0.0 } # black
> base[NORMAL] = { 1.0, 1.0, 1.0 } # white : background color
> }
>
> # All widgets will have the "text" style
> widget "*" style "text"
>
> --
> Michael Bode
Thanks,
I'd almost got ti working with this resource file, but a few occurances
were still leaking through. Your resorce file fixes it completely :)
# Default style
style "default"
{
font_name = "Sans"
}
class "GtkWidget" style "default"
More information about the gtkada
mailing list