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
32 #include "begin_code.h"
40 typedef struct _contextImpl SDLPango_Context
;
43 General 4 X 4 matrix struct.
45 typedef struct _SDLPango_Matrix
{
46 Uint8 m
[4][4]; /*! Matrix variables */
49 const SDLPango_Matrix _MATRIX_WHITE_BACK
56 Specifies white back and black letter.
58 const SDLPango_Matrix
*MATRIX_WHITE_BACK
= &_MATRIX_WHITE_BACK
;
60 const SDLPango_Matrix _MATRIX_BLACK_BACK
66 Specifies black back and white letter.
68 const SDLPango_Matrix
*MATRIX_BLACK_BACK
= &_MATRIX_BLACK_BACK
;
70 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
76 Specifies transparent back and black letter.
78 const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_BLACK_LETTER
= &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER
;
80 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
86 Specifies transparent back and white letter.
88 const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_WHITE_LETTER
= &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER
;
90 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
96 Specifies transparent back and transparent letter.
97 This is useful for KARAOKE like rendering.
99 const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
= &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
;
102 Specifies direction of text. See Pango reference for detail
105 SDLPANGO_DIRECTION_LTR
, /*! Left to right */
106 SDLPANGO_DIRECTION_RTL
, /*! Right to left */
107 SDLPANGO_DIRECTION_WEAK_LTR
, /*! Left to right (weak) */
108 SDLPANGO_DIRECTION_WEAK_RTL
, /*! Right to left (weak) */
109 SDLPANGO_DIRECTION_NEUTRAL
/*! Neutral */
110 } SDLPango_Direction
;
114 extern DECLSPEC
int SDLCALL
SDLPango_Init();
116 extern DECLSPEC
int SDLCALL
SDLPango_WasInit();
118 extern DECLSPEC SDLPango_Context
* SDLCALL
SDLPango_CreateContext();
120 extern DECLSPEC
void SDLCALL
SDLPango_FreeContext(
121 SDLPango_Context
*context
);
123 extern DECLSPEC
void SDLCALL
SDLPango_SetSurfaceCreateArgs(
124 SDLPango_Context
*context
,
127 Uint32 Rmask
, Uint32 Gmask
, Uint32 Bmask
, Uint32 Amask
);
129 extern DECLSPEC SDL_Surface
* SDLCALL
SDLPango_CreateSurfaceDraw(
130 SDLPango_Context
*context
);
132 extern DECLSPEC
void SDLCALL
SDLPango_Draw(
133 SDLPango_Context
*context
,
134 SDL_Surface
*surface
,
137 extern DECLSPEC
void SDLCALL
SDLPango_SetDpi(
138 SDLPango_Context
*context
,
139 double dpi_x
, double dpi_y
);
141 extern DECLSPEC
void SDLCALL
SDLPango_SetMinimumSize(
142 SDLPango_Context
*context
,
143 int width
, int height
);
145 extern DECLSPEC
void SDLCALL
SDLPango_SetDefaultColor(
146 SDLPango_Context
*context
,
147 const SDLPango_Matrix
*color_matrix
);
149 extern DECLSPEC
int SDLCALL
SDLPango_GetLayoutWidth(
150 SDLPango_Context
*context
);
152 extern DECLSPEC
int SDLCALL
SDLPango_GetLayoutHeight(
153 SDLPango_Context
*context
);
155 extern DECLSPEC
void SDLCALL
SDLPango_SetMarkup(
156 SDLPango_Context
*context
,
160 extern DECLSPEC
void SDLCALL
SDLPango_SetText(
161 SDLPango_Context
*context
,
165 extern DECLSPEC
void SDLCALL
SDLPango_SetLanguage(
166 SDLPango_Context
*context
,
167 const char *language_tag
);
169 extern DECLSPEC
void SDLCALL
SDLPango_SetBaseDirection(
170 SDLPango_Context
*context
,
171 SDLPango_Direction direction
);
174 #ifdef __FT2_BUILD_UNIX_H__
176 extern DECLSPEC
void SDLCALL
SDLPango_CopyFTBitmapToSurface(
177 const FT_Bitmap
*bitmap
,
178 SDL_Surface
*surface
,
179 const SDLPango_Matrix
*matrix
,
182 #endif /* __FT2_BUILD_UNIX_H__ */
187 extern DECLSPEC PangoFontMap
* SDLCALL
SDLPango_GetPangoFontMap(
188 SDLPango_Context
*context
);
190 extern DECLSPEC PangoFontDescription
* SDLCALL
SDLPango_GetPangoFontDescription(
191 SDLPango_Context
*context
);
193 extern DECLSPEC PangoLayout
* SDLCALL
SDLPango_GetPangoLayout(
194 SDLPango_Context
*context
);
196 #endif /* __PANGO_H__ */
203 #include "close_code.h"
205 #endif /* SDL_PANGO_H */