TcUnicodeHelper uses a text pipeline to draw onto the display. Text pipelines are how it supports so many library options, it is an interface that must be implemented in order for tcUnicode to be able to draw onto a device. It has the minimum set of functions for drawing text.
class TextPlotPipeline {
public:
virtual ~TextPlotPipeline() = default;
virtual void drawPixel(uint16_t x, uint16_t y, uint32_t color) = 0;
virtual void setCursor(const Coord& where) = 0;
virtual Coord getCursor() = 0;
virtual Coord getDimensions() = 0;
};
If we think about this for a moment, the pipeline allows us a lot of freedom, in future pipelines that rotated text or performed other operations could be added, although at the moment it is only used for device independent drawing. There are out of the box implementations for the following libraries, these are built in and have a UnicodeFontHandler
constructor so that you don’t even need to create a pipeline.