[osg-users] Compute line numbers for Glyphs in Text class

Ferran Pallarès pallares.ferran at gmail.com
Wed Oct 24 10:57:49 PDT 2018

Hi all,

I'm currently trying to port an application based on OpenSceneGraph 3.4 to
its latest release 3.6.3 and I have encountered some problems in the
process. I thought that, perhaps, you could give me some hints on how to
overcome them, as I'm not familiarized with the OSG code.

The application I'm trying to port wraps osgText::Text class into a
TextLine class. This class considers only the Glyphs in a given line, by
installing some iterators pointing to the first and last Glyphs in such
line. In order to install those iterators, the application code uses the
GlyphQuads::LineNumbers vector in the text->_textureGlyphQuadMap, which
used to store the line number for each Glyph.

However, this information was removed in commit cefecaec103
February last year because it was unused. I've been trying to recompute
this information by other means and I've checked the available functions in
Text and TextBase, but I'm not really sure about how to do it. My best
guess is to use Text::computeLastCharacterOnLine on the line, and take the
last character on the previous line + 1 as the first character on the
current line. However, I'm really not very sure about that, as I have a
very superficial knowledge on what this class is actually doing and how
cursors work.

Any hint on how I could achieve this in the latest release?

Thank you!,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20181024/6c39698c/attachment.html>

More information about the osg-users mailing list