Class Avogadro::Rendering::TextRenderStrategy#

class TextRenderStrategy#

The TextRenderStrategy class defines an interface for generating text images.


Subclassed by QtTextRenderStrategy

Public Functions

virtual ~TextRenderStrategy()#
virtual TextRenderStrategy *newInstance() const = 0#

Copy the current TextRenderStrategy implementation into an new object.

virtual void boundingBox(const std::string &string, const TextProperties &tprop, int bbox[4]) const = 0#

Calculate a bounding box.

  • string – The text.

  • tprop – The properties.

  • bbox – The result in pixels (left, right, top, bottom).

virtual void render(const std::string &string, const TextProperties &tprop, unsigned char *buffer, const Vector2i &dims) const = 0#

render Render the string.

  • string – The text.

  • tprop – The properties.

  • buffer – The target. Must be dims[0]*dims[1]*4 bytes. The buffer will be filled with RGBA image data, with the top scan row at the beginning.

  • dims – Dimensions in pixels of the target buffer.