--- src/SDL_Pango.c.orig 2004-12-10 20:06:33.000000000 +1100
+++ src/SDL_Pango.c 2014-07-28 00:32:29.000000000 +1000
@@ -723,13 +723,8 @@ SDLPango_CopyFTBitmapToSurface(
SDL_UnlockSurface(surface);
- Create a context which contains Pango objects.
- @return A pointer to the context as a SDLPango_Context*.
-SDLPango_CreateContext()
+SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
G_CONST_RETURN char *charset;
@@ -743,8 +738,7 @@ SDLPango_CreateContext()
pango_context_set_language (context->context, pango_language_from_string (charset));
pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
- context->font_desc = pango_font_description_from_string(
- MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
+ context->font_desc = pango_font_description_from_string(font_desc);
context->layout = pango_layout_new (context->context);
@@ -762,6 +756,17 @@ SDLPango_CreateContext()
+ Create a context which contains Pango objects.
+ @return A pointer to the context as a SDLPango_Context*.
+SDLPango_CreateContext()
+ SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
@param *context [i/o] Context to be free
@@ -1053,6 +1058,20 @@ SDLPango_SetMarkup(
pango_layout_set_font_description (context->layout, context->font_desc);
+SDLPango_SetText_GivenAlignment(
+ SDLPango_Context *context,
+ SDLPango_Alignment alignment)
+ pango_layout_set_attributes(context->layout, NULL);
+ pango_layout_set_text (context->layout, text, length);
+ pango_layout_set_auto_dir (context->layout, TRUE);
+ pango_layout_set_alignment (context->layout, alignment);
+ pango_layout_set_font_description (context->layout, context->font_desc);