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

Author Topic: Outlined text  (Read 38759 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Outlined text
« Reply #15 on: June 26, 2008, 12:42:31 pm »
One other option is to use fonts which are already outlined, either in the font definition file (ttf or whatever) or by using a manually generated bitmap font.

The techniques used by modern games involve shaders, as already mentioned.
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Outlined text
« Reply #16 on: June 26, 2008, 02:44:02 pm »
Ok, thanks.

workmad3

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Outlined text
« Reply #17 on: June 26, 2008, 08:29:33 pm »
Most professional games will use custom bitmap fonts designed for their UI and outlined as necessary with that :)
And if you want to generate some, then I can recommend this:
http://www.codehead.co.uk/cbfg/

workmad3

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Outlined text
« Reply #18 on: June 26, 2008, 09:14:05 pm »
Quote from: "Laurent"
To get the corners, you can still draw the string 8 times :D


I think it would still look wrong with curved characters (like S, C, etc. :))

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Outlined text
« Reply #19 on: June 26, 2008, 09:44:25 pm »
Quote from: "workmad3"
Most professional games will use custom bitmap fonts designed for their UI and outlined as necessary with that :)
And if you want to generate some, then I can recommend this:
http://www.codehead.co.uk/cbfg/


Thanks for the tip, will check it out.

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Outlined text
« Reply #20 on: June 27, 2008, 04:08:08 pm »
First: waaaaant thiiiiiis, toooooo, puleeeeeeeeeze!


Second: SFML is using Freetype2, right? So why not using what Freetype2 already provides, the Glyph Stroker?!

Note #1: I have no clue of Freetype2 myself. I stumbled about the Glyph Stroker after a short Google search because I wanted to have outlined fonts, too, and SFML was using Freetype2, so I looked there first. Never tried it myself though.

Note #2: what you call "outline fonts" is what Freetype2 calls "stroked outlines of fonts" as far as I understand that.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Outlined text
« Reply #21 on: June 27, 2008, 05:05:20 pm »
Seems like a good option. I don't know every detail about FreeType, I'll check this one. Thanks for the hint :)
Laurent Gomila - SFML developer

dewyatt

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://dewyatt.blogspot.com
Outlined text
« Reply #22 on: July 28, 2008, 08:07:18 pm »
I've used the stroker feature of FT previously and it looks great.
So I vote for that.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Outlined text
« Reply #23 on: July 29, 2008, 02:48:10 am »
No need to vote, it's on my todo-list ;)
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Outlined text
« Reply #24 on: September 12, 2008, 02:25:06 pm »
Has this been added yet or has it been dropped? I found something about it checking the road map but I didn't understand its status.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Outlined text
« Reply #25 on: September 12, 2008, 02:31:26 pm »
It has been dropped ;)
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Outlined text
« Reply #26 on: September 12, 2008, 06:54:32 pm »
I'm sad to hear that.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Outlined text
« Reply #27 on: September 12, 2008, 06:58:47 pm »
Well, SFML bitmap fonts are generated in white with a proper alpha channel, and then colorized dynamically. How would you handle outlines with that ? The only way would be to generate the outlines alone in a separate texture, and render text in two passes.
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Outlined text
« Reply #28 on: September 12, 2008, 08:14:07 pm »
Quote from: "Laurent"
Well, SFML bitmap fonts are generated in white with a proper alpha channel, and then colorized dynamically. How would you handle outlines with that ? The only way would be to generate the outlines alone in a separate texture, and render text in two passes.


Ok if there isen't a good way to implement it I understand that you dropped it.

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Outlined text
« Reply #29 on: October 10, 2008, 12:18:02 am »
Quote from: "Laurent"
and render text in two passes.

Is that a bad thing?

Personally I think not because 1) outlined text is pretty important for readability in games in my personal opinion and 2) all features have a price. Anyway, you're the boss, your decision.

Just some thoughts: make a derived class from sf::String like sf::OutlinedString which creates a second "texture"(?) with all the letters in it but with a larger spacing between the letters and then apply a linear filter ("opening/closing operation" alias "max/min filter" alias "dilation/erosion" or however you call it) with a N x N matrix whereas the N is the pixel size of the outline. This should make all letters "bold". Afterwards when OutlinedString is drawn first draw the letters from the texture of OutlinedString in one color and then draw the letters of the texture of the base class in another color on top of it.

 

anything