digitalmars.D - Has Tomasz's (h3r3tic's) OpenGL font rendering code been ported to
- Chad J (4/4) Mar 10 2012 I've been looking for a good way to render font in OpenGL with D.
- bioinfornatics (3/8) Mar 10 2012 take derelict2 http://www.dsource.org/projects/derelict [stable]
- Chad J (3/11) Mar 10 2012 I already have OpenGL working with derelict2.
- Jacob Carlborg (4/8) Mar 11 2012 Just use FreeType?
- Chad J (12/19) Mar 11 2012 FreeType is quite cool, but it will only render glyphs onto small
- Jacob Carlborg (4/25) Mar 11 2012 So you mean putting a texture on a font?
- Chad J (19/43) Mar 11 2012 No, just getting the font onto the screen at all.
- Jacob Carlborg (5/24) Mar 12 2012 I did some font rendering in C# using FreeType and OpenGL for a simple
- FeepingCreature (2/5) Mar 14 2012 FreeType is not a C# library. FreeType is a C library. If this was easy ...
- Jacob Carlborg (6/11) Mar 14 2012 I know it's a C library. As far as I know it was as similar to the C
- David Nadlinger (7/12) Mar 11 2012 If I were to implement a texture rendering system for 3D
- Chad J (2/14) Mar 11 2012 Sounds interesting. Thanks!
I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.
Mar 10 2012
Le samedi 10 mars 2012 =C3=A0 21:23 -0500, Chad J a =C3=A9crit :I've been looking for a good way to render font in OpenGL with D. =20 Back in they day I was very impressed with Tomasz's article on the=20 subject: http://h3.gd/dmedia/?n=3DTutorials.TextRendering1 I was wonder if anyone has ported it.take derelict2 http://www.dsource.org/projects/derelict [stable] derelict3 in development https://github.com/aldacron/Derelict3
Mar 10 2012
On 03/10/2012 10:29 PM, bioinfornatics wrote:Le samedi 10 mars 2012 à 21:23 -0500, Chad J a écrit :I already have OpenGL working with derelict2. How do these links help with rendering text in OpenGL?I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.take derelict2 http://www.dsource.org/projects/derelict [stable] derelict3 in development https://github.com/aldacron/Derelict3
Mar 10 2012
On Sunday, 11 March 2012 at 03:45:36 UTC, Chad J wrote:On 03/10/2012 10:29 PM, bioinfornatics wrote:I have some code based on that tutorial in https://github.com/kiith-sa/ICE, but beware that it's not the most effective code and not particularly readable either. However, I abstracted it away it to pack any textures instead of just font glyphs, and it is spread over many files. The relevant files are: video/glvideodriver.d video/texturepage.d video/gltexturebackend.d video/binarytexturepacker.d video/font.d video/fontmanager.d Works with DMD 2.058, but it'd probably be nontrivial to rip it out and use separately.Le samedi 10 mars 2012 à 21:23 -0500, Chad J a écrit :I already have OpenGL working with derelict2. How do these links help with rendering text in OpenGL?I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.take derelict2 http://www.dsource.org/projects/derelict [stable] derelict3 in development https://github.com/aldacron/Derelict3
Mar 11 2012
On 03/11/2012 04:24 AM, Kiith-Sa wrote:On Sunday, 11 March 2012 at 03:45:36 UTC, Chad J wrote:Thanks for the link! I don't have time to go over it right now, but that looks promising. I took a shot at porting Tomasz's code a while ago, but I never got it to compile. At least your code /compiles/, so even if it's integrated into other stuff, at least I might stand a better chance. Btw, also a fan of Raptor and Tyrian. Good taste dude. ;)On 03/10/2012 10:29 PM, bioinfornatics wrote:I have some code based on that tutorial in https://github.com/kiith-sa/ICE, but beware that it's not the most effective code and not particularly readable either. However, I abstracted it away it to pack any textures instead of just font glyphs, and it is spread over many files. The relevant files are: video/glvideodriver.d video/texturepage.d video/gltexturebackend.d video/binarytexturepacker.d video/font.d video/fontmanager.d Works with DMD 2.058, but it'd probably be nontrivial to rip it out and use separately.Le samedi 10 mars 2012 à 21:23 -0500, Chad J a écrit :I already have OpenGL working with derelict2. How do these links help with rendering text in OpenGL?I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.take derelict2 http://www.dsource.org/projects/derelict [stable] derelict3 in development https://github.com/aldacron/Derelict3
Mar 11 2012
On Sunday, 11 March 2012 at 22:39:46 UTC, Chad J wrote:On 03/11/2012 04:24 AM, Kiith-Sa wrote: Thanks for the link! I don't have time to go over it right now, but that looks promising. I took a shot at porting Tomasz's code a while ago, but I never got it to compile. At least your code /compiles/, so even if it's integrated into other stuff, at least I might stand a better chance. Btw, also a fan of Raptor and Tyrian. Good taste dude. ;)I just remembered I also wrote a tool for this as a project at university (in Java, because I had to) last year: http://gitorious.org/fmapper It spits out a texture or a set of textures with tightly packed glyphs of specified font with specified parameters, and a text file containing offsets and texture coords of glyphs. There is an example C++/OpenGL program on how to load the textures and draw fonts. Only supports the basic multilingual plane, though. If you're only using a fixed number of font sizes, you can generate textures for them with this. It's not as flexible, but probably easier than writing your own code based on FreeType. Note that it's not maintained - I hate Java - but it should work.
Mar 12 2012
On 2012-03-11 03:23, Chad J wrote:I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.Just use FreeType? -- /Jacob Carlborg
Mar 11 2012
On 03/11/2012 09:09 AM, Jacob Carlborg wrote:On 2012-03-11 03:23, Chad J wrote:FreeType is quite cool, but it will only render glyphs onto small bitmaps. Getting those glyphs onto the screen becomes more complicated after that: you can't just blit them like in SDL or somesuch. Since textures don't come in "supersmall" size, it is effective to pack the glyphs into a larger texture like the article suggests. Then you have to texture-map correctly to only render the glyphs you want. Somewhere in there is a bunch of other font-setting stuff like kerning, sub-pixel anti-aliasing, line offsets, etc. FreeType doesn't do that stuff for anyone, it just provides the tools necessary to make it possible. It's fairly complicated; I'd rather just write "Font f = new Font("Courier New"); f.draw(100, 100, "Hello world!");".I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.Just use FreeType?
Mar 11 2012
On 2012-03-11 14:18, Chad J wrote:On 03/11/2012 09:09 AM, Jacob Carlborg wrote:So you mean putting a texture on a font? -- /Jacob CarlborgOn 2012-03-11 03:23, Chad J wrote:FreeType is quite cool, but it will only render glyphs onto small bitmaps. Getting those glyphs onto the screen becomes more complicated after that: you can't just blit them like in SDL or somesuch. Since textures don't come in "supersmall" size, it is effective to pack the glyphs into a larger texture like the article suggests. Then you have to texture-map correctly to only render the glyphs you want. Somewhere in there is a bunch of other font-setting stuff like kerning, sub-pixel anti-aliasing, line offsets, etc. FreeType doesn't do that stuff for anyone, it just provides the tools necessary to make it possible. It's fairly complicated; I'd rather just write "Font f = new Font("Courier New"); f.draw(100, 100, "Hello world!");".I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.Just use FreeType?
Mar 11 2012
On 03/11/2012 05:04 PM, Jacob Carlborg wrote:On 2012-03-11 14:18, Chad J wrote:No, just getting the font onto the screen at all. And I want to: - Be able to size the font smoothly. (No bitmap fonts!) - Draw glyphs for higher unicode codepoints. (No texture[128]!) - Have kerning/hinting. (Freetype makes it possible, but does not do it for you.) - Have anti-aliasing and maybe even subpixel accuracy. Tomasz's code does all of this. Freetype is very low-level. Freetype does not make OpenGL calls. You give it a font and a codepoint and it gives you a small grayscale bitmap and a slew of metrics for it. Then it's up to you to figure out where to put it and how to get it onto the screen. If this were trivial, Tomasz (and others who have written on the topic, too) would not have written 5-10 pages of text plus a bunch of D files full of code. It's just not that easy. It's all in the original link. It's actually really weird that there isn't much library code out there to render text in OpenGL. There are a bunch of tutorials that do it wrong and maybe a few library thingies that I can't use for various reasons.On 03/11/2012 09:09 AM, Jacob Carlborg wrote:So you mean putting a texture on a font?On 2012-03-11 03:23, Chad J wrote:FreeType is quite cool, but it will only render glyphs onto small bitmaps. Getting those glyphs onto the screen becomes more complicated after that: you can't just blit them like in SDL or somesuch. Since textures don't come in "supersmall" size, it is effective to pack the glyphs into a larger texture like the article suggests. Then you have to texture-map correctly to only render the glyphs you want. Somewhere in there is a bunch of other font-setting stuff like kerning, sub-pixel anti-aliasing, line offsets, etc. FreeType doesn't do that stuff for anyone, it just provides the tools necessary to make it possible. It's fairly complicated; I'd rather just write "Font f = new Font("Courier New"); f.draw(100, 100, "Hello world!");".I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.Just use FreeType?
Mar 11 2012
On 2012-03-11 23:36, Chad J wrote:No, just getting the font onto the screen at all. And I want to: - Be able to size the font smoothly. (No bitmap fonts!) - Draw glyphs for higher unicode codepoints. (No texture[128]!) - Have kerning/hinting. (Freetype makes it possible, but does not do it for you.) - Have anti-aliasing and maybe even subpixel accuracy. Tomasz's code does all of this. Freetype is very low-level. Freetype does not make OpenGL calls. You give it a font and a codepoint and it gives you a small grayscale bitmap and a slew of metrics for it. Then it's up to you to figure out where to put it and how to get it onto the screen. If this were trivial, Tomasz (and others who have written on the topic, too) would not have written 5-10 pages of text plus a bunch of D files full of code. It's just not that easy. It's all in the original link. It's actually really weird that there isn't much library code out there to render text in OpenGL. There are a bunch of tutorials that do it wrong and maybe a few library thingies that I can't use for various reasons.game. I can't remembering it being that hard. -- /Jacob Carlborg
Mar 12 2012
On 03/12/12 10:42, Jacob Carlborg wrote:On 2012-03-11 23:36, Chad J wrote: can't remembering it being that hard.
Mar 14 2012
On 2012-03-14 09:03, FeepingCreature wrote:On 03/12/12 10:42, Jacob Carlborg wrote:I know it's a C library. As far as I know it was as similar to the C library. -- /Jacob CarlborgOn 2012-03-11 23:36, Chad J wrote: can't remembering it being that hard.
Mar 14 2012
On Sunday, 11 March 2012 at 02:24:15 UTC, Chad J wrote:I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.If I were to implement a texture rendering system for 3D graphics, I'd look into signed distance field fonts, as presented in Valve's seminal paper [1]. David [1] http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
Mar 11 2012
On 03/11/2012 05:10 PM, David Nadlinger wrote:On Sunday, 11 March 2012 at 02:24:15 UTC, Chad J wrote:Sounds interesting. Thanks!I've been looking for a good way to render font in OpenGL with D. Back in they day I was very impressed with Tomasz's article on the subject: http://h3.gd/dmedia/?n=Tutorials.TextRendering1 I was wonder if anyone has ported it.If I were to implement a texture rendering system for 3D graphics, I'd look into signed distance field fonts, as presented in Valve's seminal paper [1]. David [1] http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
Mar 11 2012