This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cairo.h"
|
||||
#include "pango/pango-font.h"
|
||||
#include "pango/pango-types.h"
|
||||
|
||||
namespace ptprnt::graphics {
|
||||
|
||||
@@ -39,15 +44,21 @@ class Label {
|
||||
Label(Label&&) = delete;
|
||||
Label& operator=(Label&&) = delete;
|
||||
|
||||
uint8_t* getRaw();
|
||||
void createLabel(const std::string& labelText);
|
||||
std::vector<uint8_t> getRaw();
|
||||
void create(const std::string& labelText, const uint16_t heightPixel);
|
||||
void writeToPng(const std::string& file);
|
||||
int getLayoutWidth();
|
||||
int getLayoutHeight();
|
||||
|
||||
private:
|
||||
// methods
|
||||
uint8_t getNumLines(std::string_view str);
|
||||
// members
|
||||
PangoLayout* mLayout;
|
||||
PangoFontDescription* mFontDescription;
|
||||
cairo_surface_t* mSurface;
|
||||
PangoContext* mPangoCtx{nullptr};
|
||||
PangoLayout* mPangoLyt{nullptr};
|
||||
PangoFontDescription* mPangoFontDesc{nullptr};
|
||||
cairo_surface_t* mSurface{nullptr};
|
||||
int mLayoutWidth = 0, mLayoutHeight = 0;
|
||||
int mPrinterHeight = 0;
|
||||
};
|
||||
} // namespace ptprnt::graphics
|
||||
Reference in New Issue
Block a user