LASi
contextMgr.h
Go to the documentation of this file.
1
7
8#ifndef CONTEXT_MGR_H
9#define CONTEXT_MGR_H
10
11#include <pango/pango.h>
12#include <pango/pangoft2.h>
13#include "manager.h"
14
17class ContextMgr : public Manager<PangoContext*> {
18 public:
20 const char* const lang="en_US.UTF-8",
21 const int dpiX = 72,
22 const int dpiY = 72) {
23 _t = pango_ft2_get_context(dpiX, dpiY);
24 pango_context_set_language(_t, pango_language_from_string(lang));
25 pango_context_set_base_dir(_t, PANGO_DIRECTION_LTR);
26 }
27
29 if (_t && isOwner())
30 g_object_unref(_t);
31 }
32};
33#endif
ContextMgr(const char *const lang="en_US.UTF-8", const int dpiX=72, const int dpiY=72)
Definition contextMgr.h:19
~ContextMgr()
Definition contextMgr.h:28
Manager()
Definition manager.h:29
PangoContext * _t
Definition manager.h:26
bool isOwner() const
Definition manager.h:34
Convert return-code of Freetype library calls to std::runtime_error.