Compare commits

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

81 commits

Author SHA1 Message Date
Parag Nemade
5e74208b9f
Remove upstreamed patches and add new BR: gtkmm3.0-devel 2025-10-10 17:44:14 +05:30
Parag Nemade
7f20c24b80
Update to 20251009 version (#2402960) 2025-10-10 13:37:13 +05:30
Fedora Release Engineering
c75fc28323 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 20:41:11 +00:00
Parag Nemade
24f3eadd43
Update for https://fedoraproject.org/wiki/Changes/CMake_ninja_default (rh#2381004) 2025-07-17 21:49:13 +05:30
Parag Nemade
a138beedb9
Add tmt testcase for CI 2025-07-14 12:45:23 +05:30
Python Maint
cf776b6630 Rebuilt for Python 3.14 2025-06-03 11:00:02 +02:00
Fedora Release Engineering
6281667ef9 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 18:36:29 +00:00
Fedora Release Engineering
943eb5ee68 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 23:26:23 +00:00
Gwyn Ciesla
4655f4dc09 Fix 3.13 build 2024-06-14 16:33:07 -05:00
Python Maint
6b1f80e697 Rebuilt for Python 3.13 2024-06-07 14:06:53 +02:00
Parag Nemade
fe895d729a
Resolves: CVE-2024-25081 and CVE-2024-25082
Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
2024-02-28 08:19:45 +05:30
Fedora Release Engineering
4176584577 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 11:51:49 +00:00
Fedora Release Engineering
a3c550aa4b Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 19:36:31 +00:00
Yaakov Selkowitz
44b91146ba Drop unused libuninameslist dependency
libuninameslist usage was replaced by an internal implemenation since
the 20220308 release:

70b572a6c2
2023-08-10 12:09:48 -04:00
Yaakov Selkowitz
da3ade2e6a Allow potrace as an alternative to autotrace
Both autotrace and potrace are supported for bitmap to vector graphics
conversion.  For flatpaks, potrace is preferred because it is standalone
compared to autotrace which (through ImageMagick and pstoedit) has a
large dependency tree.
2023-08-07 22:55:59 -04:00
Fedora Release Engineering
92fda056ca Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 20:02:08 +00:00
Parag Nemade
a0d98a2fed
Fix fr.po and it.po translations issue 2023-07-07 10:21:36 +05:30
Yaakov Selkowitz
ea47237236 Fix build with gettext-0.22
Submitted upstream: https://github.com/fontforge/fontforge/pull/5257
2023-07-06 20:06:51 -04:00
Python Maint
ba74354a1f Rebuilt for Python 3.12 2023-06-14 06:12:48 +02:00
Fedora Release Engineering
54cb628890 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 03:43:32 +00:00
Parag Nemade
cdf87bab37
Update license tag to SPDX format
Fix test failure
2023-01-02 07:59:53 +05:30
Parag Nemade
c2ec7785ce
Update to 20230101 version (#2157290) 2023-01-02 06:48:27 +05:30
Fedora Release Engineering
6da6fbfa3f Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 03:27:19 +00:00
Python Maint
6e22214d83 Rebuilt for Python 3.11 2022-06-13 18:17:16 +02:00
Parag Nemade
85374d27b4
Update to 20220308 version (#2062047)
Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
2022-03-10 15:40:35 +05:30
Fedora Release Engineering
48dd3344da - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 03:15:55 +00:00
Fedora Release Engineering
64b0d7999f - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 23:12:39 +00:00
Python Maint
14403c18b9 Rebuilt for Python 3.10 2021-06-04 20:04:31 +02:00
Parag Nemade
a52e677318
The %find_lang should run as part of %install only 2021-02-01 16:57:43 +05:30
Fedora Release Engineering
d753e93388 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 05:47:02 +00:00
Tom Stellard
9a8e1f87c5 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2020-12-18 22:47:56 +00:00
Parag Nemade
58a47602b9
Update to 20201107 version (#1895648)
Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
2020-11-25 14:28:22 +05:30
Benjamin Beasley
8d8438727b Add py_provides macros to provide python3-fontforge, python3-psMat, etc. 2020-11-23 15:38:19 -05:00
Parag Nemade
7c86859576
Fix FTBFS bug by fixing glossary.rst and using new CMake macros 2020-08-05 15:27:09 +05:30
Fedora Release Engineering
d970007d87 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 01:02:25 +00:00
Fedora Release Engineering
8dfb846928 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 17:41:17 +00:00
Miro Hrončok
fec2fdf263 Rebuilt for Python 3.9 2020-05-26 02:45:38 +02:00
Parag Nemade
af582c2347
Resolves:rhbz#1830502 - Add missing WOFF2 support 2020-05-02 16:17:56 +05:30
Parag Nemade
cf517d7106
Resolves:rhbz#1823525 - fontforge fails to build with Sphinx 3.0.0 2020-04-15 20:42:48 +05:30
Parag Nemade
58f23472d6
Fix the GDK backend UI issues
Move back to using GDK backend
2020-04-03 10:57:51 +05:30
Parag Nemade
18fb9f7e74
Enabled X11 and 2012 theme 2020-03-27 22:12:10 +05:30
Parag Nemade
00599859f7
Update to 20200314 version (#1813578) 2020-03-25 23:02:52 +05:30
Parag Nemade
7f6f786c73
another fix for rh#1790042 - CVE-2020-5395:out-of-bounds write in sfd.c 2020-02-18 13:48:19 +05:30
Fedora Release Engineering
afbac9327c - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 18:48:23 +00:00
Parag Nemade
13ee59152e
Resolves:rh#1790042 - CVE-2020-5395:out-of-bounds write in sfd.c 2020-01-16 14:27:07 +05:30
Kevin Fenzi
f6215c5a27 Rebuild for new libspiro 2019-08-27 11:53:50 -07:00
Miro Hrončok
82740defde Rebuilt for Python 3.8 2019-08-19 10:14:05 +02:00
Parag Nemade
cc4a787ff8
Remove unnecessary patches
Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
2019-08-15 21:45:25 +05:30
Parag Nemade
8603e03a6e
Update to 20190801 version (#1739819)
Upstream moved to use Glib's GHashTable over uthash
Upstream dropped requiring bundling copy of gnulib

Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
2019-08-15 21:34:59 +05:30
Parag Nemade
da0aa264e8
Fix the conditional for rh#1728058 2019-08-02 18:28:33 +05:30
Fedora Release Engineering
3beb9187e3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 00:51:25 +00:00
Parag Nemade
2777b437f1
make the code compatible with python-3.8 (rh#1728058) 2019-07-24 08:15:56 +05:30
Parag Nemade
c32eb35d45
Fix tests.yml 2019-05-14 18:45:36 +05:30
Parag Nemade
1a47dd7bd9
oops something went wrong while rebasing PR, fixing filename 2019-05-14 17:27:22 +05:30
Parag Nemade
986be4acb0
Added CI tests
Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
2019-05-14 16:46:16 +05:30
Parag Nemade
49ebe60582
Update to 20190413 version (#1689629) 2019-04-13 21:19:22 +05:30
Parag Nemade
3bd08274a0
Update to 20190317 release (#1689629) 2019-03-25 11:02:51 +05:30
Igor Gnatenko
4e0eb6062d Rebuild for readline 8.0 2019-02-17 09:30:50 +01:00
Fedora Release Engineering
56025b7dd7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 19:58:38 +00:00
Miro Hrončok
91aa35266a Rebuilt for #1595421 2018-07-23 13:54:00 +02:00
Fedora Release Engineering
2e81aab957 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 00:44:11 +00:00
Kevin Fenzi
32aedac9ce Drop unneeded ldconfig calls 2018-07-07 13:31:11 -07:00
Kevin Fenzi
2096b6dc39 Update bundled gnulib. Fixes bug #1596037 2018-07-04 13:27:24 -07:00
Miro Hrončok
4482743bcd Rebuilt for Python 3.7.0 final (#1595421) 2018-06-28 11:51:20 +02:00
Miro Hrončok
7286988ddc Rebuilt for Python 3.7 2018-06-19 10:43:07 +02:00
Sandro Mani
4a862497c3 BR libungif-devel -> giflib-devel 2018-02-11 22:55:42 +01:00
Sandro Mani
8e1adfb293 Rebuild (giflib) 2018-02-11 21:52:07 +01:00
Fedora Release Engineering
4244f47da6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 09:57:16 +00:00
Igor Gnatenko
23e331527b Remove obsolete scriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-11 14:51:29 +01:00
Fedora Release Engineering
5bced5a809 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 20:42:10 +00:00
Parag A Nemade
ee0ada2a7e
Update to 20170731 2017-07-31 13:03:42 +05:30
Fedora Release Engineering
846058b09e - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 08:36:55 +00:00
Parag A Nemade
737ec2b2a2
Resolves:rh#1429574 - [abrt] fontforge: PyFF_OpenFont(): fontforge killed by signal 6
Added patch to fix python module for python3.6
2017-03-09 22:23:58 +05:30
Parag A Nemade
c804f4be9d
Add missing BR: git 2017-02-18 19:42:13 +05:30
Fedora Release Engineering
346c18e867 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 09:55:02 +00:00
Igor Gnatenko
d13c60d5e5 Rebuild for readline 7.x
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-01-12 17:30:26 +01:00
Miro Hrončok
1ac79b40cc Rebuild for Python 3.6 2016-12-19 18:20:36 +01:00
Parag A Nemade
5f043b2186
Update to 20161012 2016-10-13 12:12:27 +05:30
Parag A Nemade
e05c58279c
Update to 20161005 2016-10-06 09:58:04 +05:30
Parag A Nemade
b832b40e04
Update to 20161004 2016-10-05 12:48:11 +05:30
Parag A Nemade
73cd69a4c4
Update to 20161001 2016-10-03 13:39:58 +05:30
21 changed files with 800 additions and 2312 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

12
.gitignore vendored
View file

@ -13,3 +13,15 @@ fontforge_full-20100501.tar.bz2
/20150612.tar.gz
/fontforge-20150824.tar.gz
/fontforge-20160404.tar.gz
/fontforge-20161001.tar.gz
/fontforge-20161004.tar.gz
/fontforge-20161005.tar.gz
/fontforge-20161012.tar.gz
/fontforge-20170731.tar.gz
/gnulib-b324052.tar.gz
/fontforge-20190317.tar.gz
/fontforge-20190413.tar.gz
/fontforge-20200314.tar.gz
/fontforge-20201107.tar.gz
/fontforge-20230101.tar.gz
/fontforge-20251009.tar.gz

View file

@ -0,0 +1,181 @@
From 472e238cafcff113c7be9815a13ff864540d5ef9 Mon Sep 17 00:00:00 2001
From: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Thu, 6 Jul 2023 19:15:53 -0400
Subject: [PATCH] Fix errors in French and Italian translations
With gettext-0.22, these mismatches trigger errors:
'msgstr' is not a valid C format string, unlike 'msgid'. Reason: In the
directive number 2, the argument size specifier is invalid.
---
po/fr.po | 36 ++++++++++++++++++------------------
po/it.po | 8 ++++----
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/po/fr.po b/po/fr.po
index 26e446b38..cb492d7a0 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -291,7 +291,7 @@ msgstr "chaîne %1$.30s pour %2$.30s"
#. GT: $4 is the changed flag ('*' for the changed items)
#, c-format
msgid "%1$.80s at %2$d from %3$.90s%4$s"
-msgstr "%1$.80s à %2$d de %3$.90hs%4$s"
+msgstr "%1$.80s à %2$d de %3$.90s%4$s"
#. GT: This is the title for a window showing a bitmap character
#. GT: It will look something like:
@@ -302,7 +302,7 @@ msgstr "%1$.80s à %2$d de %3$.90hs%4$s"
#. GT: $4 is the font name
#, c-format
msgid "%1$.80s at %2$d size %3$d from %4$.80s"
-msgstr "%1$.80s (%2$d) taille %3$d de %4$.80hs"
+msgstr "%1$.80s (%2$d) taille %3$d de %4$.80s"
#, c-format
msgid "%1$s from lookup subtable %2$.50s"
@@ -7433,7 +7433,7 @@ msgid ""
"Reverting the file will lose those changes.\n"
"Is that what you want?"
msgstr ""
-"La fonte %1$.40s dans le fichier %2$.40hs a été modifiée.\n"
+"La fonte %1$.40s dans le fichier %2$.40s a été modifiée.\n"
"Revenir vous fera perdre toutes les modifications.\n"
"Voulez vous vraiment revenir ?"
@@ -19925,7 +19925,7 @@ msgid ""
"The fonts %1$.30s and %2$.30s have a different number of glyphs or different "
"encodings"
msgstr ""
-"Les fontes %1$.30s et %2$.30hs n'ont pas le même nombre de glyphes ou des "
+"Les fontes %1$.30s et %2$.30s n'ont pas le même nombre de glyphes ou des "
"codages différents"
#, c-format
@@ -19933,7 +19933,7 @@ msgid ""
"The fonts %1$.30s and %2$.30s use different types of splines (one quadratic, "
"one cubic)"
msgstr ""
-"Les fontes %1$.30s et %2$.30hs utilisent des courbes de Bézier d'ordres "
+"Les fontes %1$.30s et %2$.30s utilisent des courbes de Bézier d'ordres "
"différents (quadratique et cubique)"
msgid "The generated font won't work with ATM"
@@ -19968,8 +19968,8 @@ msgid ""
"The glyph %1$.30s in font %2$.30s has a different hint mask on its contours "
"than in %3$.30s"
msgstr ""
-"Le glyphe %1$.30s dans la police %2$.30hs a un masque de hints différent que "
-"dans %3$.30hs"
+"Le glyphe %1$.30s dans la police %2$.30s a un masque de hints différent que "
+"dans %3$.30s"
#, c-format
msgid ""
@@ -19984,8 +19984,8 @@ msgid ""
"The glyph %1$.30s in font %2$.30s has a different number of references than "
"in %3$.30s"
msgstr ""
-"Le glyphe %1$.30s de la fonte %2$.30hs a un nombre de références différent "
-"dans %3$.30hs"
+"Le glyphe %1$.30s de la fonte %2$.30s a un nombre de références différent "
+"dans %3$.30s"
#, c-format
msgid ""
@@ -20457,7 +20457,7 @@ msgstr ""
#, c-format
msgid "The outlines of glyph %2$.30s were not found in the font %1$.60s"
msgstr ""
-"Le contours du glyphe %2$.30s n'ont pas été trouvés dans la police %1$.60hs"
+"Le contours du glyphe %2$.30s n'ont pas été trouvés dans la police %1$.60s"
msgid "The paths that make up this glyph intersect one another"
msgstr "Les chemins qui composent ce glyphe se coupent les uns les autres"
@@ -21042,7 +21042,7 @@ msgstr "Il y a déjà une sous-table avec ce nom, changez de nom SVP"
#, c-format
msgid "There is already an anchor point named %1$.40s in %2$.40s."
-msgstr "Il y a déjà une ancre appelée %1$.40s dans %2$.40hs."
+msgstr "Il y a déjà une ancre appelée %1$.40s dans %2$.40s."
msgid "There is another glyph in the font with this name"
msgstr "Il y a un autre glyphe dans la fonte avec ce nom"
@@ -21441,8 +21441,8 @@ msgid ""
"been able to find is %1$.20s-%2$.20s-%4$d.\n"
"Shall I use that or let you search?"
msgstr ""
-"Cette fonte est basée sur le jeu de caractères %1$.20s-%2$.20hs-%3$d, mais "
-"ce que j'ai trouvé de mieux c'est %1$.20hs-%2$.20hs-%4$d.\n"
+"Cette fonte est basée sur le jeu de caractères %1$.20s-%2$.20s-%3$d, mais "
+"ce que j'ai trouvé de mieux c'est %1$.20s-%2$.20s-%4$d.\n"
"Devrais-je utiliser cette valeur ou préférez vous chercher ?"
msgid ""
@@ -21770,7 +21770,7 @@ msgid ""
"with a 0 offset for this combination. Would you like to alter this kerning "
"class entry (or create a kerning pair for just these two glyphs)?"
msgstr ""
-"Cette paire de crénage (%.20s et %.20hs) est dans une classe de crénage\n"
+"Cette paire de crénage (%.20s et %.20s) est dans une classe de crénage\n"
"avec un déplacement de 0 pour cette combinaison. Voulez-vous modifier cette "
"partie\n"
"de la classe de crénage (ou créer une nouvelle paire rien que pour ces 2 "
@@ -24551,8 +24551,8 @@ msgid ""
"referred to.\n"
"It will not be copied."
msgstr ""
-"Vous essayer de coller une référence vers %1$s dans %2$hs.\n"
-"Mais %1$hs n'existe pas dans cette fonte, et FontForge ne trouve pas le "
+"Vous essayer de coller une référence vers %1$s dans %2$s.\n"
+"Mais %1$s n'existe pas dans cette fonte, et FontForge ne trouve pas le "
"glyphe auquel il se référait.\n"
"Le glyphe ne sera pas copié."
@@ -24562,8 +24562,8 @@ msgid ""
"But %1$s does not exist in this font.\n"
"Would you like to copy the original splines (or delete the reference)?"
msgstr ""
-"Vous essayer de coller une référence vers %1$s dans %2$hs.\n"
-"Mais %1$hs n'existe pas dans cette fonte.\n"
+"Vous essayer de coller une référence vers %1$s dans %2$s.\n"
+"Mais %1$s n'existe pas dans cette fonte.\n"
"Voulez vous copier le contour d'origine (ou supprimer la référence)?"
msgid ""
diff --git a/po/it.po b/po/it.po
index e13711485..d0c3ea987 100644
--- a/po/it.po
+++ b/po/it.po
@@ -2303,7 +2303,7 @@ msgid ""
"Reverting the file will lose those changes.\n"
"Is that what you want?"
msgstr ""
-"Il font %1$.40s nel file %2$.40hs è stato modificato.\n"
+"Il font %1$.40s nel file %2$.40s è stato modificato.\n"
"Ripristinando il file perderai tutte le modifiche.\n"
"È quello che vuoi fare?"
@@ -5835,7 +5835,7 @@ msgid ""
"The glyph %1$.30s has a different number of contours in font %2$.30s than in "
"%3$.30s"
msgstr ""
-"Il glifo %1$.30s ha un diverso numero di contorni nel font %2$.30hs rispetto "
+"Il glifo %1$.30s ha un diverso numero di contorni nel font %2$.30s rispetto "
"a %3$.30s"
#, c-format
@@ -6235,8 +6235,8 @@ msgid ""
"been able to find is %1$.20s-%2$.20s-%4$d.\n"
"Shall I use that or let you search?"
msgstr ""
-"Questo font è basato sulla codifica di caratteri %1$.20s-%2$.20hs-%3$d, ma "
-"il migliore che io abbia trovato è %1$.20hs-%2$.20hs-%4$d.\n"
+"Questo font è basato sulla codifica di caratteri %1$.20s-%2$.20s-%3$d, ma "
+"il migliore che io abbia trovato è %1$.20s-%2$.20s-%4$d.\n"
"Devo usare questo valore o preferisci cercare tu stesso?"
msgid ""
--
2.41.0

View file

@ -1,473 +0,0 @@
From 75426cbbe57138849b96537ab1dee81e7861af11 Mon Sep 17 00:00:00 2001
From: Parag Nemade <pnemade@redhat.com>
Date: Fri, 8 Apr 2016 12:03:12 +0530
Subject: [PATCH] Add python3 support
---
pycontrib/FontCompare/fc/BitmapHandler.py | 20 +++++++--------
pycontrib/FontCompare/fc/DocCompare.py | 2 +-
pycontrib/FontCompare/fc/FontCompare.py | 2 +-
pycontrib/FontCompare/fc/GlyphConsistency.py | 2 +-
pycontrib/FontCompare/fontcompare | 2 +-
pycontrib/FontCompare/unittests/unittests.py | 18 ++++++-------
pycontrib/collab/web-test-collab.py | 2 +-
pycontrib/even.py | 2 +-
pycontrib/gdraw/__init__.py | 2 +-
pycontrib/gdraw/gdraw.py | 18 ++++++-------
pycontrib/graphicore.py | 2 +-
pycontrib/graphicore/ipython_view.py | 13 +++++-----
pycontrib/graphicore/shell.py | 2 +-
pycontrib/svg2sfd.py | 38 ++++++++++++++--------------
pycontrib/webcollab.py | 2 +-
15 files changed, 64 insertions(+), 63 deletions(-)
diff --git a/pycontrib/FontCompare/fc/BitmapHandler.py b/pycontrib/FontCompare/fc/BitmapHandler.py
index d4d00da..c159128 100644
--- a/pycontrib/FontCompare/fc/BitmapHandler.py
+++ b/pycontrib/FontCompare/fc/BitmapHandler.py
@@ -35,7 +35,7 @@ def white_bg_square(img):
"return a white-background-color image having the img in exact center"
size = (max(img.size),)*2
layer = Image.new('1', size, 1)
- layer.paste(img, tuple(map(lambda x:(x[0]-x[1])/2, zip(size, img.size))))
+ layer.paste(img, tuple([(x[0]-x[1])/2 for x in zip(size, img.size)]))
return layer
class BitmapCompare:
@@ -73,13 +73,13 @@ class CreateSpriteSheet:
#seperate each image with lots of whitespace
master_height = pixelsize
oldfont = font
- print "the master image will by %d by %d" % (master_width, master_height)
- print "creating image..."
+ print("the master image will by %d by %d" % (master_width, master_height))
+ print("creating image...")
master = Image.new(
mode='1',
size=(master_width, master_height),
color=0) # fully transparent
- print "created."
+ print("created.")
if effects == "italic":
font.selection.all()
font = font.italicize(-13)
@@ -92,16 +92,16 @@ class CreateSpriteSheet:
font[i].changeWeight(50,"auto",0,0,"auto")
font[i].export("temp.bmp",pixelsize,1)
img = Image.open("temp.bmp")
- print "adding %s at %d..." % (str(i)+".bmp", location),
+ print("adding %s at %d..." % (str(i)+".bmp", location), end=' ')
square_one = white_bg_square(img)
square_one.resize((pixelsize, pixelsize))
master.paste(square_one,(location,0))
- print "added."
+ print("added.")
except:
- print "ooopsy"
+ print("ooopsy")
count+=1
- print "done adding pics."
- print "saving mastersprite.bmp..."
+ print("done adding pics.")
+ print("saving mastersprite.bmp...")
master.save('data/mastersprite'+effects+'.bmp' )
- print "saved!"
+ print("saved!")
font.close()
diff --git a/pycontrib/FontCompare/fc/DocCompare.py b/pycontrib/FontCompare/fc/DocCompare.py
index 3a54bf9..df431e2 100644
--- a/pycontrib/FontCompare/fc/DocCompare.py
+++ b/pycontrib/FontCompare/fc/DocCompare.py
@@ -41,7 +41,7 @@ class DocCompare:
bashcommand = "hb-view --output-format=\"png\" --output-file=\"/var/tmp/test.png\" --font-size="+str(fontsize)+" --text-file=\""
bashcommand+=docpath+"\" "+"\""+testpath+"\""
os.system(str(bashcommand))
- print bashcommand
+ print(bashcommand)
thefile = pkg_resources.resource_filename("fc",mockfont.highresdocfile)
shutil.copy(thefile,"/var/tmp/standard.png")
cm = BitmapCompare()
diff --git a/pycontrib/FontCompare/fc/FontCompare.py b/pycontrib/FontCompare/fc/FontCompare.py
index f21718c..c82b788 100644
--- a/pycontrib/FontCompare/fc/FontCompare.py
+++ b/pycontrib/FontCompare/fc/FontCompare.py
@@ -111,7 +111,7 @@ class FontCompare(object):
scores = list()
comparator = BitmapCompare()
pixelsize = (resolution*ptsize)/72
- print spritepath
+ print(spritepath)
for i in range (glyphRange[0],glyphRange[1]):
if i in Testfont:
Testfont[i].export("/var/tmp/tmp.bmp",pixelsize,1)
diff --git a/pycontrib/FontCompare/fc/GlyphConsistency.py b/pycontrib/FontCompare/fc/GlyphConsistency.py
index 38273c9..d5265fa 100644
--- a/pycontrib/FontCompare/fc/GlyphConsistency.py
+++ b/pycontrib/FontCompare/fc/GlyphConsistency.py
@@ -102,7 +102,7 @@ class GlyphConsistency:
for i in range (glyphrange[0],glyphrange[1]):
if i in font:
score = self.glyph_round_compare(font[i],pixelsize)
- print score
+ print(score)
set_round_score+=score
total+=1
font.close()
diff --git a/pycontrib/FontCompare/fontcompare b/pycontrib/FontCompare/fontcompare
index e7e68d8..fdf7336 100755
--- a/pycontrib/FontCompare/fontcompare
+++ b/pycontrib/FontCompare/fontcompare
@@ -15,7 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
-#! /usr/bin/python
+#! /usr/bin/python3
from PyQt4.QtGui import QMessageBox
from PyQt4.QtGui import QMainWindow
from PyQt4.QtGui import QApplication
diff --git a/pycontrib/FontCompare/unittests/unittests.py b/pycontrib/FontCompare/unittests/unittests.py
index 18e1e95..d8a1190 100644
--- a/pycontrib/FontCompare/unittests/unittests.py
+++ b/pycontrib/FontCompare/unittests/unittests.py
@@ -55,7 +55,7 @@ class Basictests(unittest.TestCase):
for tup in basic:
if tup[1]!=10:
bastest=0
- self.failUnless(bastest)
+ self.assertTrue(bastest)
testfont = fontforge.open("unittests/lohit.ttf")
bold = cm.font_facecompare(testfont,mockfont,(0x900,0x97f),\
600,12,1,"bold")
@@ -66,28 +66,28 @@ class Basictests(unittest.TestCase):
normal = cm.font_facecompare(testfont,mockfont,(0x900,0x97f),\
600,12,1,"normal")
test = 1
- print len(normal)
+ print(len(normal))
for tup in bold:
if tup[1]==100 or tup[1]==0:
test1=1
break
- self.failUnless(test)
+ self.assertTrue(test)
test = 0
for tup in italic:
if tup[1]==100 or tup[1]==0:
test=1
break
- self.failUnless(test is 1)
+ self.assertTrue(test is 1)
test = 0
for tup in normal:
if tup[1]==100 or tup[1]==0:
test=1
break
- self.failUnless(test is 1)
+ self.assertTrue(test is 1)
test = 0
if len(normal) == len(bold) == len(italic):
test = 1
- self.failUnless(test is 1)
+ self.assertTrue(test is 1)
def testGlyphConsistency(self):
cm = GlyphConsistency()
@@ -99,11 +99,11 @@ class Basictests(unittest.TestCase):
test3 = cm.glyph_round_consistency(testfont,(0x900,0x97f),50)
test = (0 <= test1[0][1] <= 10)
- self.failUnless(test)
+ self.assertTrue(test)
test2 = (0 <= test2 <= 10)
- self.failUnless(test2)
+ self.assertTrue(test2)
test3 = (0 <= test3 <= 10)
- self.failUnless(test3)
+ self.assertTrue(test3)
"""
unittests for DocCompare not required.
diff --git a/pycontrib/collab/web-test-collab.py b/pycontrib/collab/web-test-collab.py
index 47b763f..b19f930 100755
--- a/pycontrib/collab/web-test-collab.py
+++ b/pycontrib/collab/web-test-collab.py
@@ -68,7 +68,7 @@ def OnCollabUpdate(f):
"end": "null" # this is simply so we dont have to manage keeping the last item with no terminating ,
},
sort_keys=True, indent=4, separators=(',', ': '))
- print js
+ print(js)
fi = open(fontJsonOnDisk, 'w')
fi.write(js)
diff --git a/pycontrib/even.py b/pycontrib/even.py
index 96f9128..4f30fcb 100755
--- a/pycontrib/even.py
+++ b/pycontrib/even.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
running even from the fontforge menu
diff --git a/pycontrib/gdraw/__init__.py b/pycontrib/gdraw/__init__.py
index d47976c..25bf981 100644
--- a/pycontrib/gdraw/__init__.py
+++ b/pycontrib/gdraw/__init__.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# vim:ts=8:sw=4:expandtab:encoding=utf-8
'''
Copyright <hashao2@gmail.com> 2009
diff --git a/pycontrib/gdraw/gdraw.py b/pycontrib/gdraw/gdraw.py
index f2d5e50..3ed3abd 100755
--- a/pycontrib/gdraw/gdraw.py
+++ b/pycontrib/gdraw/gdraw.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
'''ctypes wrapper to Attach the GDraw event handler to the gtk main loop.
Copyright <hashao2@gmail.com> 2009
@@ -111,7 +111,7 @@ class Timer:
return
def dodo(*args):
- print 'aaa'
+ print('aaa')
return False
self.add(1000, dodo)
@@ -122,7 +122,7 @@ class Timer:
def _event_handler(self, gw, event):
evt = event.contents
- print "_event_handler()"
+ print("_event_handler()")
if evt.type == et_timer:
timer = evt.u.timer.timer
tkey = addressof(timer.contents)
@@ -147,7 +147,7 @@ class Timer:
ci.func = CallBackFunc(func)
ci.data = data
- print "timer.add timeout", timeout
+ print("timer.add timeout", timeout)
frequency = 1 # Use return value of func() to decide repeat like gtk.
timer = GDrawRequestTimer(self.win, timeout, timeout, byref(ci))
@@ -190,7 +190,7 @@ class GtkRunner:
def _do_main(self, *args):
'''The function called by the gdraw timeout handler.'''
- print "do_main"
+ print("do_main")
while gtk.events_pending():
gtk.main_iteration(False)
return True
@@ -207,15 +207,15 @@ class GtkRunner:
self.gtk_timer = None
def OnDestroyWindow(self, widget, fd ):
- print fd
+ print(fd)
fontforge.removeGtkWindowToMainEventLoopByFD( fd )
self.stop()
return True
def sniffwindow(self,w):
'''sniff key presses for a gtk window'''
- print "sniffwindow w", w
- print "sniff active font:", fontforge.activeFont()
+ print("sniffwindow w", w)
+ print("sniff active font:", fontforge.activeFont())
w.connect("key-release-event", self._do_main)
fontforge.addGtkWindowToMainEventLoop(w.window.xid)
fd = fontforge.getGtkWindowMainEventLoopFD(w.window.xid)
@@ -223,7 +223,7 @@ class GtkRunner:
def sniffwindowid(self,xid):
'''sniff key presses for a gtk window'''
- print "sniffwindowid xid", xid
+ print("sniffwindowid xid", xid)
#w.connect("key-release-event", self._do_main)
def start(self, timeout=GTIMEOUT):
diff --git a/pycontrib/graphicore.py b/pycontrib/graphicore.py
index f95e488..a986327 100755
--- a/pycontrib/graphicore.py
+++ b/pycontrib/graphicore.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
running the fontforge scripts in the graphicore folder on fontforge startup
diff --git a/pycontrib/graphicore/ipython_view.py b/pycontrib/graphicore/ipython_view.py
index f39eedb..2b77395 100644
--- a/pycontrib/graphicore/ipython_view.py
+++ b/pycontrib/graphicore/ipython_view.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
'''
Provides IPython console widget.
@@ -17,10 +17,11 @@ import re
import sys
import os
import pango
-from StringIO import StringIO
-import thread
+from io import StringIO
+import _thread
import IPython
+from functools import reduce
class IterableIPShell:
'''
@@ -118,7 +119,7 @@ class IterableIPShell:
'''
This function updates namespace with sys.modules
'''
- for k,v in sys.modules.items():
+ for k,v in list(sys.modules.items()):
if not '.' in k:
self.IP.user_ns.update({k:v})
@@ -271,11 +272,11 @@ class IterableIPShell:
@type header: string
'''
stat = 0
- if verbose or debug: print header+cmd
+ if verbose or debug: print(header+cmd)
# flush stdout so we don't mangle python's buffering
if not debug:
input, output = os.popen4(cmd)
- print output.read()
+ print(output.read())
output.close()
input.close()
diff --git a/pycontrib/graphicore/shell.py b/pycontrib/graphicore/shell.py
index 5d102f7..2728ae2 100755
--- a/pycontrib/graphicore/shell.py
+++ b/pycontrib/graphicore/shell.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
FontForge Interactive Python Shell
diff --git a/pycontrib/svg2sfd.py b/pycontrib/svg2sfd.py
index e1fc0ac..e23cb15 100644
--- a/pycontrib/svg2sfd.py
+++ b/pycontrib/svg2sfd.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
#
# Copyright 2013 Google Inc. All rights reserved.
#
@@ -49,7 +49,7 @@ def print_one_cmd(cmd, args):
result.append('%f' % (scale * args[i]))
result.append(cmd)
result.append('0') # TODO: should mark corner points
- print ' '.join(result)
+ print(' '.join(result))
def apply_rel_xy(xy, args):
x0, y0 = xy
@@ -75,7 +75,7 @@ def path_to_sfd(path):
for i in range(num_args_cmd(cmd)):
m = fre.match(path)
if m is None:
- print 'no float match:', path
+ print('no float match:', path)
args.append(float(m.group(1)))
path = path[m.end():]
#print cmd, args
@@ -128,13 +128,13 @@ def conv_svg(fn, char, glyphnum = None):
if glyphnum == None:
glyphnum = lastglyphnum + 1
lastglyphnum = glyphnum
- print 'StartChar:', os.path.basename(fn)[:-4]
- print 'Encoding: %d %d %d' % (char, glyphnum, char)
- print 'Width: %d' % (21 * 40)
- print 'Flags: W'
- print 'LayerCount: 2'
- print 'Fore'
- print 'SplineSet'
+ print('StartChar:', os.path.basename(fn)[:-4])
+ print('Encoding: %d %d %d' % (char, glyphnum, char))
+ print('Width: %d' % (21 * 40))
+ print('Flags: W')
+ print('LayerCount: 2')
+ print('Fore')
+ print('SplineSet')
doc = xml.dom.minidom.parse(fn)
# TODO: reverse paths if fill color is white-ish (this is more code,
# and in the meantime, we'll rely on correct path direction in FF)
@@ -147,16 +147,16 @@ def conv_svg(fn, char, glyphnum = None):
cy = float(circle.getAttribute('cy'))
r = float(circle.getAttribute('r'))
circle_to_sfd(cx, cy, r)
- print 'EndSplineSet'
- print 'EndChar'
+ print('EndSplineSet')
+ print('EndChar')
def print_header():
global header_printed
- print '''SplineFontDB: 3.0
+ print('''SplineFontDB: 3.0
FontName: %s
FullName: %s
-FamilyName: %s''' % (font_name, font_name, font_name)
- print '''Weight: Medium
+FamilyName: %s''' % (font_name, font_name, font_name))
+ print('''Weight: Medium
Copyright: Copyright (C) 2011 Google Inc.
Version: 001.000
UnderlinePosition: -120
@@ -180,12 +180,12 @@ HheadAOffset: 0
HheadDescent: 200
HheadDOffset: 0
BeginChars: 57600 57600
-'''
+''')
header_printed = True
def print_footer():
- print '''EndChars
-EndSplineFont'''
+ print('''EndChars
+EndSplineFont''')
def parse_int(x):
if x.startswith('0x'):
@@ -197,7 +197,7 @@ def run_file(fn):
global char_num
global font_name
directory = ''
- for l in file(fn).xreadlines():
+ for l in file(fn):
if l.startswith('#'):
continue
s = l.strip().split()
diff --git a/pycontrib/webcollab.py b/pycontrib/webcollab.py
index 9ee0f17..f96828c 100755
--- a/pycontrib/webcollab.py
+++ b/pycontrib/webcollab.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
running web collab server hooks
--
2.7.3

View file

@ -0,0 +1,178 @@
From a64099931ea004a08e074b08ad0984d92c25daa2 Mon Sep 17 00:00:00 2001
From: Peter Kydas <pk@canva.com>
Date: Tue, 6 Feb 2024 10:23:36 +1100
Subject: [PATCH] fix splinefont shell command injection
---
fontforge/splinefont.c | 125 +++++++++++++++++++++++++++++------------
1 file changed, 90 insertions(+), 35 deletions(-)
diff --git a/fontforge/splinefont.c b/fontforge/splinefont.c
index 239fdc035b..647daee109 100644
--- a/fontforge/splinefont.c
+++ b/fontforge/splinefont.c
@@ -788,11 +788,14 @@ return( name );
char *Unarchive(char *name, char **_archivedir) {
char *dir = getenv("TMPDIR");
- char *pt, *archivedir, *listfile, *listcommand, *unarchivecmd, *desiredfile;
+ char *pt, *archivedir, *listfile, *desiredfile;
char *finalfile;
int i;
int doall=false;
static int cnt=0;
+ gchar *command[5];
+ gchar *stdoutresponse = NULL;
+ gchar *stderrresponse = NULL;
*_archivedir = NULL;
@@ -827,18 +830,30 @@ return( NULL );
listfile = malloc(strlen(archivedir)+strlen("/" TOC_NAME)+1);
sprintf( listfile, "%s/" TOC_NAME, archivedir );
- listcommand = malloc( strlen(archivers[i].unarchive) + 1 +
- strlen( archivers[i].listargs) + 1 +
- strlen( name ) + 3 +
- strlen( listfile ) +4 );
- sprintf( listcommand, "%s %s %s > %s", archivers[i].unarchive,
- archivers[i].listargs, name, listfile );
- if ( system(listcommand)!=0 ) {
- free(listcommand); free(listfile);
- ArchiveCleanup(archivedir);
-return( NULL );
- }
- free(listcommand);
+ command[0] = archivers[i].unarchive;
+ command[1] = archivers[i].listargs;
+ command[2] = name;
+ command[3] = NULL; // command args need to be NULL-terminated
+
+ if ( g_spawn_sync(
+ NULL,
+ command,
+ NULL,
+ G_SPAWN_SEARCH_PATH,
+ NULL,
+ NULL,
+ &stdoutresponse,
+ &stderrresponse,
+ NULL,
+ NULL
+ ) == FALSE) { // did not successfully execute
+ ArchiveCleanup(archivedir);
+ return( NULL );
+ }
+ // Write out the listfile to be read in later
+ FILE *fp = fopen(listfile, "wb");
+ fwrite(stdoutresponse, strlen(stdoutresponse), 1, fp);
+ fclose(fp);
desiredfile = ArchiveParseTOC(listfile, archivers[i].ars, &doall);
free(listfile);
@@ -847,22 +862,28 @@ return( NULL );
return( NULL );
}
- /* I tried sending everything to stdout, but that doesn't work if the */
- /* output is a directory file (ufo, sfdir) */
- unarchivecmd = malloc( strlen(archivers[i].unarchive) + 1 +
- strlen( archivers[i].listargs) + 1 +
- strlen( name ) + 1 +
- strlen( desiredfile ) + 3 +
- strlen( archivedir ) + 30 );
- sprintf( unarchivecmd, "( cd %s ; %s %s %s %s ) > /dev/null", archivedir,
- archivers[i].unarchive,
- archivers[i].extractargs, name, doall ? "" : desiredfile );
- if ( system(unarchivecmd)!=0 ) {
- free(unarchivecmd); free(desiredfile);
- ArchiveCleanup(archivedir);
-return( NULL );
+ command[0] = archivers[i].unarchive;
+ command[1] = archivers[i].extractargs;
+ command[2] = name;
+ command[3] = doall ? "" : desiredfile;
+ command[4] = NULL;
+
+ if ( g_spawn_sync(
+ (gchar*)archivedir,
+ command,
+ NULL,
+ G_SPAWN_SEARCH_PATH,
+ NULL,
+ NULL,
+ &stdoutresponse,
+ &stderrresponse,
+ NULL,
+ NULL
+ ) == FALSE) { // did not successfully execute
+ free(desiredfile);
+ ArchiveCleanup(archivedir);
+ return( NULL );
}
- free(unarchivecmd);
finalfile = malloc( strlen(archivedir) + 1 + strlen(desiredfile) + 1);
sprintf( finalfile, "%s/%s", archivedir, desiredfile );
@@ -885,20 +906,54 @@ struct compressors compressors[] = {
char *Decompress(char *name, int compression) {
char *dir = getenv("TMPDIR");
- char buf[1500];
char *tmpfn;
-
+ gchar *command[4];
+ gint stdout_pipe;
+ gchar buffer[4096];
+ gssize bytes_read;
+ GByteArray *binary_data = g_byte_array_new();
+
if ( dir==NULL ) dir = P_tmpdir;
tmpfn = malloc(strlen(dir)+strlen(GFileNameTail(name))+2);
strcpy(tmpfn,dir);
strcat(tmpfn,"/");
strcat(tmpfn,GFileNameTail(name));
*strrchr(tmpfn,'.') = '\0';
- snprintf( buf, sizeof(buf), "%s < %s > %s", compressors[compression].decomp, name, tmpfn );
- if ( system(buf)==0 )
-return( tmpfn );
- free(tmpfn);
-return( NULL );
+
+ command[0] = compressors[compression].decomp;
+ command[1] = "-c";
+ command[2] = name;
+ command[3] = NULL;
+
+ // Have to use async because g_spawn_sync doesn't handle nul-bytes in the output (which happens with binary data)
+ if (g_spawn_async_with_pipes(
+ NULL,
+ command,
+ NULL,
+ G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &stdout_pipe,
+ NULL,
+ NULL) == FALSE) {
+ //command has failed
+ return( NULL );
+ }
+
+ // Read binary data from pipe and output to file
+ while ((bytes_read = read(stdout_pipe, buffer, sizeof(buffer))) > 0) {
+ g_byte_array_append(binary_data, (guint8 *)buffer, bytes_read);
+ }
+ close(stdout_pipe);
+
+ FILE *fp = fopen(tmpfn, "wb");
+ fwrite(binary_data->data, sizeof(gchar), binary_data->len, fp);
+ fclose(fp);
+ g_byte_array_free(binary_data, TRUE);
+
+ return(tmpfn);
}
static char *ForceFileToHaveName(FILE *file, char *exten) {

View file

@ -1,41 +0,0 @@
diff -Nur fontforge-20090224.orig/configure fontforge-20090224/configure
--- fontforge-20090224.orig/configure 2008-12-24 14:04:18.000000000 -0700
+++ fontforge-20090224/configure 2009-04-01 22:56:07.000000000 -0600
@@ -26670,6 +26670,7 @@
else
PYLIBS=""
fi
+ PYDEFINES="$PYDEFINES, ('SOLIBDIR','\"$libdir/\"')"
PY=pyhook/setup.py
fi
diff -Nur fontforge-20090224.orig/pyhook/loadfontforge.h fontforge-20090224/pyhook/loadfontforge.h
--- fontforge-20090224.orig/pyhook/loadfontforge.h 2007-12-23 19:28:35.000000000 -0700
+++ fontforge-20090224/pyhook/loadfontforge.h 2009-04-01 22:49:08.000000000 -0600
@@ -11,7 +11,7 @@
if ( (lib = dlopen("libgunicode" SO_EXT,RTLD_LAZY))==NULL ) {
#ifdef PREFIX
- lib = dlopen( PREFIX "/lib/" "libgunicode" SO_EXT,RTLD_LAZY);
+ lib = dlopen( SOLIBDIR "libgunicode.so.3" ,RTLD_LAZY);
#endif
}
if ( lib==NULL ) {
@@ -21,7 +21,7 @@
if ( (lib = dlopen("libgutils" SO_EXT,RTLD_LAZY))==NULL ) {
#ifdef PREFIX
- lib = dlopen( PREFIX "/lib/" "libgutils" SO_EXT,RTLD_LAZY);
+ lib = dlopen( SOLIBDIR "libgutils.so.1" ,RTLD_LAZY);
#endif
}
if ( lib==NULL ) {
@@ -31,7 +31,7 @@
if ( (lib = dlopen("libfontforge" SO_EXT,RTLD_LAZY))==NULL ) {
#ifdef PREFIX
- lib = dlopen( PREFIX "/lib/" "libfontforge" SO_EXT,RTLD_LAZY);
+ lib = dlopen( SOLIBDIR "libfontforge.so.1" ,RTLD_LAZY);
#endif
}
if ( lib==NULL ) {

View file

@ -1,37 +0,0 @@
--- fontforge-20120731-b/fontforge/parsepdf.c 2012-08-02 16:09:09.000000000 +0100
+++ fontforge-20120731-b-new/fontforge/parsepdf.c 2013-02-07 17:44:05.371466086 +0000
@@ -1691,9 +1691,9 @@
/* to "Unicode" values it specifies rather than to the real order in which the glyphs are */
/* stored in the file */
pos = cmap_from_cid || sf->map == NULL ? gid : sf->map->map[gid];
- sc = sf->glyphs[pos];
- if (pos >= 0 && pos < sf->glyphcnt && (sc->unicodeenc != uvals[0] || nuni > 1)) {
+ if (pos >= 0 && pos < sf->glyphcnt && (sf->glyphs[pos]->unicodeenc != uvals[0] || nuni > 1)) {
+ sc = sf->glyphs[pos];
/* Sometimes FF instead of assigning proper Unicode values to TTF glyphs keeps */
/* them encoded to the same codepoint, but creates for each glyph an alternate */
/* encoding, corresponding to the position this glyph has in the font's encoding */
@@ -1723,6 +1723,7 @@
FILE *file;
int i, j, gid, start, end, uni, cur=0, nuni, nhex, nchars, lo, *uvals;
long *mappings;
+ size_t num_mappings;
char tok[200], *ccval, prevtok[200];
SplineFont *sf = basesf->subfontcnt > 0 ? basesf->subfonts[0] : basesf;
@@ -1733,9 +1734,14 @@
return;
rewind(file);
+ num_mappings = sf->glyphcnt;
mappings = gcalloc(sf->glyphcnt,sizeof(long));
while ( pdf_getprotectedtok(file,tok) >= 0 ) {
if ( strcmp(tok,"beginbfchar") == 0 && sscanf(prevtok,"%d",&nchars)) {
+ if (cur + nchars >= num_mappings) {
+ num_mappings = cur + nchars;
+ mappings = grealloc(mappings, num_mappings * sizeof(long));
+ }
for (i=0; i<nchars; i++) {
if (pdf_skip_brackets(file,tok) >= 0 && sscanf(tok,"%x",&gid) &&
pdf_skip_brackets(file,tok) >= 0 && sscanf(tok,"%lx",&mappings[cur])) {

View file

@ -1,11 +0,0 @@
--- fontforge-20120731-b/fontforge/parsepdf.c.orig 2013-04-15 17:47:51.113706334 +0100
+++ fontforge-20120731-b/fontforge/parsepdf.c 2013-04-15 17:55:55.531682304 +0100
@@ -960,6 +960,8 @@
start = 0;
num = pdf_getinteger(pt,pc);
}
+ if ( (pt=PSDictHasEntry(&pc->pdfdict,"DecodeParms"))!=NULL && strstr(pt, "/Predictor")!=NULL)
+return( NULL );
if ( (pt=PSDictHasEntry(&pc->pdfdict,"Index"))!=NULL ) {
if ( sscanf(pt,"[%d %d]", &start, &num )!=2 )
return( NULL );

View file

@ -1,30 +0,0 @@
--- Makefile.am.old 2014-08-12 10:07:32.000000000 +0530
+++ Makefile.am 2014-09-08 16:23:56.046996941 +0530
@@ -43,7 +43,6 @@
AM_CPPFLAGS =
AM_LDFLAGS =
-BUILT_SOURCES = uthash/src
EXTRA_DIST =
CLEANFILES =
MOSTLYCLEANFILES =
@@ -113,7 +112,6 @@
Packaging/FontForge-doc.spec \
Packaging/FontForge.spec \
Packaging/FontForge.static.spec \
- uthash/src \
$(NULL)
#--------------------------------------------------------------------------
@@ -129,11 +127,6 @@
#--------------------------------------------------------------------------
-uthash/src:
- if [ ! -e uthash/src ]; then \
- if [ -e uthash ] ; then rm -r uthash ; fi ; \
- git clone https://github.com/troydhanson/uthash ; \
- fi ;
# We import a selection of targets from Frank's standard packaging Makefile.

File diff suppressed because it is too large Load diff

View file

@ -1,34 +1,27 @@
%global gettext_package FontForge
%global gnulib_githead 2bf7326
%global gittag0 20160404
Name: fontforge
Version: 20160404
Release: 4%{?dist}
Version: 20251009
Release: 1%{?dist}
Summary: Outline and bitmap font editor
License: GPLv3+
License: GPL-3.0-or-later
URL: http://fontforge.github.io/
Source0: https://github.com/fontforge/%{name}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz
# https://github.com/fontforge/fontforge/issues/1725
Source1: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=%{gnulib_githead};sf=tgz;name=gnulib-%{gnulib_githead}.tar.gz
# https://github.com/fontforge/fontforge/pull/1723
Patch0: fontforge-20140813-use-system-uthash.patch
Patch1: Add-python3-support.patch
Source0: https://github.com/fontforge/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Requires: xdg-utils
Requires: autotrace
Requires: (autotrace or potrace)
Requires: hicolor-icon-theme
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: libpng-devel
BuildRequires: libungif-devel
BuildRequires: giflib-devel
BuildRequires: libxml2-devel
BuildRequires: freetype-devel
BuildRequires: desktop-file-utils
BuildRequires: libuninameslist-devel
BuildRequires: libXt-devel
BuildRequires: xorg-x11-proto-devel
BuildRequires: gettext
@ -36,16 +29,20 @@ BuildRequires: pango-devel
BuildRequires: cairo-devel
BuildRequires: libspiro-devel
BuildRequires: python3-devel
BuildRequires: gnulib-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: readline-devel
# This is failing on aarch64 so drop it
#BuildRequires: python-ipython
BuildRequires: uthash-devel
BuildRequires: libappstream-glib
BuildRequires: woff2-devel
# F25 build is failing add following to fix
BuildRequires: shared-mime-info
# F33 onward need now
BuildRequires: gtk3-devel
BuildRequires: python3-sphinx
BuildRequires: make
# 20151009 version requires below
BuildRequires: gtkmm3.0-devel
Provides: bundled(gnulib)
%py_provides python3-fontforge
%py_provides python3-psMat
%description
FontForge (former PfaEdit) is a font editor for outline and bitmap
@ -54,14 +51,13 @@ fonts. It supports a range of font formats, including PostScript
(Type2) and CID-keyed fonts.
%package devel
Summary: Development tools for fontforge
Requires: %{name} = %{version}-%{release}
Summary: Development files for fontforge
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-doc = %{version}-%{release}
Requires: pkgconfig
%description devel
This package includes the libraries and header files you will need
to compile applications against fontforge.
This package includes the library files you will need to compile
applications against fontforge.
%package doc
Summary: Documentation files for %{name}
@ -72,103 +68,279 @@ This package contains documentation files for %{name}.
%prep
%setup -q -n %{name}-%{version}
tar xzf %{SOURCE1}
%patch0 -p0
%patch1 -p1
sed -i -e '/^#!\//, 1d' pycontrib/webcollab.py
mkdir htdocs
cp -pr doc/html/* htdocs
chmod 644 htdocs/nonBMP/index.html
# Fix bad line terminators
%{__sed} -i 's/\r//' htdocs/Big5.txt
%{__sed} -i 's/\r//' htdocs/corpchar.txt
%autosetup
%build
./bootstrap --skip-git --gnulib-srcdir=gnulib-%{gnulib_githead}
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure PYTHON=python3
make V=1 %{?_smp_mflags}
%cmake -DCMAKE_BUILD_TYPE=Release \
-DENABLE_WOFF2=ON \
-DPYHOOK_INSTALL_DIR=%{python3_sitearch}
%cmake_build
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm -f $RPM_BUILD_ROOT%{_libdir}/libg{draw,unicode}.{la,so}
%cmake_install
desktop-file-install \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--add-category X-Fedora \
desktop/fontforge.desktop
# The fontforge makefiles install htdocs as well, but we
# prefer to have them under the standard RPM location, so
# remove the extra copy
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/fontforge
desktop/org.fontforge.FontForge.desktop
# remove unneeded .la and .a files
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';'
rm -f %{buildroot}%{_datadir}/doc/fontforge/{.buildinfo,.nojekyll}
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
# Find translations
%find_lang %{gettext_package}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
install -m 644 -p desktop/fontforge.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages
install -m 644 -p desktop/fontforge.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/
#Makefile install rules are playing evil here. Let's correct the permission.
#chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/python/graphicore/__init__.py
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/python/gdraw/_gdraw.py
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/nodejs/collabwebview/css/*.css
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/nodejs/collabwebview/js/*.js
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/nodejs/collabwebview/js/contentEditable/*
%post
update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
/sbin/ldconfig
%postun
update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
fi
/sbin/ldconfig
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%check
%ctest
%files -f %{gettext_package}.lang
%doc AUTHORS
%license LICENSE
%license LICENSE COPYING.gplv3
%{_bindir}/*
%{_libdir}/lib*.so.*
%{_datadir}/applications/*fontforge.desktop
%{_datadir}/applications/*FontForge.desktop
%{_datadir}/fontforge
%{_datadir}/icons/hicolor/*/apps/fontforge.*
%{_datadir}/icons/hicolor/*/apps/org.fontforge.FontForge*
%{_mandir}/man1/*.1*
%{_datadir}/mime/packages/fontforge.xml
%{_datadir}/appdata/fontforge.appdata.xml
%{_metainfodir}/org.fontforge.FontForge.appdata.xml
%{python3_sitearch}/fontforge.so
%{python3_sitearch}/psMat.so
%files devel
%{_includedir}/fontforge/
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%files doc
%doc htdocs
%doc %{_pkgdocdir}
%changelog
* Fri Oct 10 2025 Parag Nemade <pnemade AT redhat DOT com> - 20251009-1
- Update to 20251009 version (#2402960)
- Remove upstream released patches
- Add new BR: gtkmm3.0-devel
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Jul 17 2025 Parag Nemade <pnemade AT redhat DOT com> - 20230101-17
- Update for https://fedoraproject.org/wiki/Changes/CMake_ninja_default (rh#2381004)
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 20230101-16
- Rebuilt for Python 3.14
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 14 2024 Gwyn Ciesla <gwync@protonmail.com> - 20230101-13
- Patch for Python 3.13
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 20230101-12
- Rebuilt for Python 3.13
* Wed Feb 28 2024 Parag Nemade <pnemade AT redhat DOT com> - 20230101-11
- Resolves: CVE-2024-25081 and CVE-2024-25082
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Aug 10 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 20230101-8
- Drop unused libuninameslist dependency
* Tue Aug 08 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 20230101-7
- Allow potrace as an alternative to autotrace
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jul 07 2023 Parag Nemade <pnemade AT redhat DOT com> - 20230101-5
- Fix fr.po and it.po translations issue
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 20230101-4
- Rebuilt for Python 3.12
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 20230101-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Jan 02 2023 Parag Nemade <pnemade AT redhat DOT com> - 20230101-2
- Update license tag to SPDX format
- Fix test failure
* Mon Jan 02 2023 Parag Nemade <pnemade AT redhat DOT com> - 20230101-1
- Update to 20230101 version (#2157290)
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 20220308-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 20220308-2
- Rebuilt for Python 3.11
* Thu Mar 10 2022 Parag Nemade <pnemade AT redhat DOT com> - 20220308-1
- Update to 20220308 version (#2062047)
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 20201107-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20201107-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 20201107-4
- Rebuilt for Python 3.10
* Mon Feb 01 2021 Parag Nemade <pnemade AT redhat DOT com> - 20201107-3
- The %%find_lang should run as part of %%install only
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20201107-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Nov 25 2020 Parag Nemade <pnemade AT redhat DOT com> - 20201107-1
- Update to 20201107 version (#1895648)
- removed %%gittag0 macro, as it cause problem to automated package update script
* Sun Nov 22 2020 Benjamin A. Beasley <code@musicinmybrain.net> - 20200314-10
- Add py_provides macros to provide python3-fontforge, python3-psMat, etc.
* Wed Aug 05 2020 Parag Nemade <pnemade AT redhat DOT com> - 20200314-9
- Fix FTBFS bug by fixing glossary.rst and using new CMake macros
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20200314-8
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20200314-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 20200314-6
- Rebuilt for Python 3.9
* Sat May 02 2020 Parag Nemade <pnemade AT redhat DOT com> - 20200314-5
- Resolves:rhbz#1830502 - Add missing WOFF2 support
* Wed Apr 15 2020 Parag Nemade <pnemade AT redhat DOT com> - 20200314-4
- Resolves:rhbz#1823525 - fontforge fails to build with Sphinx 3.0.0
* Thu Apr 02 2020 Parag Nemade <pnemade AT redhat DOT com> - 20200314-3
- Fix the GDK backend UI issues
- Move back to using GDK backend
* Fri Mar 27 2020 Parag Nemade <pnemade AT redhat DOT com> - 20200314-2
- Enabled X11 and 2012 theme
* Wed Mar 25 2020 Parag Nemade <pnemade AT redhat DOT com> - 20200314-1
- Update to 20200314 version (#1813578)
* Sun Feb 16 2020 Parag Nemade <pnemade AT redhat DOT com> - 20190801-6
- another fix for rh#1790042 - CVE-2020-5395:out-of-bounds write in sfd.c
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20190801-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jan 16 2020 Parag Nemade <pnemade AT redhat DOT com> - 20190801-4
- Resolves:rh#1790042 - CVE-2020-5395:out-of-bounds write in sfd.c
* Tue Aug 27 2019 Kevin Fenzi <kevin@scrye.com> - 20190801-3
- Rebuild for new libspiro
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 20190801-2
- Rebuilt for Python 3.8
* Thu Aug 15 2019 Parag Nemade <pnemade AT redhat DOT com> - 20190801-1
- Update to 20190801 version (#1739819)
- Upstream moved to use Glib's GHashTable over uthash
- Upstream dropped requiring bundling copy of gnulib
* Fri Aug 02 2019 Parag Nemade <pnemade AT redhat DOT com> - 20190413-4
- Fix the conditional for rh#1728058
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20190413-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jul 23 2019 Parag Nemade <pnemade AT redhat DOT com> - 20190413-2
- make the code compatible with python-3.8 (rh#1728058)
* Sat Apr 13 2019 Parag Nemade <pnemade AT redhat DOT com> - 20190413-1
- Update to 20190413 version (#1689629)
* Mon Mar 25 2019 Parag Nemade <pnemade AT redhat DOT com> - 20190317-1
- Update to 20190317 release (#1689629)
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 20170731-12
- Rebuild for readline 8.0
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20170731-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jul 23 2018 Miro Hrončok <mhroncok@redhat.com> - 20170731-10
- Rebuilt for #1595421
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170731-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jul 04 2018 Kevin Fenzi <kevin@scrye.com> - -8
- Update bundled gnulib. Fixes bug #1596037
* Thu Jun 28 2018 Miro Hrončok <mhroncok@redhat.com> - 20170731-7
- Rebuilt for Python 3.7.0 final (#1595421)
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 20170731-6
- Rebuilt for Python 3.7
* Sun Feb 11 2018 Sandro Mani <manisandro@gmail.com> - 20170731-5
- Rebuild (giflib)
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170731-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jan 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 20170731-3
- Remove obsolete scriptlets
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20170731-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Mon Jul 31 2017 Parag Nemade <pnemade AT redhat DOT com> - 20170731-1
- Update to 20170731
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20161012-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Mar 09 2017 Parag Nemade <pnemade AT redhat DOT com> - 20161012-6
- Resolves:rh#1429574 - [abrt] fontforge: PyFF_OpenFont(): fontforge killed by signal 6
- Added patch to fix python module for python3.6
* Sat Feb 18 2017 Parag Nemade <pnemade AT redhat DOT com> - 20161012-5
- Add missing BR: git
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20161012-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Jan 12 2017 Igor Gnatenko <ignatenko@redhat.com> - 20161012-3
- Rebuild for readline 7.x
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 20161012-2
- Rebuild for Python 3.6
* Thu Oct 13 2016 Parag Nemade <pnemade AT redhat DOT com> - 20161012-1
- Update to 20161012
* Thu Oct 06 2016 Parag Nemade <pnemade AT redhat DOT com> - 20161005-1
- Update to 20161005
* Wed Oct 05 2016 Parag Nemade <pnemade AT redhat DOT com> - 20161004-1
- Update to 20161004
* Mon Oct 03 2016 Parag Nemade <pnemade AT redhat DOT com> - 20161001-1
- Update to 20161001
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20160404-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

5
plans/fontforge.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

24
pyconfig.patch Normal file
View file

@ -0,0 +1,24 @@
--- pycontrib/FontCompare/setup.py~ 2022-12-31 23:25:21.000000000 -0600
+++ pycontrib/FontCompare/setup.py 2024-06-14 15:14:14.119920623 -0500
@@ -15,7 +15,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
#!/usr/bin/env python
-from distutils.core import setup
from setuptools import setup
setup(name='Font Compare',
version='1.0',
--- fontforge/python.c~ 2022-12-31 23:25:21.000000000 -0600
+++ fontforge/python.c 2024-06-14 15:38:41.397897757 -0500
@@ -19633,7 +19633,10 @@
if ( saved_progname )
free(saved_progname);
saved_progname = copy_to_wide_string(progname);
- Py_SetProgramName(saved_progname);
+ PyStatus status;
+ PyConfig config;
+ PyConfig_InitPythonConfig(&config);
+ status = PyConfig_SetString(&config, &config.program_name, saved_progname);
}
static wchar_t ** copy_argv(char *arg0, int argc ,char **argv) {

View file

@ -1,2 +1 @@
1daba85b251e00c614e4e857c67cae4c fontforge-20160404.tar.gz
149162d1d21a0dfc705a31916f4b0cd0 gnulib-2bf7326.tar.gz
SHA512 (fontforge-20251009.tar.gz) = 2923c54e10585551c93102d8b7a389c9de3c629c1676fc8c576c9b9c3f1f6fe28f7a1e39fd5a57ab7eeadf0b17d722bf439ca94f0a788ceab6993e1a93ea7d5f

14
tests/generate-font.py Normal file
View file

@ -0,0 +1,14 @@
import fontforge
import os
myFont = fontforge.open("Cantarell-Regular.ttf")
myFont.generate("Cantarell-Regular.sfd")
myFont.close()
myFont = fontforge.open("Cantarell-Regular.sfd")
myFont.generate("Cantarell-Regular.ttf")
myFont.close()
os.remove("Cantarell-Regular.ttf")
os.remove("Cantarell-Regular.sfd")

7
tests/generate-sfd.pe Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/fontforge
i=1
Open($argv[i], 1)
#Use gen_flags=Defualt fmflags value as -1
gen_flags = -1
Generate("" + $fontname + ".sfd", "", gen_flags)

10
tests/generate-ttf.pe Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/fontforge
i=1
Open($argv[i], 1)
#Use gen_flags=Defualt fmflags value as -1
gen_flags = -1
Generate("" + $fontname + ".ttf", "", gen_flags)
Generate("" + $fontname + ".otf", "", gen_flags)
PrintSetup (5)
PrintFont (0, 0, "", $fontname + "-sample.pdf")

View file

@ -0,0 +1,31 @@
#!/usr/bin/python3
import fontforge
import sys
if len(sys.argv) > 1:
f = fontforge.open(sys.argv[1])
else:
print("provide fontfile path as an argument")
sys.exit(1)
if f.fullname:
print("Fontname is {0}".format(f.fullname))
else:
print("fontname not set")
if f.weight:
print("Given font weight is {0}".format(f.weight))
else:
print("Given font weight not set")
if f.version:
print("Given font version is {0}".format(f.version))
else:
print("Given font version not set")
if f.copyright:
print("Given font Copyright text is => {0}".format(f.copyright))
else:
print("Given font copyright information not set")
ver = fontforge.UnicodeNamesListVersion()
print("Libuninameslist version is : %s" % ver)

5
tests/main.fmf Normal file
View file

@ -0,0 +1,5 @@
require:
- fontforge
test: bash ./run_tests.sh
framework: shell

23
tests/run_tests.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
cp /usr/share/fontforge/pixmaps/Cantarell-Regular.ttf .
echo "----------------------------------------------------------"
echo "Executing get-font-metadata.py on Cantarell-Regular.ttf =>"
/usr/bin/python3 get-font-metadata.py ./Cantarell-Regular.ttf
echo "----------------------------------------------------------"
echo "Executing generate-font.py on Cantarell-Regular.ttf =>"
/usr/bin/python3 generate-font.py ./Cantarell-Regular.ttf
echo "----------------------------------------------------------"
cp /usr/share/fontforge/pixmaps/Cantarell-Regular.ttf .
echo "Executing generate-sfd.pe on Cantarell-Regular.ttf =>"
/usr/bin/fontforge -script generate-sfd.pe ./Cantarell-Regular.ttf
rm Cantarell-Regular.ttf
echo "----------------------------------------------------------"
echo "Executing generate-ttf.pe on Cantarell-Regular.sfd =>"
/usr/bin/fontforge -script generate-ttf.pe ./Cantarell-Regular.sfd
echo "----------------------------------------------------------"

47
tests/runtests.sh Executable file
View file

@ -0,0 +1,47 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
NAME=fontforge
rlJournalStart
rlPhaseStartSetup
rlAssertRpm ${NAME}
rlAssertRpm ${NAME}-devel
rlShowPackageVersion ${NAME}
rlRun -t -l "VERSION=$(rpm -q ${NAME} --queryformat='%{version}')" 0 "Get VERSION"
FEDORA_VERSION=$(rlGetDistroRelease)
rlLog "FEDORA_VERSION=${DISTRO_RELEASE}"
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlFetchSrcForInstalled "${NAME}"
rlRun "rpm --define '_topdir $tmp' -i *src.rpm"
rlRun -t -l "mkdir BUILD" 0 "Creating BUILD directory"
rlRun -t -l "rpmbuild --noclean --nodeps --define '_topdir $tmp' -bp $tmp/SPECS/*spec"
if [ -d BUILD/${NAME}-${VERSION}-build ]; then
rlRun -t -l "pushd BUILD/${NAME}-${VERSION}-build/${NAME}-${VERSION}"
else
rlRun -t -l "pushd BUILD/${NAME}-${VERSION}"
fi
rlRun "set -o pipefail"
rlRun "NOCONFIGURE=1 ./autogen.sh"
rlRun "./configure --disable-static --with-graphite2 --with-gobject --enable-introspection"
rlRun "make check"
rlRun "retval=$?"
rlRun "echo $retval"
rlPhaseEnd
rlPhaseStartTest
rlRun -t -l "INSTALLED_VERSION=$(hb-info --version|awk 'NR==1 {print $3}')" \
0 "Get installed version"
rlAssertEquals "versions should be equal" "${VERSION}" "${INSTALLED_VERSION}"
rlGetTestState
rlLog "Number of failed asserts so far: ${ECODE}"
rlRun "popd" 0
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd