1
0
forked from pool/SDL_Pango

[info=b0f7f07cdc3e0457510d84361a8efef9121f4d2ffc8ed7dbf004b33a8b5fe8f3]

OBS-URL: https://build.opensuse.org/package/show/games/SDL_Pango?expand=0&rev=27
This commit is contained in:
Jan Engelhardt 2024-08-21 12:31:48 +00:00 committed by Git OBS Bridge
commit 5f2e8d1224
8 changed files with 342 additions and 0 deletions

23
.gitattributes vendored Normal file
View 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
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,125 @@
---
src/SDL_Pango.c | 41 ++++++++++++++++++++++++++++-------------
src/SDL_Pango.h | 16 +++++++++++++++-
2 files changed, 43 insertions(+), 14 deletions(-)
Index: SDL_Pango-0.1.2/src/SDL_Pango.c
===================================================================
--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c
+++ SDL_Pango-0.1.2/src/SDL_Pango.c
@@ -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_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_Context*
+SDLPango_CreateContext()
+{
+ return 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 @@ SDLPango_SetMarkup(
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 @@ SDLPango_SetText(
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);
}
/*!
Index: SDL_Pango-0.1.2/src/SDL_Pango.h
===================================================================
--- SDL_Pango-0.1.2.orig/src/SDL_Pango.h
+++ SDL_Pango-0.1.2/src/SDL_Pango.h
@@ -109,12 +109,20 @@ typedef enum {
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 @@ extern DECLSPEC void SDLCALL SDLPango_Se
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.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:872666d607e5bbffee0f57c2089e06dc168bb632efa26b7608cb422eaf9b3aeb
size 267712

96
SDL_Pango.changes Normal file
View File

@ -0,0 +1,96 @@
-------------------------------------------------------------------
Wed May 18 16:00:45 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Remove baselibs.conf, nothing appears to be using it.
- Change -devel subpackage to be based on SRPM/project name.
- Use pkgconfig(sdl) to build with sdl12_compat.
-------------------------------------------------------------------
Sat May 11 12:23:35 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Remove --with-pic (ineffective with --disable-static)
-------------------------------------------------------------------
Sat May 11 07:35:31 UTC 2019 - Luigi Baldoni <aloisio@gmx.com>
- Add cairo as dependency for pango (fixes Factory build)
- Spec cleanup
-------------------------------------------------------------------
Thu Jan 8 09:06:11 UTC 2015 - jengelh@inai.de
- Use pkgconfig() symbols for pulling in BuildRequires
-------------------------------------------------------------------
Thu Jan 30 14:29:07 UTC 2014 - jengelh@inai.de
- Some metadata spruce-up: add current URLs, softer wildcarding
in the files list, more robust make install call
-------------------------------------------------------------------
Mon Nov 11 03:47:15 UTC 2013 - jengelh@inai.de
- Set RPM groups to the same values as on the main SDL packages
-------------------------------------------------------------------
Wed Apr 17 14:49:54 UTC 2013 - dimstar@opensuse.org
- Add libtool BuildRequires and call to autoreconf: even though we
don't have any patches, we need to bootstrap, as the ancient
./libtool in the tarball (version 1.5) fails to work on recent
Builders, resulting in linker errors.
-------------------------------------------------------------------
Thu Jan 3 02:31:49 UTC 2013 - crrodriguez@opensuse.org
- Remove fontconfig-devel freetype2-devel which are not
really BuildRequired.
-------------------------------------------------------------------
Fri Sep 16 18:19:36 UTC 2011 - jengelh@medozas.de
- Add libSDL_Pango-devel to baselibs
- Remove reundant tags/ssections
-------------------------------------------------------------------
Sat Jul 2 14:51:05 UTC 2011 - jengelh@medozas.de
- Use %_smp_mflags for parallel building
- Strip %clean section (not needed on BS)
-------------------------------------------------------------------
Wed Jan 27 02:36:01 CET 2010 - jengelh@medozas.de
- package baselibs.conf
-------------------------------------------------------------------
Wed Oct 7 14:52:17 CEST 2009 - prusnak@suse.cz
- fix provides and obsoletes [bnc#544957]
-------------------------------------------------------------------
Wed Jun 3 13:30:54 CEST 2009 - coolo@novell.com
- fix requires of devel package
-------------------------------------------------------------------
Wed May 20 15:37:01 CEST 2009 - prusnak@suse.cz
- follow Shared Library Policy
-------------------------------------------------------------------
Thu Jun 26 22:56:36 CEST 2008 - crrodriguez@suse.de
- disable unusable static libraries
- SDL_Pango-devel should require SDL-devel
-------------------------------------------------------------------
Thu Dec 27 04:13:56 CET 2007 - crrodriguez@suse.de
- fix library-without-ldconfig-* errors
-------------------------------------------------------------------
Sun Oct 29 19:16:21 CET 2006 - sndirsch@suse.de
- created package

87
SDL_Pango.spec Normal file
View File

@ -0,0 +1,87 @@
#
# spec file for package SDL_Pango
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define lname libSDL_Pango1
Name: SDL_Pango
Version: 0.1.2
Release: 0
Summary: Programming Pango via SDL
License: LGPL-2.1-or-later
Group: Development/Libraries/X11
URL: http://sdlpango.sourceforge.net/
#CVS-Clone: -d:pserver:anonymous@sdlpango.cvs.sourceforge.net:/cvsroot/sdlpango co -P SDL_Pango
Source: %name-%version.tar.bz2
Patch1: %name-%version-API-adds.patch
BuildRequires: dos2unix
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(pango)
BuildRequires: pkgconfig(sdl)
%description
Pango is the text rendering engine of GNOME 2.x. SDL_Pango connects the
engine to SDL.
%package -n %lname
Summary: Programming Pango via SDL
Group: System/Libraries
%description -n %lname
Pango is the text rendering engine of GNOME 2.x. SDL_Pango connects the
engine to SDL.
%package devel
Summary: Headers for SDL_Pango development
Group: Development/Libraries/X11
Requires: %lname = %version
Requires: pkgconfig(sdl)
Provides: libSDL_Pango-devel = %version-%release
Obsoletes: libSDL_Pango-devel < %version-%release
%description devel
This package contains the necessary include files and libraries needed
to develop applications that require SDL_Pango.
%prep
%autosetup -p1
dos2unix AUTHORS README
%build
autoreconf -fiv
%configure --disable-static
%make_build
%install
%make_install
find %buildroot -type f -name "*.la" -delete -print
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%files -n %lname
%license COPYING
%doc AUTHORS README
%_libdir/libSDL_Pango.so.*
%files devel
%_includedir/SDL_Pango.h
%_libdir/pkgconfig/SDL_Pango.pc
%_libdir/libSDL_Pango.so
%changelog

4
_scmsync.obsinfo Normal file
View File

@ -0,0 +1,4 @@
mtime: 1652993361
commit: b0f7f07cdc3e0457510d84361a8efef9121f4d2ffc8ed7dbf004b33a8b5fe8f3
url: https://src.opensuse.org/jengelh/SDL_Pango
revision: master

3
build.specials.obscpio Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:edb3a0f4d4209968ff0c9522515592abeb1e60ec7ce21933c537d1a54630235a
size 256