SFML community forums

General => Feature requests => Topic started by: dewyatt on December 28, 2008, 10:27:33 pm

Title: Upgrade to freetype 2.3.7
Post by: dewyatt on December 28, 2008, 10:27:33 pm
I'm not sure why the latest SVN of SFML is using freetype 2.1.10 but I'm requesting an upgrade it to the latest 2.3.7.
I'm finally rewriting my SFML font system in preparation for its release and I'm not familiar with the older FT_Stroker interface of 2.1.10 (this is needed for outlined fonts).

I've already upgraded my local copy and have had no problems (it compiled at least).
Title: Upgrade to freetype 2.3.7
Post by: dewyatt on December 29, 2008, 08:23:36 am
While I'm on the subject, a debug version of freetype.lib should be provided and used in debug builds.
This will avoid the "defaultlib 'msvcrt.lib' conflicts" warning.
Read the Caution at the bottom of:
http://msdn.microsoft.com/en-us/library/2kzt1wy3(VS.71).aspx
(URL tag does not support parentheses, copy&paste it)
Title: Upgrade to freetype 2.3.7
Post by: dabo on December 29, 2008, 12:22:25 pm
So you can draw outlined text now? I want that too but Laurent refuses to implement it ;)
Title: Upgrade to freetype 2.3.7
Post by: dewyatt on December 29, 2008, 03:49:00 pm
Quote from: "dabo"
So you can draw outlined text now? I want that too but Laurent refuses to implement it ;)

Well yes, with TrueType fonts.
I just never got around to releasing the code.

I should be releasing it within a week now though.  :D
Title: Upgrade to freetype 2.3.7
Post by: dabo on December 29, 2008, 04:04:43 pm
Quote from: "dewyatt"
Quote from: "dabo"
So you can draw outlined text now? I want that too but Laurent refuses to implement it ;)

Well yes, with TrueType fonts.
I just never got around to releasing the code.

I should be releasing it within a week now though.  :D


I would love a screenshot :)
Title: Upgrade to freetype 2.3.7
Post by: Laurent on December 29, 2008, 05:31:33 pm
Well, I don't really refuse to implement it ;)

It's just that I don't see how to do it properly.
Title: Upgrade to freetype 2.3.7
Post by: dewyatt on December 29, 2008, 07:15:34 pm
Quote from: "dabo"

I would love a screenshot :)

Here you go :wink:
(http://i107.photobucket.com/albums/m300/silentdae/th_sfTTF.png) (http://s107.photobucket.com/albums/m300/silentdae/?action=view&current=sfTTF.png)
All the text there is drawn with my library.
It shows:
-Outlined only (the Japanese at the bottom)
-Filled only (the FPS and mouse pos at the top)
-Outlined + Filled  (everything else)
It also shows that the outline size is adjustable.

Quote from: "Laurent"
Well, I don't really refuse to implement it ;)

It's just that I don't see how to do it properly.

Hopefully my code will give you an idea.
I don't think it would be too hard. :)
Title: Upgrade to freetype 2.3.7
Post by: dabo on December 29, 2008, 08:20:12 pm
Quote from: "dewyatt"
All the text there is drawn with my library.
It shows:
-Outlined only (the Japanese at the bottom)
-Filled only (the FPS and mouse pos at the top)
-Outlined + Filled  (everything else)
It also shows that the outline size is adjustable.


Looks great!
Title: Upgrade to freetype 2.3.7
Post by: Laurent on December 29, 2008, 08:44:16 pm
Quote
Hopefully my code will give you an idea.

Where can I find it?
Anyway, my concern is not how to generate the outline, but rather how to use it properly. In SFML, the bitmap font is a black and white texture which is then modulated with a global color. How do you handle this with outlines? Do you have a separate texture containing only the outline, or do you use static colors?
Title: Upgrade to freetype 2.3.7
Post by: Imbue on December 29, 2008, 08:57:12 pm
Quote from: "dewyatt"
(http://i107.photobucket.com/albums/m300/silentdae/th_sfTTF.png) (http://s107.photobucket.com/albums/m300/silentdae/?action=view&current=sfTTF.png)
That really does look great. This would be a great feature for SFML.
Title: Upgrade to freetype 2.3.7
Post by: dewyatt on December 29, 2008, 10:19:07 pm
Quote from: "Laurent"
Quote
Hopefully my code will give you an idea.

Where can I find it?
Anyway, my concern is not how to generate the outline, but rather how to use it properly. In SFML, the bitmap font is a black and white texture which is then modulated with a global color. How do you handle this with outlines? Do you have a separate texture containing only the outline, or do you use static colors?

Well I plan on releasing it within a week or so.
Maybe today or tomorrow actually.
I just want to add a few necessary features.

And yes, I store a separate texture containing the outline.
This means:
Pros:
-Flexibility
-Ease of use
Cons:
-Slight increase in memory usage
-Slight decrease in performance (tests showed about 15%)

I understand the hardest thing would be working it into SFML's design/style.
Quote from: "dabo"
Looks great!

Quote from: "Imbue"
That really does look great. This would be a great feature for SFML.

Thanks!
I hope one day it will be standard SFML. :)
Until then, I'll be working on it.
Title: Upgrade to freetype 2.3.7
Post by: Weetbix on December 30, 2008, 12:03:02 am
This is excellent, great work  :lol:
Title: Upgrade to freetype 2.3.7
Post by: dewyatt on December 31, 2008, 09:27:59 pm
Ok!
I went ahead and released it here:
http://www.sfml-dev.org/forum/viewtopic.php?p=5562