1 /* SDL_Pango.h -- A companion library to SDL for working with Pango.
2 Copyright (C) 2004 NAKAMURA Ken'ichi
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 @brief Header file of SDL_Pango
22 @author NAKAMURA Ken'ichi
29 #define SDL_PANGO_HAS_GC_EXTENSIONS
33 #include "begin_code.h"
41 typedef struct _contextImpl SDLPango_Context
;
44 General 4 X 4 matrix struct.
46 typedef struct _SDLPango_Matrix
{
47 Uint8 m
[4][4]; /*! Matrix variables */
51 Specifies white back and black letter.
53 extern const SDLPango_Matrix
*MATRIX_WHITE_BACK
;
55 Specifies black back and white letter.
57 extern const SDLPango_Matrix
*MATRIX_BLACK_BACK
;
59 Specifies transparent back and black letter.
61 extern const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_BLACK_LETTER
;
63 Specifies transparent back and white letter.
65 extern const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_WHITE_LETTER
;
67 Specifies transparent back and transparent letter.
68 This is useful for KARAOKE like rendering.
70 extern const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
;
73 Specifies direction of text. See Pango reference for detail
76 SDLPANGO_DIRECTION_LTR
, /*! Left to right */
77 SDLPANGO_DIRECTION_RTL
, /*! Right to left */
78 SDLPANGO_DIRECTION_WEAK_LTR
, /*! Left to right (weak) */
79 SDLPANGO_DIRECTION_WEAK_RTL
, /*! Right to left (weak) */
80 SDLPANGO_DIRECTION_NEUTRAL
/*! Neutral */
84 Specifies alignment of text. See Pango reference for detail
88 SDLPANGO_ALIGN_CENTER
,
92 extern DECLSPEC
int SDLCALL
SDLPango_Init();
94 extern DECLSPEC
int SDLCALL
SDLPango_WasInit();
96 extern DECLSPEC SDLPango_Context
* SDLCALL
SDLPango_CreateContext_GivenFontDesc(const char* font_desc
);
97 extern DECLSPEC SDLPango_Context
* SDLCALL
SDLPango_CreateContext();
99 extern DECLSPEC
void SDLCALL
SDLPango_FreeContext(
100 SDLPango_Context
*context
);
102 extern DECLSPEC
void SDLCALL
SDLPango_SetSurfaceCreateArgs(
103 SDLPango_Context
*context
,
106 Uint32 Rmask
, Uint32 Gmask
, Uint32 Bmask
, Uint32 Amask
);
108 extern DECLSPEC SDL_Surface
* SDLCALL
SDLPango_CreateSurfaceDraw(
109 SDLPango_Context
*context
);
111 extern DECLSPEC
void SDLCALL
SDLPango_Draw(
112 SDLPango_Context
*context
,
113 SDL_Surface
*surface
,
116 extern DECLSPEC
void SDLCALL
SDLPango_SetDpi(
117 SDLPango_Context
*context
,
118 double dpi_x
, double dpi_y
);
120 extern DECLSPEC
void SDLCALL
SDLPango_SetMinimumSize(
121 SDLPango_Context
*context
,
122 int width
, int height
);
124 extern DECLSPEC
void SDLCALL
SDLPango_SetDefaultColor(
125 SDLPango_Context
*context
,
126 const SDLPango_Matrix
*color_matrix
);
128 extern DECLSPEC
int SDLCALL
SDLPango_GetLayoutWidth(
129 SDLPango_Context
*context
);
131 extern DECLSPEC
int SDLCALL
SDLPango_GetLayoutHeight(
132 SDLPango_Context
*context
);
134 extern DECLSPEC
void SDLCALL
SDLPango_SetMarkup(
135 SDLPango_Context
*context
,
139 extern DECLSPEC
void SDLCALL
SDLPango_SetText_GivenAlignment(
140 SDLPango_Context
*context
,
143 SDLPango_Alignment alignment
);
145 extern DECLSPEC
void SDLCALL
SDLPango_SetText(
146 SDLPango_Context
*context
,
150 extern DECLSPEC
void SDLCALL
SDLPango_SetLanguage(
151 SDLPango_Context
*context
,
152 const char *language_tag
);
154 extern DECLSPEC
void SDLCALL
SDLPango_SetBaseDirection(
155 SDLPango_Context
*context
,
156 SDLPango_Direction direction
);
159 #ifdef __FT2_BUILD_UNIX_H__
161 extern DECLSPEC
void SDLCALL
SDLPango_CopyFTBitmapToSurface(
162 const FT_Bitmap
*bitmap
,
163 SDL_Surface
*surface
,
164 const SDLPango_Matrix
*matrix
,
167 #endif /* __FT2_BUILD_UNIX_H__ */
172 extern DECLSPEC PangoFontMap
* SDLCALL
SDLPango_GetPangoFontMap(
173 SDLPango_Context
*context
);
175 extern DECLSPEC PangoFontDescription
* SDLCALL
SDLPango_GetPangoFontDescription(
176 SDLPango_Context
*context
);
178 extern DECLSPEC PangoLayout
* SDLCALL
SDLPango_GetPangoLayout(
179 SDLPango_Context
*context
);
181 #endif /* __PANGO_H__ */
188 #include "close_code.h"
190 #endif /* SDL_PANGO_H */