>
> > I have a question of how to set my custom font, for example, I have a font
> > named MY_FONT, then how can I use this font type to display the text in
> > Browser widget?
> > =
>
> > I see it has a fl_font API, but the first parameter is a int type, so I
> > don't know how to set my font for Browser widget.
> > =
>
> > Can anyone give me a sample code? Thanks.
>
>
> You are just trying to load a font "by name" from the OS and then use it in=
>  your own code?
>
> Then the easiest thing is probably to use Fl::set_font(...) to load the new=
>  face into a fltk font indea then use that index.
>
> Example, suppose you decide to replace the FL_SYMBOL font with your own fon=
> t face, you could do...
>
>
>    Fl::set_font(FL_SYMBOL, " MY_FONT");
>
> and then later assign that font to the text you are drawing inside a draw()=
>  method with...
>
>    fl_font(FL_SYMBOL, size);
>
> or assign that font to a widget with...
>
>    my_widget->lablefont(FL_SYMBOL);
>
> etc...
>
>
>
>
> SELEX Galileo Ltd
> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS=
> 14 3EL
> A company registered in England & Wales.  Company no. 02426132
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>

Ian,
Thanks. Now I can use my custom font in my browser widget, thanks.

Best regards,
Leo

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to