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 */
50 const SDLPango_Matrix _MATRIX_WHITE_BACK
57 Specifies white back and black letter.
59 const SDLPango_Matrix
*MATRIX_WHITE_BACK
= &_MATRIX_WHITE_BACK
;
61 const SDLPango_Matrix _MATRIX_BLACK_BACK
67 Specifies black back and white letter.
69 const SDLPango_Matrix
*MATRIX_BLACK_BACK
= &_MATRIX_BLACK_BACK
;
71 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
77 Specifies transparent back and black letter.
79 const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_BLACK_LETTER
= &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER
;
81 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
87 Specifies transparent back and white letter.
89 const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_WHITE_LETTER
= &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER
;
91 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
97 Specifies transparent back and transparent letter.
98 This is useful for KARAOKE like rendering.
100 const SDLPango_Matrix
*MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
= &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
;
103 Specifies direction of text. See Pango reference for detail
106 SDLPANGO_DIRECTION_LTR
, /*! Left to right */
107 SDLPANGO_DIRECTION_RTL
, /*! Right to left */
108 SDLPANGO_DIRECTION_WEAK_LTR
, /*! Left to right (weak) */
109 SDLPANGO_DIRECTION_WEAK_RTL
, /*! Right to left (weak) */
110 SDLPANGO_DIRECTION_NEUTRAL
/*! Neutral */
111 } SDLPango_Direction
;
114 Specifies alignment of text. See Pango reference for detail
118 SDLPANGO_ALIGN_CENTER
,
120 } SDLPango_Alignment
;
122 extern DECLSPEC
int SDLCALL
SDLPango_Init();
124 extern DECLSPEC
int SDLCALL
SDLPango_WasInit();
126 extern DECLSPEC SDLPango_Context
* SDLCALL
SDLPango_CreateContext_GivenFontDesc(const char* font_desc
);
127 extern DECLSPEC SDLPango_Context
* SDLCALL
SDLPango_CreateContext();
129 extern DECLSPEC
void SDLCALL
SDLPango_FreeContext(
130 SDLPango_Context
*context
);
132 extern DECLSPEC
void SDLCALL
SDLPango_SetSurfaceCreateArgs(
133 SDLPango_Context
*context
,
136 Uint32 Rmask
, Uint32 Gmask
, Uint32 Bmask
, Uint32 Amask
);
138 extern DECLSPEC SDL_Surface
* SDLCALL
SDLPango_CreateSurfaceDraw(
139 SDLPango_Context
*context
);
141 extern DECLSPEC
void SDLCALL
SDLPango_Draw(
142 SDLPango_Context
*context
,
143 SDL_Surface
*surface
,
146 extern DECLSPEC
void SDLCALL
SDLPango_SetDpi(
147 SDLPango_Context
*context
,
148 double dpi_x
, double dpi_y
);
150 extern DECLSPEC
void SDLCALL
SDLPango_SetMinimumSize(
151 SDLPango_Context
*context
,
152 int width
, int height
);
154 extern DECLSPEC
void SDLCALL
SDLPango_SetDefaultColor(
155 SDLPango_Context
*context
,
156 const SDLPango_Matrix
*color_matrix
);
158 extern DECLSPEC
int SDLCALL
SDLPango_GetLayoutWidth(
159 SDLPango_Context
*context
);
161 extern DECLSPEC
int SDLCALL
SDLPango_GetLayoutHeight(
162 SDLPango_Context
*context
);
164 extern DECLSPEC
void SDLCALL
SDLPango_SetMarkup(
165 SDLPango_Context
*context
,
169 extern DECLSPEC
void SDLCALL
SDLPango_SetText_GivenAlignment(
170 SDLPango_Context
*context
,
173 SDLPango_Alignment alignment
);
175 extern DECLSPEC
void SDLCALL
SDLPango_SetText(
176 SDLPango_Context
*context
,
180 extern DECLSPEC
void SDLCALL
SDLPango_SetLanguage(
181 SDLPango_Context
*context
,
182 const char *language_tag
);
184 extern DECLSPEC
void SDLCALL
SDLPango_SetBaseDirection(
185 SDLPango_Context
*context
,
186 SDLPango_Direction direction
);
189 #ifdef __FT2_BUILD_UNIX_H__
191 extern DECLSPEC
void SDLCALL
SDLPango_CopyFTBitmapToSurface(
192 const FT_Bitmap
*bitmap
,
193 SDL_Surface
*surface
,
194 const SDLPango_Matrix
*matrix
,
197 #endif /* __FT2_BUILD_UNIX_H__ */
202 extern DECLSPEC PangoFontMap
* SDLCALL
SDLPango_GetPangoFontMap(
203 SDLPango_Context
*context
);
205 extern DECLSPEC PangoFontDescription
* SDLCALL
SDLPango_GetPangoFontDescription(
206 SDLPango_Context
*context
);
208 extern DECLSPEC PangoLayout
* SDLCALL
SDLPango_GetPangoLayout(
209 SDLPango_Context
*context
);
211 #endif /* __PANGO_H__ */
218 #include "close_code.h"
220 #endif /* SDL_PANGO_H */