FTGL Fonts rendering woes

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hi all
i have been working at getting ftgl commands compiled into a display
list.
Its killing me . When I disable use of display list in FTGl( using the
UseDisplayList( false ) ) function and use the Render() call ... it
seems that characters that have appeared once are not being rendered.

Please help  .. the code listing follows

[CODE]

dlist = glGenLists( 1 );
glNewList( dlist , GL_COMPILE_AND_EXECUTE );


ffont->Render(" THIS CANT HAPPEN " );



glEndList();

[/CODE]

For the aboe code listing i get the following o/p

THIS  CAN                P E


Any ideas ...

0
Reply shekhar.kaushik (7) 4/21/2006 6:42:54 AM

See related articles to this posting


shekhar.kaushik@gmail.com wrote:
> Hi all
> i have been working at getting ftgl commands compiled into a display
> list.
> Its killing me . When I disable use of display list in FTGl( using the
> UseDisplayList( false ) ) function and use the Render() call ... it
> seems that characters that have appeared once are not being rendered.
> 
> Please help  .. the code listing follows
> 
> [CODE]
> 
> dlist = glGenLists( 1 );
> glNewList( dlist , GL_COMPILE_AND_EXECUTE );
> 
> 
> ffont->Render(" THIS CANT HAPPEN " );
> 
> 
> 
> glEndList();
> 
> [/CODE]
> 
> For the aboe code listing i get the following o/p
> 
> THIS  CAN                P E
> 
> 
> Any ideas ...
> 

Hi!

How do you initialize ffont?
0
Reply Jan 4/21/2006 1:12:30 PM

Hi

This is how

FTFont* ffont = new FTGLPolygonFont( "times.ttf" );


calls to ffont->Render() work perfectly . Porblems come only when i
want to compile it into a display list ..

I call

ffont->UseDisplayList( false )  before glNewList()

I think thas the correct usage  isnt it ?


if i do not disable use of lists in FTGL
 and try compiling Render() calls into a display list only the first
character is rendered and a GL error state is set.




Jan Boehme wrote:

> shekhar.kaushik@gmail.com wrote:
> > Hi all
> > i have been working at getting ftgl commands compiled into a display
> > list.
> > Its killing me . When I disable use of display list in FTGl( using the
> > UseDisplayList( false ) ) function and use the Render() call ... it
> > seems that characters that have appeared once are not being rendered.
> >
> > Please help  .. the code listing follows
> >
> > [CODE]
> >
> > dlist = glGenLists( 1 );
> > glNewList( dlist , GL_COMPILE_AND_EXECUTE );
> >
> >
> > ffont->Render(" THIS CANT HAPPEN " );
> >
> >
> >
> > glEndList();
> >
> > [/CODE]
> >
> > For the aboe code listing i get the following o/p
> >
> > THIS  CAN                P E
> >
> > 
> > Any ideas ...
> > 
> 
> Hi!
> 
> How do you initialize ffont?

0
Reply shekhar 4/21/2006 1:25:49 PM

<shekhar.kaushik@gmail.com> wrote in message
news:1145601774.603980.284470@e56g2000cwe.googlegroups.com...
> ffont->Render(" THIS CANT HAPPEN " );
[...]
> For the aboe code listing i get the following o/p
>
> THIS  CAN                P E

I don't know what the solution is but surely you noticed every first render
of each character is OK?
It is possible same characters are rendered on top of each other on the same
coords, or are destroyed after being used the first time.

[jongware]


0
Reply jongware 4/21/2006 9:31:18 PM

yes the character seems to be okay
I dont know the internals of FTGL .. so really cant understand where to

search for  the problem.


[jongware] wrote:

> <shekhar.kaushik@gmail.com> wrote in message
> news:1145601774.603980.284470@e56g2000cwe.googlegroups.com...
> > ffont->Render(" THIS CANT HAPPEN " );
> [...]
> > For the aboe code listing i get the following o/p
> >
> > THIS  CAN                P E
>
> I don't know what the solution is but surely you noticed every first render
> of each character is OK?
> It is possible same characters are rendered on top of each other on the same
> coords, or are destroyed after being used the first time.
> 
> [jongware]

0
Reply shekhar 4/21/2006 10:21:28 PM

no solution ppl ??? 
Jan i thought u may have one

0
Reply shekhar 4/22/2006 7:36:23 PM

Hi,

Where can I get FTGL? I couldn't download it from the official website. 
Thank you.

f.f

shekhar.kaushik@gmail.com wrote:
> Hi all
> i have been working at getting ftgl commands compiled into a display
> list.
> Its killing me . When I disable use of display list in FTGl( using the
> UseDisplayList( false ) ) function and use the Render() call ... it
> seems that characters that have appeared once are not being rendered.
> 
> Please help  .. the code listing follows
> 
> [CODE]
> 
> dlist = glGenLists( 1 );
> glNewList( dlist , GL_COMPILE_AND_EXECUTE );
> 
> 
> ffont->Render(" THIS CANT HAPPEN " );
> 
> 
> 
> glEndList();
> 
> [/CODE]
> 
> For the aboe code listing i get the following o/p
> 
> THIS  CAN                P E
> 
> 
> Any ideas ...
> 
0
Reply f 4/24/2006 2:36:43 PM

I u are looking for the code ... u can find it here

http://packages.qa.debian.org/f/ftgl.html



f.f wrote:

> Hi,
>
> Where can I get FTGL? I couldn't download it from the official website.
> Thank you.
>
> f.f
>
> shekhar.kaushik@gmail.com wrote:
> > Hi all
> > i have been working at getting ftgl commands compiled into a display
> > list.
> > Its killing me . When I disable use of display list in FTGl( using the
> > UseDisplayList( false ) ) function and use the Render() call ... it
> > seems that characters that have appeared once are not being rendered.
> >
> > Please help  .. the code listing follows
> >
> > [CODE]
> >
> > dlist = glGenLists( 1 );
> > glNewList( dlist , GL_COMPILE_AND_EXECUTE );
> >
> >
> > ffont->Render(" THIS CANT HAPPEN " );
> >
> >
> >
> > glEndList();
> >
> > [/CODE]
> >
> > For the aboe code listing i get the following o/p
> > 
> > THIS  CAN                P E
> > 
> > 
> > Any ideas ...
> >

0
Reply shekhar 4/25/2006 5:26:23 AM

shekhar.kaushik@gmail.com wrote:
> Hi
> 
> This is how
> 
> FTFont* ffont = new FTGLPolygonFont( "times.ttf" );
> 
> 
> calls to ffont->Render() work perfectly . Porblems come only when i
> want to compile it into a display list ..
> 
> I call
> 
> ffont->UseDisplayList( false )  before glNewList()
> 
> I think thas the correct usage  isnt it ?
> 

Yes, in theory. If you watch the source code you see there is no reason
why it should work.
I reported this in 12/2004 but the ftgl guy released nothing after 12/2004.
I fixed it for my needings and sent it to him but ...

> 
> if i do not disable use of lists in FTGL
>  and try compiling Render() calls into a display list only the first
> character is rendered and a GL error state is set.

I tried this too but in my case it creates to many dls.

Cheers, Jan.
0
Reply Jan 4/27/2006 11:02:01 AM
comp.graphics.api.opengl 7101 articles. 24 followers. Post

8 Replies
511 Views

Similar Articles

[PageSpeed] 59


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

FTGL
Hey, I need to render a bunch of labels in a 3d scene and I need to do so fast. I was previously using a Qt function to do this but it was too slow. Now I am using FTGL and it is much faster but FTGLBitmapFont seems to be only 2d. It always renders the labels on top of everything regardless of whether they are occluded or not. I am rendering the fonts and geometry in the correct order. Can someone tell me how to use FTGL in it's simplest form? I don't need outlines. I don't need extrusions. I just need labels in 3d and I need them to blend if they are occluded. Thanks for ...

[ANN] ruby-ftgl 0.1 (True type font rendering in OpenGL)
Howdy ! Ilmari Heikkinen and I have created Ruby bindings for the FTGL library. FTGL is a C++ library that uses the freetype2 library to render true type fonts in OpenGL using various methods. (Outline, Polygon, Texture, Bitmap, Pixmap, and Extruded.) Screenshots: http://tastyspleen.net/~billk/ruby-ftgl-test1.png http://tastyspleen.net/~billk/ftgl-extruded-font.png The latter extruded font screenshot is from the FTGL C++ demo. I haven't ported the demo to ruby yet, but the ruby bindings needed should all be there. The ruby-ftgl project page is at: http://rubyforge.org/projects/ruby...

font rendering priority and fontconfig font override
hi everyone I was always confused by the order that X(Freetype? Xft?) renders a given symbol (encoded with unicode, for example). It seems to me that scalable fonts always get the priority to render a character than bitmap fonts if both match the encodings of the character. Can anyone give me a hint or show me some useful webpages related to this? Moverover, since it is very common for most existing Asian fonts looking blurry on the screen due to anti-aliasing and no efficient hinting method available, we have developed bitmap fonts to make characters look nicer and sharper on the screen. Ho...

Rendering a font
Hi, I have an app that is trying to render a set of strings onto a panel, but the strings must fillthe entire screen (Therefore I must strech the fonts etc). I have to support the MS JVM for this, so I have made two classes, one for Java2D, and one for AWT 1.1. Anyway, I am trying to get the cleanest looking rendering on the Java2D side of things, but seem to be missing something as the image looks to be missing something still.. The jist of things are as follows: 1. Get the bounds of the panel. 2. Determine the scale from old to new size 3. Derive a new font based on the new scaling...

Font woes
I have a somewhat unique problem with fonts. I have a win32 DLL that is injected into another process, and a .net application which is calling functions inside this DLL. Now I need to be able to get a font created inside the process that the DLL is injected into. I have this worked out mostly but I can't quite figure out how to take a .net Font object and create an exact duplicate with win32 calls. What I've been doing is creating my Font object, then calling ToHfont() to get an HFONT for this. Then I called GetTextMetrics and passed the following information from the returne...

Font Woes Mac->PC with zero kByte fonts (Was: Migrating PM for Mac to FrameMaker for Win: Caveats/Tips? )
Hello group, Some font and file woes I anticipated have become reality: A customer gives us a Mac-Formatted CD with PageMaker files, graphics and fonts on it. A programm named "MacDrive" fixes the file extensions for us and makes the medium readable. BUT: All Fonts have zero kilobytes (although they have non-zero kilobytes on our old, beaten-down OS9 iMAC we got from the crate in the basement), and their names are not fixed. Q1. How come they have "0" kilobyte and appear empty when viewed with a hexeditor, despite the MacDrive-Reader-Software The medium is definitely ...

Font rendering tool
Hi. Not sure this is the perfect place to post this, but i've written a tool for rendering fonts into an image file, and output the specs. It uses freetype 2. Here's the URL http://hackmiker.3x.ro/gl/index.php . It's GPL. There's also an OpenGL+SDL font demo using the output from the font tool. Both compile under linux. -hackmiker hackmiker wrote: > Hi. Not sure this is the perfect place to post this, but i've written a > tool for rendering fonts into an image file, and output the specs. It > uses freetype 2. Here's the URL http://hackmiker.3x.ro/gl/index.ph...

Outline font rendering
Hello, I am developing a GIS mapping application in which I need text rendering. Because I also need zooming and panning, I have chosen outline fonts. The excellent nehe.gamedev.net set me on the rails with lesson 14. The problem I'm facing is anti-aliasing. When I use "glEnable (GL_POLYGON_SMOOTH)", all triangles of the tesselated characters are anti-aliased, and this leads to artefacts inside the plotted characters. Finally I have found this as solution: 1) Draw not anti-aliased polygons, using WGL_FONT_POLYGONS, and glDisable (GL_POLYGON_SMOOTH) 2) Draw anti-aliased lines o...

rendering fonts with ruby
Hey gang. I'm re-writing a tool to read .ttf files, and translate them into the needed bitmaps for their glyphs. (The tool I've got for this now is written in C++, and VERY poorly designed). For the re-write, I'd like to use Ruby. But I'm having some trouble finding existing tools to actually read the font files, and translate them into the bitmaps. In the C++ version, freetype is used for these steps. However, all versions of freetype I've been able to find with Ruby are in alpha, and haven't been updated in several years. There are no gems for them, and the ...

Render fonts in opengl?
Currently, what is the best way to render fonts in an opengl? A quick google groups search returned only very old posts, which I believe may not be up to date. Ater a bit of digging I stumbled on FTGL, which appears to do the trick. Yet, what are your suggestions? Thanks in advance, Rui Maciel P.S.: On a side note, it appears that google buries comp.graphics.api.opengl in it's google groups search. I don't understand how a search engine is able to burry results from this newsgroup, which google claims to have around 1700 subscribers (grossly inflated, I'm sure)...

Render Fonts smoothly...
Hi, I am trying to draw a string onto an image as smoothly as possible. The problem is that I am streching the font a little to fit my area fully.. AffineTransform fontTransform = new AffineTransform(); fontTransform.scale( xScale , yScale); Font f = myFont.deriveFont(fontTransform); g.setFont(f); Graphics2D g2d = (Graphics2D)g; g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2d.drawString(x,y,"Hello"); This works a little but the antialiasing seems to be a bit heavy and the rendered string looks a bit strange. Is there another...

ghostscript font woes
I'm having a problem with spaces being replaced by a capital S with a comma directly under it in postscript documents. My setup is as follows: OS: win98se Printer driver: Apple Color Laserwriter 12/600 The printer is set to file, and the driver is configured to send all fonts as type 42. Ghostscript V8.13 is being used to convert the postscript files to pdf, using the following: gswin32c -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=%1.pdf %1.ps I have verified that gs\gs8.13\bin and gs\gs8.13\lib are in the path. I have tried: set GS_FONTPATH=c:\progra~1\gs\fonts;c:\windows\...

Ghostscript Font Rendering
Hello, Where in Ghostscript (source code) can I find the height and width in pixels (or points) of a character after it has been rendered? Thanks, Lesley Lesley Northam <lanortha@csclub.uwaterloo.ca> wrote: >Where in Ghostscript (source code) can I find the height and width in >pixels (or points) of a character after it has been rendered? Define "height" and "width"; slippery concepts for glyphs... ---------------------------------------- Aandi Inston quite@dial.pipex.com http://www.quite.com Please support usenet! Post replies and follow-ups, don't e...

how to render SVG font?
Hi all, I've learned that apparently any font can be converted to an SVG font, and so now I wish to learn if there is any free anti-aliased font renderer out there for SVG fonts. By this I mean rendering to pixmaps. My hope is that rather than mess with scaling I can find a way to get pre-rendered anti-aliased fonts at specific sizes and styles, and then render them as partially-transparent pixmaps. But a generalized renderer that renders to the screen would be fine too. Thanks for any help. Saturday7 <u9526@yahoo.com> wrote: > Hi all, > I've learned that apparentl...

Font rendering in Debian
After having used Ubuntu for quite some time I decided to try Debian (5.0.7). After a fresh installation I noticed that the fonts were thin and not as nicely anti-aliased as in Ubuntu (10.04). Does anyone know what kind of magic Ubuntu does to get the nicely rendered fonts? August August Karlstrom wrote: > After having used Ubuntu for quite some time I decided to try Debian > (5.0.7). After a fresh installation I noticed that the fonts were thin > and not as nicely anti-aliased as in Ubuntu (10.04). Does anyone know > what kind of magic Ubuntu does to get the ni...

FTGL font engine
After trying to use wglUseFontBitmaps to render text I've since ditched this and have chosen to use FreeType2 and FTGL. However I'm still having an issue with my text being mirror-reflected on the horizontal axis, essentially making the text appear upside down. I think this is due to the fact that the surface I'm restriced to using is a GDI dibsection. It seems a dibsection is stored in a row-reversed manner with the first row of pixels in memory being the last row of the actual image. Does anyone know how I can manipulate the stored image of the font created by FreeType2 ...

XFree86 font woes
Sometimes XFree86 doesn't load all the fonts. Sometimes it does. The symptoms are really small fonts in Mozilla and no fonts at all in the Rox filer. Here's the key section in my XF86Config file: Section "Files" RgbPath "/usr/X11R6/lib/X11/rgb" ModulePath "/usr/X11R6/lib/modules" FontPath "/usr/X11R6/lib/X11/fonts/misc/" FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" FontPath "/usr/X11R6/lib/X11/fonts/Type1/" FontPath "/usr/X11R6/lib/X11/fon...

Japanese Font Rendering
I'm using Debian's xemacs21-mule-canna-wnn package to type Japanese. It's running on top of kinput2 and canna. There isn't enough space between lines of Japanese text so characters slightly overlap. Also, a bunch of "dirty" pixels are left behind while entering Japanese text. Pressing C-L clears these up, though. Can anyone point me in the right direction to resolve these issues? I'd really like to get this fixed because there are a bunch of nice dictionary tools and such for editing Japanese in Emacs. >>>>> "thomas" == thom...

Incorrectly rendered font.
Hello everybody. For programming I use monospaced True Type font called Monaco (available from here: http://www.gringod.com/wp-upload/MONACO.TTF. I think that it is free, but I am not sure. Some time ago it was available for downloading from many sites, but now most links had disappeared). It looks very good on Windows, but X (Linux, 0x86) renders that font incorrectly - the spacing is wrong, font's width and size is incorrect and additionally, though the .ttf file includes Regular, Italic, Bold and Bold Italic styles X is able to extract only Regular style, and when bold font is...

advanced Font rendering
Hello, from Photoshop I'm used to be able to define the space between two characters. So I can generate something like T E X T without having to put the blanks in there on my own. This setting can also be used to put the characters closer to each other, so the characters might be overlapping. Is there an option in the Font-classes of awt to achieve the same result? On the one hand I haven't found something yet, but on the other hand I'm not really sure what to look for. Regards Marten "Marten Lehmann" <lehmannmapson@cnm.de> wrote in message news:4...

Rendering fonts with Tcl/Tk
I'm looking for a way to grab a rendered piece of text in a certain font as an image. I don't really care how; creating a text widget and grabbing an image of it, creating a canvas widget and doing the same, finding some way to turn a font into a bitmap, whatever... I just want some way to turn text into picture. So far, looking through all the Tk man pages, I haven't found anything. Is there any way to do this in Tcl/Tk? "Cirne Tatsujin" <cirn@yahoo.com> wrote > > I'm looking for a way to grab a rendered piece of text in a certain > font as an imag...

Ghostscript mis-renders fonts
I have a pdf document that contains 4 different fonts that are 'embedded subset'. Ghostscript renders them at incorrect sizes and incorrect letter spacing. The same pdf displays properly in Acrobat Reader 9. Any help is greatly appreciated. On Oct 14, 10:21=A0pm, johnniec <jpcart...@gmail.com> wrote: > I have a pdf document that contains 4 different fonts that are > 'embedded subset'. =A0Ghostscript renders them at incorrect sizes and > incorrect letter spacing. =A0The same pdf displays properly in Acrobat > Reader 9. > Any help is greatly appreciated. ...

TTF fonts rendered in Python
I wonder if there is any module for rendering True Type Fonts in Python ? I need to create a GIF files with nice antialiased text and I'm unable to find any module with such functionality. Sincerely, K. vald <vald@valis.amber.eu.org> wrote in news:mailman.1063224795.24414.python-list@python.org: > > I wonder if there is any module for rendering True > Type Fonts in Python ? I need to create a GIF files > with nice antialiased text and I'm unable to find > any module with such functionality. lok at pygame and pil chris -- Chris <cliechti@gmx.net> ...

rendering bitmap fonts from ruby
hi! i need to generate some bitmap headlines + was wondering if there are any ruby libraries for rendering type to bitmaps? we have a mixed linux/os-x environment, and getting rmagick running for everyone looks like a bunch of work. are there any more quick install gems out there that have less functionality but will allow me to render a headline in a font + size of my choice to a bitmap (JPG ideally)? whats the word on GD library vs imagemagick vis-a-vis playing nice with ruby? thanks! /dc ------------------------------------------- David "DC" Collier mailto:dc@pikkle.com...