forked from pool/SDL_Pango
This commit is contained in:
commit
15221c142f
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
116
SDL_Pango-0.1.2-API-adds.patch
Normal file
116
SDL_Pango-0.1.2-API-adds.patch
Normal file
@ -0,0 +1,116 @@
|
||||
--- src/SDL_Pango.c 2004-12-10 10:06:33.000000000 +0100
|
||||
+++ src/SDL_Pango.c 2006-09-24 22:46:24.000000000 +0200
|
||||
@@ -723,13 +723,8 @@
|
||||
SDL_UnlockSurface(surface);
|
||||
}
|
||||
|
||||
-/*!
|
||||
- Create a context which contains Pango objects.
|
||||
-
|
||||
- @return A pointer to the context as a SDLPango_Context*.
|
||||
-*/
|
||||
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 @@
|
||||
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 @@
|
||||
}
|
||||
|
||||
/*!
|
||||
+ Create a context which contains Pango objects.
|
||||
+
|
||||
+ @return A pointer to the context as a SDLPango_Context*.
|
||||
+*/
|
||||
+SDLPango_Context*
|
||||
+SDLPango_CreateContext()
|
||||
+{
|
||||
+ SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
|
||||
+}
|
||||
+
|
||||
+/*!
|
||||
Free a context.
|
||||
|
||||
@param *context [i/o] Context to be free
|
||||
@@ -1053,6 +1058,20 @@
|
||||
pango_layout_set_font_description (context->layout, context->font_desc);
|
||||
}
|
||||
|
||||
+void
|
||||
+SDLPango_SetText_GivenAlignment(
|
||||
+ SDLPango_Context *context,
|
||||
+ const char *text,
|
||||
+ int length,
|
||||
+ 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);
|
||||
+}
|
||||
+
|
||||
/*!
|
||||
Set plain text to context.
|
||||
Text must be utf-8.
|
||||
@@ -1067,11 +1086,7 @@
|
||||
const char *text,
|
||||
int length)
|
||||
{
|
||||
- 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, PANGO_ALIGN_LEFT);
|
||||
- pango_layout_set_font_description (context->layout, context->font_desc);
|
||||
+ SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
|
||||
}
|
||||
|
||||
/*!
|
||||
--- src/SDL_Pango.h 2004-12-10 10:06:33.000000000 +0100
|
||||
+++ src/SDL_Pango.h 2006-09-24 22:46:01.000000000 +0200
|
||||
@@ -109,12 +109,20 @@
|
||||
SDLPANGO_DIRECTION_NEUTRAL /*! Neutral */
|
||||
} SDLPango_Direction;
|
||||
|
||||
-
|
||||
+/*!
|
||||
+ Specifies alignment of text. See Pango reference for detail
|
||||
+*/
|
||||
+typedef enum {
|
||||
+ SDLPANGO_ALIGN_LEFT,
|
||||
+ SDLPANGO_ALIGN_CENTER,
|
||||
+ SDLPANGO_ALIGN_RIGHT
|
||||
+} SDLPango_Alignment;
|
||||
|
||||
extern DECLSPEC int SDLCALL SDLPango_Init();
|
||||
|
||||
extern DECLSPEC int SDLCALL SDLPango_WasInit();
|
||||
|
||||
+extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc);
|
||||
extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
|
||||
|
||||
extern DECLSPEC void SDLCALL SDLPango_FreeContext(
|
||||
@@ -157,6 +165,12 @@
|
||||
const char *markup,
|
||||
int length);
|
||||
|
||||
+extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment(
|
||||
+ SDLPango_Context *context,
|
||||
+ const char *text,
|
||||
+ int length,
|
||||
+ SDLPango_Alignment alignment);
|
||||
+
|
||||
extern DECLSPEC void SDLCALL SDLPango_SetText(
|
||||
SDLPango_Context *context,
|
||||
const char *markup,
|
3
SDL_Pango-0.1.2.tar.gz
Normal file
3
SDL_Pango-0.1.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7f75d3b97acf707c696ea126424906204ebfa07660162de925173cdd0257eba4
|
||||
size 405967
|
5
SDL_Pango.changes
Normal file
5
SDL_Pango.changes
Normal file
@ -0,0 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Oct 29 19:16:21 CET 2006 - sndirsch@suse.de
|
||||
|
||||
- created package
|
||||
|
83
SDL_Pango.spec
Normal file
83
SDL_Pango.spec
Normal file
@ -0,0 +1,83 @@
|
||||
#
|
||||
# spec file for package SDL_Pango (Version 0.1.2)
|
||||
#
|
||||
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
# package are under the same license as the package itself.
|
||||
#
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
Name: SDL_Pango
|
||||
BuildRequires: SDL-devel fontconfig-devel freetype2-devel pango-devel pkgconfig
|
||||
URL: http://sdlpango.sourceforge.net/
|
||||
License: GNU Library General Public License v. 2.0 and 2.1 (LGPL)
|
||||
Group: System/Libraries
|
||||
Autoreqprov: on
|
||||
Version: 0.1.2
|
||||
Release: 1
|
||||
Summary: Programming Pango via SDL
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
Patch: %{name}-0.1.2-API-adds.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
Pango is the text rendering engine of GNOME 2.x. SDL_Pango connects the
|
||||
engine to SDL.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
NAKAMURA Ken'ichi
|
||||
|
||||
%package devel
|
||||
Summary: Include Files and Libraries mandatory for Development.
|
||||
Group: System/Libraries
|
||||
Requires: SDL_Pango
|
||||
Autoreqprov: on
|
||||
|
||||
%description devel
|
||||
This package contains all necessary include files and libraries needed
|
||||
to develop applications that require these.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
NAKAMURA Ken'ichi
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%patch
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%_libdir
|
||||
make 2>&1 | grep -v 767
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS COPYING README
|
||||
/usr/%{_lib}/libSDL_Pango.so.1
|
||||
/usr/%{_lib}/libSDL_Pango.so.1.1.0
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
/usr/include/SDL_Pango.h
|
||||
/usr/%{_lib}/pkgconfig/SDL_Pango.pc
|
||||
/usr/%{_lib}/libSDL_Pango.a
|
||||
/usr/%{_lib}/libSDL_Pango.la
|
||||
/usr/%{_lib}/libSDL_Pango.so
|
||||
|
||||
%changelog -n SDL_Pango
|
||||
* Sun Oct 29 2006 - sndirsch@suse.de
|
||||
- created package
|
Loading…
Reference in New Issue
Block a user