octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #31468] multi-line text objects


From: Vanya Sergeev
Subject: [Octave-bug-tracker] [bug #31468] multi-line text objects
Date: Tue, 16 Aug 2011 22:06:48 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

Follow-up Comment #53, bug #31468 (project octave):

Hi Ben,

I'm being verbose here to make sure I've got this right, please forgive my
detail if this is obvious and feel free to correct me.

My understanding is that FLTK just gives you the window, buttons, hooks for
mouse events, and most importantly is simply a container for an OpenGL context
that you can render to. Then you can use OpenGL methods like
glBitmap/glDrawPixels/glVertex*/etc. to create structures and ultimately
render them in your OpenGL area in the FLTK window. (gl-render.cc)

gl2ps is similar in that it gives you an OpenGL mimicing & compatible
interface (e.g. gl2psDrawPixels with identical arguments to glDrawPixels), so
it can work with the same OpenGL structures that you've created and rendered
somewhere else with OpenGL, but gl2ps instead renders them to a file in file
formats it supports like eps, pdf, svg, ps, etc. The similarity and
compatibility in interface make it easy to support rendering to a file for an
OpenGL application. It has nothing to do with FLTK, though.
(gl2ps-renderer.cc)

The third player relevant here is FreeType, the font engine. After
initializing it with relevant parameters like font, size, etc., it will accept
characters and gives you back bitmaps that you can render with something like
glDrawPixels or gl2psDrawPixels. (txt-eng-ft.cc)

Unless things are different in the Mac OS X version, the plot text in the
FLTK/OpenGL GUI should be rendered with just FreeType and OpenGL...

Currently, the print/gl2ps draws text by passing the raw text string directly
to gl2psTextOpt(), but this function doesn't interpret any kind of newline,
which makes rendering multi-lines with it an open ended question. The
experimental patch substitutes gl2psTextOpt() for gl2psDrawPixels(), and
instead draws rendered FreeType pixels (just like for the FLTK/OpenGL GUI),
which already account for multi-lines in txt-eng-ft.cc.

For your Mac OS X problem, though, if it's mangled in both FLTK/OpenGL and
print/gl2ps, it might be worth it to check out the pixels rendered by
FreeType, and make sure there is no problem there. If you'd like, I could
write a piece of code later today to export these pixels so you can check them
out independently of the OpenGL / gl2ps business, to make sure they're
okay...

Thanks,
~vsergeev

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31468>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]