Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#26 Choosing different fonts

closed
Davis
5
2007-12-30
2007-11-20
Nils Labugt
No

I have created a new font class, derived from dlib::font, but the widgets do not appear to support fonts other than the default font. For example, dlib::label has a set_color method and a set_text method, but no set_font method.

The font class is a bitmap font with a parser for the BDF file format. There are BDF files available under permissive licenses for different typefaces and font sizes, as well as different non Latin alphabets (Unicode).

I don't really know C++ well enough to contribute to a library like this, but if there is interest then will try to weed out some embarrassments, clean up the code and submit a patch. (I had to make a couple of adjustments to the font base class as well in order to enable Unicode support.)

Discussion

  • Davis
    Davis
    2007-11-20

    Logged In: YES
    user_id=1166290
    Originator: NO

    That is awesome. I have been wanting to have more than one font for a long time now so definitely submit a patch. Just make sure it is commented enough that I can understand what you are doing (and maybe supply an example program if you think that would be useful) and I will merge in the changes.

    Cheers,
    Davis

     
  • Davis
    Davis
    2007-11-20

    • assigned_to: nobody --> davisking
     
  • Davis
    Davis
    2007-12-30

    Logged In: YES
    user_id=1166290
    Originator: NO

    I just added a set_main_font() function to the widgets and checked it into subversion. So now you can use any font object you like with the widgets, including the new bdf font loader you provided. Let me know if you find any issues.

    Cheers,
    Davis

     
  • Davis
    Davis
    2007-12-30

    • labels: --> Extension to Component
    • status: open --> closed