Adding support for sdl2pango, Thanks Jianwei Zhang
This commit is contained in:
parent
52dd490579
commit
4e8c5287ed
2 changed files with 28 additions and 2 deletions
28
src/fonts.c
28
src/fonts.c
|
|
@ -118,7 +118,7 @@ SDL_Thread *font_thread;
|
||||||
|
|
||||||
#ifndef NO_SDLPANGO
|
#ifndef NO_SDLPANGO
|
||||||
|
|
||||||
#include "SDL_Pango.h"
|
#include "SDL2_Pango.h"
|
||||||
#if !defined(SDL_PANGO_H)
|
#if !defined(SDL_PANGO_H)
|
||||||
#error "---------------------------------------------------"
|
#error "---------------------------------------------------"
|
||||||
#error "If you installed SDL_Pango from a package, be sure"
|
#error "If you installed SDL_Pango from a package, be sure"
|
||||||
|
|
@ -1622,6 +1622,32 @@ const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf)
|
||||||
|
|
||||||
#ifndef NO_SDLPANGO
|
#ifndef NO_SDLPANGO
|
||||||
|
|
||||||
|
void ssdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix * pango_color)
|
||||||
|
{
|
||||||
|
Uint8 pc[4][4];
|
||||||
|
|
||||||
|
pc[0][0] = 0;
|
||||||
|
pc[1][0] = 0;
|
||||||
|
pc[2][0] = 0;
|
||||||
|
pc[3][0] = 0;
|
||||||
|
|
||||||
|
pc[0][1] = 0;
|
||||||
|
pc[1][1] = 0;
|
||||||
|
pc[2][1] = 0;
|
||||||
|
pc[3][1] = 0;
|
||||||
|
|
||||||
|
pc[0][2] = 0;
|
||||||
|
pc[1][2] = 0;
|
||||||
|
pc[2][2] = 0;
|
||||||
|
pc[3][2] = 0;
|
||||||
|
|
||||||
|
pc[0][3] = 0;
|
||||||
|
pc[1][3] = 0;
|
||||||
|
pc[2][3] = 0;
|
||||||
|
pc[3][3] = 0;
|
||||||
|
|
||||||
|
memcpy(pango_color, pc, 16);
|
||||||
|
}
|
||||||
void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix * pango_color)
|
void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix * pango_color)
|
||||||
{
|
{
|
||||||
Uint8 pc[4][4];
|
Uint8 pc[4][4];
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
#include "SDL_ttf.h"
|
#include "SDL_ttf.h"
|
||||||
|
|
||||||
#ifndef NO_SDLPANGO
|
#ifndef NO_SDLPANGO
|
||||||
#include "SDL_Pango.h"
|
#include "SDL2_Pango.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PANGO_DEFAULT_FONT "BitStream Vera"
|
#define PANGO_DEFAULT_FONT "BitStream Vera"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue