Welcome to mirror list, hosted at ThFree Co, Russian Federation.

freetype.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: efa9aba3faf401305964548fa396f0484020c9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include "base/logging.hpp"

// Put all needed FT includes in one place
#include <ft2build.h>
#include FT_TYPES_H
#include FT_SYSTEM_H
#include FT_FREETYPE_H
#include FT_STROKER_H
#include FT_CACHE_H

struct FreetypeError
{
  int m_code;
  char const * m_message;
};

extern FreetypeError g_FT_Errors[];

#define FREETYPE_CHECK(x) \
  do \
  { \
    FT_Error const err = (x); \
    if (err) \
      LOG(LWARNING, ("Freetype:", g_FT_Errors[err].m_code, g_FT_Errors[err].m_message)); \
  } while (false)

#define FREETYPE_CHECK_RETURN(x, msg) \
  do \
  { \
    FT_Error const err = (x); \
    if (err) \
    { \
      LOG(LWARNING, ("Freetype", g_FT_Errors[err].m_code, g_FT_Errors[err].m_message, msg)); \
      return; \
    } \
  } while (false)