Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CustomFont  (Read 2314 times)

0 Members and 1 Guest are viewing this topic.

Robert42

  • Newbie
  • *
  • Posts: 31
    • View Profile
CustomFont
« on: September 17, 2011, 05:58:09 pm »
I don't know, whether this would fit to the idea of SFML.

An overlaodable CustomFont class we can use with a sf::Text object.

rough idea of usage:
Code: [Select]
class MyFont : CustomFont
{
  sf::Font fnt;

  void draw_character(UniCodeeChar char)
  {
    Texture t = fnt.GetTexture(char);

    //handle offset seomehow
   
    // draw green Circle around character
    // draw t with red color, and scalred along y axis
    // draw t with yellow Color
  }
};


To achieve in this case something like this:

(image removed)

A more usefull case for this class could be rendering Text with custom glow or smooth shadow aor any other text effects

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
CustomFont
« Reply #1 on: September 17, 2011, 06:21:18 pm »
I don't think that real-time effects on text would be easily possible in SFML, but custom bitmap fonts may be implemented in the future:
http://www.sfml-dev.org/forum/viewtopic.php?t=5334
Laurent Gomila - SFML developer

Robert42

  • Newbie
  • *
  • Posts: 31
    • View Profile
CustomFont
« Reply #2 on: September 17, 2011, 07:04:16 pm »
Quote from: "Laurent"
custom bitmap fonts may be implemented in the future:
http://www.sfml-dev.org/forum/viewtopic.php?t=5334


the custom bitmap fonts look like what I need. thx