Compare commits

...
Sign in to create a new pull request.

9 commits

Author SHA1 Message Date
Fedora Release Engineering
dd8f4d7bb1 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-16 03:34:47 +00:00
Fedora Release Engineering
4354eb2ed9 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 16:53:15 +00:00
Fedora Release Engineering
de67b6abbb Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 10:50:39 +00:00
Fedora Release Engineering
624d7c0ee5 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 16:49:40 +00:00
Hans de Goede
5acc5f254a Fix FTBFS (rhbz#2260975)
Use distro LD_FLAGS when linking
2024-06-15 14:12:13 +02:00
Software Management Team
4abf80ace4 Eliminate use of obsolete %patchN syntax (#2283636) 2024-05-30 12:46:46 +02:00
Fedora Release Engineering
ec4a2a1fd3 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 22:53:14 +00:00
Fedora Release Engineering
f98f30cd1f Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 12:40:10 +00:00
Fedora Release Engineering
50a288f94d Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 13:06:30 +00:00
3 changed files with 346 additions and 5 deletions

View file

@ -0,0 +1,309 @@
diff -up alfont-2.0.9/src/alfont.c~ alfont-2.0.9/src/alfont.c
--- alfont-2.0.9/src/alfont.c~ 2024-06-15 13:56:38.455325588 +0200
+++ alfont-2.0.9/src/alfont.c 2024-06-15 13:56:43.799293099 +0200
@@ -515,7 +515,7 @@ ALFONT_FONT *alfont_load_font_from_mem(c
memcpy((void *)font->data, (void *)data, data_len);
/* load the font */
- error = FT_New_Memory_Face(ft_library, font->data, font->data_size, 0, &font->face);
+ error = FT_New_Memory_Face(ft_library, (const FT_Byte *)font->data, font->data_size, 0, &font->face);
if (error) {
free(font->data);
@@ -609,7 +609,7 @@ void alfont_textout_aa_ex(BITMAP *bmp, A
char *lpszW;
char *lpszW_tmp;
int x_tmp;
- int max_advancex;
+ int max_advancex=0;
char *lpszW_pointer=NULL; //used for freeing string
char *s_pointer=NULL; //used for original string fixed by autofix
char *s_pointer_temp=NULL; //temporary used for autofix string
@@ -618,11 +618,10 @@ void alfont_textout_aa_ex(BITMAP *bmp, A
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
int character;
int alpha_table[256];
- int last_glyph_index;
int first_x=0, final_x=0, final_y=0;
- int curr_uformat;
+ int curr_uformat=0;
int first_flag=TRUE; //First Char flag
- BITMAP *masked_bmp; //the masked bmp used by Font hollow
+ BITMAP *masked_bmp=NULL; //the masked bmp used by Font hollow
#ifdef ALFONT_DOS
iconv_t c_pt;
@@ -889,7 +888,6 @@ void alfont_textout_aa_ex(BITMAP *bmp, A
/* draw char by char (using allegro unicode funcs) */
acquire_bitmap(bmp);
- last_glyph_index = 0;
if (f->fixed_width == TRUE)
{
@@ -978,7 +976,6 @@ void alfont_textout_aa_ex(BITMAP *bmp, A
real_x += v.x >> 6;
real_y += v.y >> 6;
}*/
- last_glyph_index = glyph_index;
/* draw only if exists */
if ((cglyph.aa_available) && (cglyph.aabmp)) {
@@ -1774,18 +1771,18 @@ void alfont_textout_ex(BITMAP *bmp, ALFO
char *lpszW;
char *lpszW_tmp;
int x_tmp;
- int max_advancex;
+ int max_advancex=0;
char *lpszW_pointer=NULL; //used for freeing string
char *s_pointer=NULL; //used for original string fixed by autofix
char *s_pointer_temp=NULL; //temporary used for autofix string
char *precedingchar_pointer=NULL; //used for precedingchar character
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
- int character, last_glyph_index;
+ int character;
int first_x=0, final_x=0, final_y=0;
- int curr_uformat;
+ int curr_uformat=0;
int first_flag=TRUE; //First Char flag
- BITMAP *masked_bmp; //the masked bmp used by Font hollow
+ BITMAP *masked_bmp=NULL; //the masked bmp used by Font hollow
#ifdef ALFONT_DOS
iconv_t c_pt;
size_t fromlen, tolen;
@@ -2026,8 +2023,6 @@ void alfont_textout_ex(BITMAP *bmp, ALFO
/* draw char by char (using allegro unicode funcs) */
acquire_bitmap(bmp);
- last_glyph_index = 0;
-
if (f->fixed_width == TRUE)
{
@@ -2115,7 +2110,6 @@ void alfont_textout_ex(BITMAP *bmp, ALFO
real_x += v.x >> 6;
real_y += v.y >> 6;
}*/
- last_glyph_index = glyph_index;
/* draw only if exists */
if ((cglyph.mono_available) && (cglyph.bmp)) {
@@ -2628,14 +2622,14 @@ int alfont_text_height(ALFONT_FONT *f) {
int alfont_text_length(ALFONT_FONT *f, const char *str) {
char *lpszW;
char *lpszW_tmp;
- int max_advancex;
+ int max_advancex=0;
char *lpszW_pointer=NULL; //used for freeing string
char *str_pointer=NULL; //used for original string fixed by autofix
char *str_pointer_temp=NULL; //temporary used for autofix string
char *precedingchar_pointer=NULL; //used for precedingchar character
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
- int curr_uformat;
+ int curr_uformat=0;
int total_length = 0, character, last_glyph_index;
int glyph_index;
int glyph_index_tmp;
@@ -2953,7 +2947,7 @@ int alfont_text_length(ALFONT_FONT *f, c
}
int alfont_char_length(ALFONT_FONT *f, int character) {
- int curr_uformat;
+ int curr_uformat=0;
int total_length = 0, last_glyph_index;
int glyph_index;
@@ -3034,7 +3028,7 @@ int alfont_text_count(ALFONT_FONT *f, co
char *precedingchar_pointer=NULL; //used for precedingchar character
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
- int curr_uformat;
+ int curr_uformat=0;
int string_count=0;
#ifdef ALFONT_DOS
iconv_t c_pt;
@@ -3282,14 +3276,13 @@ int alfont_text_count(ALFONT_FONT *f, co
int alfont_ugetc(ALFONT_FONT *f, const char *s) {
char *lpszW;
- char *lpszW_pointer=NULL; //used for freeing string
char *s_pointer=NULL; //used for original string fixed by autofix
char *s_pointer_temp=NULL; //temporary used for autofix string
char *precedingchar_pointer=NULL; //used for precedingchar character
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
int character;
- int curr_uformat;
+ int curr_uformat=0;
#ifdef ALFONT_DOS
iconv_t c_pt;
size_t fromlen, tolen;
@@ -3526,20 +3519,16 @@ int alfont_ugetc(ALFONT_FONT *f, const c
int alfont_ugetx(ALFONT_FONT *f, char **s) {
char *lpszW;
- char *lpszW_pointer=NULL; //used for freeing string
char *s_pointer=NULL; //used for original string fixed by autofix
char *s_pointer_temp=NULL; //temporary used for autofix string
char *precedingchar_pointer=NULL; //used for precedingchar character
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
int character;
- int curr_uformat;
+ int curr_uformat=0;
- char *lpszWS;
+ const char *lpszWS;
char *lpszWA;
- int sLen; //length before advances the *s pointer to the next character
- int aLen; //length after advances the *s pointer to the next character
- int lIndex;
#ifdef ALFONT_DOS
iconv_t c_pt;
@@ -3551,8 +3540,6 @@ int alfont_ugetx(ALFONT_FONT *f, char **
return 0;
}
- sLen = strlen(*s);
-
nLen = strlen(*s) + 1;
s_pointer = (char *)malloc(nLen*sizeof(char));
memset(s_pointer, 0, nLen);
@@ -3761,9 +3748,9 @@ int alfont_ugetx(ALFONT_FONT *f, char **
//advances the *s pointer to the next character
if (f->type==1) {
- ugetxc((char**)s);
+ ugetxc((const char**)s);
#ifdef ALFONT_LINUX
- ugetxc((char**)s);
+ ugetxc((const char**)s);
#endif
}
else if(f->type==2) {
@@ -3772,10 +3759,7 @@ int alfont_ugetx(ALFONT_FONT *f, char **
ugetxc(&lpszWS);
#endif
#ifdef ALFONT_DOS
- if ((c_pt = iconv_open(f->language, "UTF-16LE")) == (iconv_t)-1) {
- aLen = strlen(lpszWS);
- }
- else {
+ if ((c_pt = iconv_open(f->language, "UTF-16LE")) != (iconv_t)-1) {
iconv(c_pt, NULL, NULL, NULL, NULL);
fromlen = strlen(lpszWS) + 1;
tolen = MB_CUR_MAX * fromlen * (sizeof(wchar_t) + 1);
@@ -3790,7 +3774,6 @@ int alfont_ugetx(ALFONT_FONT *f, char **
free(lpszWA);
lpszWA = lpszWS
}
- aLen = strlen(lpszWA);
}
#else
setlocale(LC_CTYPE,f->language);
@@ -3798,14 +3781,8 @@ int alfont_ugetx(ALFONT_FONT *f, char **
lpszWA = (char *)malloc(nLen*sizeof(char));
memset(lpszWA, 0, nLen);
wcstombs(lpszWA, (const wchar_t *)lpszWS, nLen);
- aLen = strlen(lpszWA);
#endif
- for (lIndex = 0; lIndex < sLen - aLen; lIndex++)
- {
- (*(*s)++);
- }
-
if (lpszWA) {
free(lpszWA);
}
@@ -3814,9 +3791,9 @@ int alfont_ugetx(ALFONT_FONT *f, char **
#ifdef ALFONT_LINUX
set_uformat(U_UTF8);
#endif
- ugetxc((char**)s);
+ ugetxc((const char**)s);
#ifdef ALFONT_LINUX
- ugetxc((char**)s);
+ ugetxc((const char**)s);
#endif
}
@@ -3842,20 +3819,16 @@ int alfont_ugetx(ALFONT_FONT *f, char **
int alfont_ugetxc(ALFONT_FONT *f, const char **s) {
char *lpszW;
- char *lpszW_pointer=NULL; //used for freeing string
char *s_pointer=NULL; //used for original string fixed by autofix
char *s_pointer_temp=NULL; //temporary used for autofix string
char *precedingchar_pointer=NULL; //used for precedingchar character
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
int character;
- int curr_uformat;
+ int curr_uformat=0;
- char *lpszWS;
+ const char *lpszWS;
char *lpszWA;
- int sLen; //length before advances the *s pointer to the next character
- int aLen; //length after advances the *s pointer to the next character
- int lIndex;
#ifdef ALFONT_DOS
iconv_t c_pt;
@@ -3867,8 +3840,6 @@ int alfont_ugetxc(ALFONT_FONT *f, const
return 0;
}
- sLen = strlen(*s);
-
nLen = strlen(*s) + 1;
s_pointer = (char *)malloc(nLen*sizeof(char));
memset(s_pointer, 0, nLen);
@@ -4088,10 +4059,7 @@ int alfont_ugetxc(ALFONT_FONT *f, const
ugetxc(&lpszWS);
#endif
#ifdef ALFONT_DOS
- if ((c_pt = iconv_open(f->language, "UTF-16LE")) == (iconv_t)-1) {
- aLen = strlen(lpszWS);
- }
- else {
+ if ((c_pt = iconv_open(f->language, "UTF-16LE")) != (iconv_t)-1) {
iconv(c_pt, NULL, NULL, NULL, NULL);
fromlen = strlen(lpszWS) + 1;
tolen = MB_CUR_MAX * fromlen * (sizeof(wchar_t) + 1);
@@ -4106,7 +4074,6 @@ int alfont_ugetxc(ALFONT_FONT *f, const
free(lpszWA);
lpszWA = lpszWS
}
- aLen = strlen(lpszWA);
}
#else
setlocale(LC_CTYPE,f->language);
@@ -4114,14 +4081,8 @@ int alfont_ugetxc(ALFONT_FONT *f, const
lpszWA = (char *)malloc(nLen*sizeof(char));
memset(lpszWA, 0, nLen);
wcstombs(lpszWA, (const wchar_t *)lpszWS, nLen);
- aLen = strlen(lpszWA);
#endif
- for (lIndex = 0; lIndex < sLen - aLen; lIndex++)
- {
- (*(*s)++);
- }
-
if (lpszWA) {
free(lpszWA);
}
@@ -4164,7 +4125,7 @@ int alfont_need_uconvert(ALFONT_FONT *f,
int need_unicode_convert=TRUE;
int nLen;
int ret; //decide that if the ASCII Code convert to Unicode Code is all OK when used for autofix string or used for general convert.
- int curr_uformat;
+ int curr_uformat=0;
#ifdef ALFONT_DOS
iconv_t c_pt;
size_t fromlen, tolen;

4
alfont.rpmlintrc Normal file
View file

@ -0,0 +1,4 @@
# -devel has no docs
addFilter("no-documentation")
# Source0 is not an URL
addFilter("invalid-url")

View file

@ -1,6 +1,6 @@
Name: alfont
Version: 2.0.9
Release: 24%{?dist}
Release: 32%{?dist}
Summary: Font rendering library for the Allegro game library
License: FTL
URL: http://chernsha.sitesled.com/
@ -8,6 +8,7 @@ URL: http://chernsha.sitesled.com/
Source0: %{name}-%{version}.tar.gz
Patch0: alfont-2.0.9-linux.patch
Patch1: alfont-2.0.9-remove-alfont_get_string.patch
Patch2: alfont-2.0.9-build-fixes.patch
BuildRequires: gcc
BuildRequires: allegro-devel freetype-devel
@ -28,11 +29,11 @@ developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1 -z .linux
%patch1 -p1
%autosetup -p1
for i in include/alfont*.h freetype/docs/FTL.TXT; do
sed -i.orig s'/\r//g' $i
iconv -f ISO-8859-1 -t UTF-8 $i > $i.utf8
mv $i.utf8 $i
touch -r $i.orig $i
done
@ -44,6 +45,7 @@ done
gcc -fPIC -DPIC $RPM_OPT_FLAGS -Iinclude `freetype-config --cflags` \
-o src/alfont.o -c src/alfont.c
gcc -shared -Wl,-soname,lib%{name}.so.2 -o lib%{name}.so.%{version} \
$RPM_OPT_FLAGS $RPM_LD_FLAGS \
src/alfont.o $(freetype-config --libs) $(allegro-config --libs)
@ -60,7 +62,8 @@ install -m 644 include/%{name}*.h $RPM_BUILD_ROOT%{_includedir}
%files
%doc CHANGES.txt README.txt freetype/docs/FTL.TXT
%doc CHANGES.txt README.txt
%license freetype/docs/FTL.TXT
%{_libdir}/lib%{name}.so.*
%files devel
@ -69,6 +72,31 @@ install -m 644 include/%{name}*.h $RPM_BUILD_ROOT%{_includedir}
%changelog
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Sat Jun 15 2024 Hans de Goede <hdegoede@redhat.com> - 2.0.9-28
- Fix FTBFS (rhbz#2260975)
- Use distro LD_FLAGS when linking
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild