1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../libsdl_pango/0.1.2-API-adds.patch
5 # Copyright (C) 2007 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- ./src/SDL_Pango.c 2004-12-10 10:06:33.000000000 +0100
18 +++ ./src/SDL_Pango.c 2006-09-24 22:46:24.000000000 +0200
20 SDL_UnlockSurface(surface);
24 - Create a context which contains Pango objects.
26 - @return A pointer to the context as a SDLPango_Context*.
29 -SDLPango_CreateContext()
30 +SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
32 SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
33 G_CONST_RETURN char *charset;
35 pango_context_set_language (context->context, pango_language_from_string (charset));
36 pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
38 - context->font_desc = pango_font_description_from_string(
39 - MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
40 + context->font_desc = pango_font_description_from_string(font_desc);
42 context->layout = pango_layout_new (context->context);
48 + Create a context which contains Pango objects.
50 + @return A pointer to the context as a SDLPango_Context*.
53 +SDLPango_CreateContext()
55 + SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
61 @param *context [i/o] Context to be free
62 @@ -1053,6 +1058,20 @@
63 pango_layout_set_font_description (context->layout, context->font_desc);
67 +SDLPango_SetText_GivenAlignment(
68 + SDLPango_Context *context,
71 + SDLPango_Alignment alignment)
73 + pango_layout_set_attributes(context->layout, NULL);
74 + pango_layout_set_text (context->layout, text, length);
75 + pango_layout_set_auto_dir (context->layout, TRUE);
76 + pango_layout_set_alignment (context->layout, alignment);
77 + pango_layout_set_font_description (context->layout, context->font_desc);
81 Set plain text to context.
83 @@ -1067,11 +1086,7 @@
87 - pango_layout_set_attributes(context->layout, NULL);
88 - pango_layout_set_text (context->layout, text, length);
89 - pango_layout_set_auto_dir (context->layout, TRUE);
90 - pango_layout_set_alignment (context->layout, PANGO_ALIGN_LEFT);
91 - pango_layout_set_font_description (context->layout, context->font_desc);
92 + SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
96 --- ./src/SDL_Pango.h 2004-12-10 10:06:33.000000000 +0100
97 +++ .//src/SDL_Pango.h 2006-09-24 22:46:01.000000000 +0200
99 SDLPANGO_DIRECTION_NEUTRAL /*! Neutral */
100 } SDLPango_Direction;
104 + Specifies alignment of text. See Pango reference for detail
107 + SDLPANGO_ALIGN_LEFT,
108 + SDLPANGO_ALIGN_CENTER,
109 + SDLPANGO_ALIGN_RIGHT
110 +} SDLPango_Alignment;
112 extern DECLSPEC int SDLCALL SDLPango_Init();
114 extern DECLSPEC int SDLCALL SDLPango_WasInit();
116 +extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc);
117 extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
119 extern DECLSPEC void SDLCALL SDLPango_FreeContext(
124 +extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment(
125 + SDLPango_Context *context,
128 + SDLPango_Alignment alignment);
130 extern DECLSPEC void SDLCALL SDLPango_SetText(
131 SDLPango_Context *context,