From 00599859f74ed53a72ee4925a3836852e65264f2 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Wed, 25 Mar 2020 21:29:11 +0530 Subject: [PATCH 01/42] Update to 20200314 version (#1813578) --- .gitignore | 1 + ...forge-20190413-python-3.8-pkg-config.patch | 14 --- ...-20190801-cve-2020-5395-followup-fix.patch | 28 ------ fontforge-20190801-cve-2020-5395.patch | 78 --------------- ...forge-20190801-fix-metainfo.xml-file.patch | 41 -------- fontforge.spec | 98 ++++++++----------- sources | 2 +- tests/scripts/generate-font.py | 14 +++ tests/scripts/generate-sfd.pe | 7 ++ .../scripts/{generate.pe => generate-ttf.pe} | 0 tests/scripts/run_tests.sh | 23 ++++- 11 files changed, 83 insertions(+), 223 deletions(-) delete mode 100644 fontforge-20190413-python-3.8-pkg-config.patch delete mode 100644 fontforge-20190801-cve-2020-5395-followup-fix.patch delete mode 100644 fontforge-20190801-cve-2020-5395.patch delete mode 100644 fontforge-20190801-fix-metainfo.xml-file.patch create mode 100644 tests/scripts/generate-font.py create mode 100755 tests/scripts/generate-sfd.pe rename tests/scripts/{generate.pe => generate-ttf.pe} (100%) diff --git a/.gitignore b/.gitignore index 749cac3..245b9b3 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ fontforge_full-20100501.tar.bz2 /gnulib-b324052.tar.gz /fontforge-20190317.tar.gz /fontforge-20190413.tar.gz +/fontforge-20200314.tar.gz diff --git a/fontforge-20190413-python-3.8-pkg-config.patch b/fontforge-20190413-python-3.8-pkg-config.patch deleted file mode 100644 index 485f796..0000000 --- a/fontforge-20190413-python-3.8-pkg-config.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -urN fontforge-20190413.old/m4/fontforge_arg_enable.m4 fontforge-20190413/m4/fontforge_arg_enable.m4 ---- fontforge-20190413.old/m4/fontforge_arg_enable.m4 2019-04-13 13:08:39.000000000 +0530 -+++ fontforge-20190413/m4/fontforge_arg_enable.m4 2019-07-21 16:31:27.939734401 +0530 -@@ -116,8 +116,8 @@ - if test x"${i_do_have_python_scripting}" != xyes; then - i_want_python_ver= - else -- PKG_CHECK_MODULES([PYTHON],[python-"${PYTHON_VERSION}"], dnl [PKG_CHECK_MODULES([PYTHONDEV],[python-"${PYTHON_VERSION}"],,[i_do_have_python_scripting=maybe])], -- [PKG_CHECK_MODULES([PYTHONDEV],[python-"${PYTHON_VERSION}"],,[i_do_have_python_scripting=no])], -+ PKG_CHECK_MODULES([PYTHON],[python-"${PYTHON_VERSION}"-embed], dnl [PKG_CHECK_MODULES([PYTHONDEV],[python-"${PYTHON_VERSION}"-embed],,[i_do_have_python_scripting=maybe])], -+ [PKG_CHECK_MODULES([PYTHONDEV],[python-"${PYTHON_VERSION}"-embed],,[i_do_have_python_scripting=no])], - [i_do_have_python_scripting=no]) - dnl dnl TODO: have python3 AND python2, but only have python2 dev, but no python3 dev - dnl if test x"${i_do_have_python_scripting}" = xmaybe; then diff --git a/fontforge-20190801-cve-2020-5395-followup-fix.patch b/fontforge-20190801-cve-2020-5395-followup-fix.patch deleted file mode 100644 index c69bb48..0000000 --- a/fontforge-20190801-cve-2020-5395-followup-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b96273acc691ac8a36c6a8dd4de8e6edd7eaae59 Mon Sep 17 00:00:00 2001 -From: Fredrick Brennan -Date: Tue, 21 Jan 2020 15:16:00 +0800 -Subject: [PATCH] Fix crash on exit introduced in previous commit - -When the number of layers is greater than 2, as in Chomsky.sfd and most -of my other fonts, FontForge will crash on exiting. - -This is just a simple mistake @skef made. ---- - fontforge/sfd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fontforge/sfd.c b/fontforge/sfd.c -index e8ca39ba83..9517d8cb12 100644 ---- a/fontforge/sfd.c -+++ b/fontforge/sfd.c -@@ -7998,9 +7998,9 @@ bool SFD_GetFontMetaData( FILE *sfd, - int layer_cnt_tmp; - getint(sfd,&layer_cnt_tmp); - if ( layer_cnt_tmp>2 ) { -+ sf->layer_cnt = layer_cnt_tmp; - sf->layers = realloc(sf->layers,sf->layer_cnt*sizeof(LayerInfo)); - memset(sf->layers+2,0,(sf->layer_cnt-2)*sizeof(LayerInfo)); -- sf->layer_cnt = layer_cnt_tmp; - } - } - else if ( strmatch(tok,"Layer:")==0 ) diff --git a/fontforge-20190801-cve-2020-5395.patch b/fontforge-20190801-cve-2020-5395.patch deleted file mode 100644 index 51b5245..0000000 --- a/fontforge-20190801-cve-2020-5395.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 048a91e2682c1a8936ae34dbc7bd70291ec05410 Mon Sep 17 00:00:00 2001 -From: Skef Iterum -Date: Mon, 6 Jan 2020 03:05:06 -0800 -Subject: [PATCH] Fix for #4084 Use-after-free (heap) in the - SFD_GetFontMetaData() function Fix for #4086 NULL pointer dereference in the - SFDGetSpiros() function Fix for #4088 NULL pointer dereference in the - SFD_AssignLookups() function Add empty sf->fontname string if it isn't set, - fixing #4089 #4090 and many other potential issues (many downstream calls - to strlen() on the value). - ---- - fontforge/sfd.c | 19 ++++++++++++++----- - fontforge/sfd1.c | 2 +- - 2 files changed, 15 insertions(+), 6 deletions(-) - -diff --git a/fontforge/sfd.c b/fontforge/sfd.c -index 731be201e0..e8ca39ba83 100644 ---- a/fontforge/sfd.c -+++ b/fontforge/sfd.c -@@ -4032,13 +4032,16 @@ static void SFDGetSpiros(FILE *sfd,SplineSet *cur) { - while ( fscanf(sfd,"%lg %lg %c", &cp.x, &cp.y, &cp.ty )==3 ) { - if ( cur!=NULL ) { - if ( cur->spiro_cnt>=cur->spiro_max ) -- cur->spiros = realloc(cur->spiros,(cur->spiro_max+=10)*sizeof(spiro_cp)); -+ cur->spiros = realloc(cur->spiros, -+ (cur->spiro_max+=10)*sizeof(spiro_cp)); - cur->spiros[cur->spiro_cnt++] = cp; - } - } -- if ( cur!=NULL && (cur->spiros[cur->spiro_cnt-1].ty&0x7f)!=SPIRO_END ) { -+ if ( cur!=NULL && cur->spiro_cnt>0 -+ && (cur->spiros[cur->spiro_cnt-1].ty&0x7f)!=SPIRO_END ) { - if ( cur->spiro_cnt>=cur->spiro_max ) -- cur->spiros = realloc(cur->spiros,(cur->spiro_max+=1)*sizeof(spiro_cp)); -+ cur->spiros = realloc(cur->spiros, -+ (cur->spiro_max+=1)*sizeof(spiro_cp)); - memset(&cur->spiros[cur->spiro_cnt],0,sizeof(spiro_cp)); - cur->spiros[cur->spiro_cnt++].ty = SPIRO_END; - } -@@ -7992,10 +7995,12 @@ bool SFD_GetFontMetaData( FILE *sfd, - else if ( strmatch(tok,"LayerCount:")==0 ) - { - d->had_layer_cnt = true; -- getint(sfd,&sf->layer_cnt); -- if ( sf->layer_cnt>2 ) { -+ int layer_cnt_tmp; -+ getint(sfd,&layer_cnt_tmp); -+ if ( layer_cnt_tmp>2 ) { - sf->layers = realloc(sf->layers,sf->layer_cnt*sizeof(LayerInfo)); - memset(sf->layers+2,0,(sf->layer_cnt-2)*sizeof(LayerInfo)); -+ sf->layer_cnt = layer_cnt_tmp; - } - } - else if ( strmatch(tok,"Layer:")==0 ) -@@ -8948,6 +8953,10 @@ exit( 1 ); - } - } - -+ // Many downstream functions assume this isn't NULL (use strlen, etc.) -+ if ( sf->fontname==NULL) -+ sf->fontname = copy(""); -+ - if ( fromdir ) - sf = SFD_FigureDirType(sf,tok,dirname,enc,remap,had_layer_cnt); - else if ( sf->subfontcnt!=0 ) { -diff --git a/fontforge/sfd1.c b/fontforge/sfd1.c -index cf931059d0..b42f832678 100644 ---- a/fontforge/sfd1.c -+++ b/fontforge/sfd1.c -@@ -674,7 +674,7 @@ void SFD_AssignLookups(SplineFont1 *sf) { - - /* Fix up some gunk from really old versions of the sfd format */ - SFDCleanupAnchorClasses(&sf->sf); -- if ( sf->sf.uni_interp==ui_unset ) -+ if ( sf->sf.uni_interp==ui_unset && sf->sf.map!=NULL ) - sf->sf.uni_interp = interp_from_encoding(sf->sf.map->enc,ui_none); - - /* Fixup for an old bug */ diff --git a/fontforge-20190801-fix-metainfo.xml-file.patch b/fontforge-20190801-fix-metainfo.xml-file.patch deleted file mode 100644 index 471ee7d..0000000 --- a/fontforge-20190801-fix-metainfo.xml-file.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b26f33f178d1049070537166e3fac08b690de4d1 Mon Sep 17 00:00:00 2001 -From: muelli -Date: Tue, 6 Aug 2019 12:58:30 +0200 -Subject: [PATCH] appdata: remove spaces to comply with xml syntax - -The attribute had an illegal whitespace. appstream-glib validate complained: - -org.fontforge.FontForge.metainfo.xml: failed to parse org.fontforge.FontForge.metainfo.xml: Error on line 56 char 15: Odd character ?l?, expected a ?=? after attribute name ?xml:? of element ?p? - - -Now it does not complain about the syntax anymore, but instead about the description: -org.fontforge.FontForge.metainfo.xml: FAILED: -? style-invalid : Not enough

tags for a good description [0/1] -Validation of files failed ---- - desktop/org.fontforge.FontForge.metainfo.xml | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/desktop/org.fontforge.FontForge.metainfo.xml b/desktop/org.fontforge.FontForge.metainfo.xml -index 1ff9ea03e..3583e6da2 100644 ---- a/desktop/org.fontforge.FontForge.metainfo.xml -+++ b/desktop/org.fontforge.FontForge.metainfo.xml -@@ -49,15 +49,15 @@ -

- Apprendre à utiliser FontForge est facile, et il y a plusieurs tutoriels disponibles en commençant - par les bases jusqu'à des fonctionnalités plus avancées telles que la fabrication et l'utilisation de scripts.

--

-+

- FontForge je program za uređivanje konturnih i bitmap fontova. Omogućuje stvaranje, - uređivanje ili konvertiranje raznih vrsta fontova, uključujući PostScript, TrueType, - OpenType, CID, multiple-master, CFF, SVG i BitMap (bdf, FON, NFNT) fontove.

--

-+

- FontForge je slobodan softver otvorenog kȏda te je izrađen za razne operacijske - sustave. FontForge se može koristiti u grafičkom načinu rada ili putem naredbenog - retka.

--

-+

- FontForge je lako naučiti. Na raspolaganju stoje različiti priručnici – od osnovnih - vježbi, sve do naprednijih funkcija, kao što su izrada i upotreba skriptova.

-

diff --git a/fontforge.spec b/fontforge.spec index ae7a262..6e396fa 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -1,28 +1,21 @@ %global gettext_package FontForge -%global gittag0 20190801 +%global gittag0 20200314 Name: fontforge -Version: 20190801 -Release: 6%{?dist} +Version: 20200314 +Release: 1%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ URL: http://fontforge.github.io/ Source0: https://github.com/fontforge/%{name}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz -Patch0: fontforge-20190413-python-3.8-pkg-config.patch -# Below are upstream patches -Patch1: fontforge-20190801-fix-metainfo.xml-file.patch -# https://github.com/fontforge/fontforge/issues/4084 -Patch2: fontforge-20190801-cve-2020-5395.patch -# https://github.com/fontforge/fontforge/issues/4164 -Patch3: fontforge-20190801-cve-2020-5395-followup-fix.patch Requires: xdg-utils Requires: autotrace Requires: hicolor-icon-theme -BuildRequires: gcc -BuildRequires: git +BuildRequires: gcc-c++ +BuildRequires: cmake BuildRequires: libjpeg-devel BuildRequires: libtiff-devel BuildRequires: libpng-devel @@ -31,23 +24,18 @@ BuildRequires: libxml2-devel BuildRequires: freetype-devel BuildRequires: desktop-file-utils BuildRequires: libuninameslist-devel -BuildRequires: libXt-devel -BuildRequires: xorg-x11-proto-devel BuildRequires: gettext BuildRequires: pango-devel BuildRequires: cairo-devel BuildRequires: libspiro-devel BuildRequires: python3-devel -BuildRequires: gnulib-devel -BuildRequires: libtool-ltdl-devel BuildRequires: readline-devel BuildRequires: libappstream-glib -# This is failing on aarch64 so drop it -#BuildRequires: python-ipython # F25 build is failing add following to fix BuildRequires: shared-mime-info -# F30 onward need now -BuildRequires: /usr/bin/pathfix.py +# F33 onward need now +BuildRequires: gtk3-devel +BuildRequires: python3-sphinx %description FontForge (former PfaEdit) is a font editor for outline and bitmap @@ -56,14 +44,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} @@ -75,53 +62,45 @@ This package contains documentation files for %{name}. %prep %setup -q -%if 0%{?python3_version_nodots} >= 38 -%patch0 -p1 -%endif -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 - -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 +# Remove tests that requires Internet access +sed -i '45d;83d;101d;102d;114d;115d;125d' tests/CMakeLists.txt +rm tests/test003.pe tests/test130.pe tests/test0101.py tests/test929.py +# Remove tests for s390x +rm tests/test0004.py tests/test1009.py tests/test1010.py %build -./bootstrap --skip-git +rm -rf build && mkdir build +pushd build export CFLAGS="%{optflags} -fno-strict-aliasing" -%configure PYTHON=python3 -make V=1 %{?_smp_mflags} +%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} +%{make_build} +popd %install -make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" -rm -f $RPM_BUILD_ROOT%{_libdir}/libg{draw,unicode}.{la,so} +pushd build +%{make_install} +popd + desktop-file-install \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ --add-category X-Fedora \ desktop/org.fontforge.FontForge.desktop -# Let's remove the appdata file as it does not contain translation -# and tag. -rm -f %{buildroot}%{_datadir}/appdata/*.appdata.xml -rm -f %{buildroot}%{_metainfodir}/*.appdata.xml - -appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml - -# 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 - # 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 + +%check +pushd build +make check +popd + # Find translations %find_lang %{gettext_package} @@ -136,19 +115,20 @@ find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';' %{_mandir}/man1/*.1* %{_datadir}/pixmaps/org.fontforge.FontForge* %{_datadir}/mime/packages/fontforge.xml -%{_metainfodir}/org.fontforge.FontForge.metainfo.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 +* Wed Mar 25 2020 Parag Nemade - 20200314-1 +- Update to 20200314 version (#1813578) + * Sun Feb 16 2020 Parag Nemade - 20190801-6 - another fix for rh#1790042 - CVE-2020-5395:out-of-bounds write in sfd.c diff --git a/sources b/sources index 60439ae..1bfbb03 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fontforge-20190801.tar.gz) = d60fc69f9c692dd85e89e9c336dc5f141254f4472b02586145dd00b8f3d0b7608f229e3f642db2a03a42c4b543a0557286d0b617ddc3a1080e2c1791d4ea83d5 +SHA512 (fontforge-20200314.tar.gz) = 9eecee6162d5d160c9fe5d3e229763edb0b52f53529659f0fa8b41cf3edf0685509f51d3993da0e6e2c36fecde867af60062e131e10d7fdfbaac16323855818f diff --git a/tests/scripts/generate-font.py b/tests/scripts/generate-font.py new file mode 100644 index 0000000..633001f --- /dev/null +++ b/tests/scripts/generate-font.py @@ -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") + diff --git a/tests/scripts/generate-sfd.pe b/tests/scripts/generate-sfd.pe new file mode 100755 index 0000000..4877fc8 --- /dev/null +++ b/tests/scripts/generate-sfd.pe @@ -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) + diff --git a/tests/scripts/generate.pe b/tests/scripts/generate-ttf.pe similarity index 100% rename from tests/scripts/generate.pe rename to tests/scripts/generate-ttf.pe diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh index 83aebe3..389d6f5 100644 --- a/tests/scripts/run_tests.sh +++ b/tests/scripts/run_tests.sh @@ -1,4 +1,23 @@ #!/bin/bash -/usr/bin/fontforge -script generate.pe /usr/share/fontforge/python/test.sfd -/usr/bin/python3 get-font-metadata.py ./Untitled1.ttf +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 "----------------------------------------------------------" + From 18fb9f7e740e468de96004d3f222e423ba59d72b Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Fri, 27 Mar 2020 22:12:10 +0530 Subject: [PATCH 02/42] Enabled X11 and 2012 theme --- fontforge.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fontforge.spec b/fontforge.spec index 6e396fa..eb48945 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,7 +3,7 @@ Name: fontforge Version: 20200314 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ @@ -24,6 +24,8 @@ BuildRequires: libxml2-devel BuildRequires: freetype-devel BuildRequires: desktop-file-utils BuildRequires: libuninameslist-devel +BuildRequires: libXt-devel +BuildRequires: xorg-x11-proto-devel BuildRequires: gettext BuildRequires: pango-devel BuildRequires: cairo-devel @@ -74,7 +76,10 @@ rm -rf build && mkdir build pushd build export CFLAGS="%{optflags} -fno-strict-aliasing" -%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} +%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DENABLE_X11=ON \ + -DTHEME=2012 + %{make_build} popd @@ -126,6 +131,9 @@ popd %doc %{_pkgdocdir} %changelog +* Fri Mar 27 2020 Parag Nemade - 20200314-2 +- Enabled X11 and 2012 theme + * Wed Mar 25 2020 Parag Nemade - 20200314-1 - Update to 20200314 version (#1813578) From 58f23472d63e52cd65f1133de37671eff5005399 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Thu, 2 Apr 2020 22:24:50 +0530 Subject: [PATCH 03/42] Fix the GDK backend UI issues Move back to using GDK backend --- ...set_allowed_backends-before-gdk_init.patch | 27 +++++++++++++++++++ fontforge.spec | 14 +++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch diff --git a/fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch b/fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch new file mode 100644 index 0000000..6c1e797 --- /dev/null +++ b/fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch @@ -0,0 +1,27 @@ +From ee14a6389d19e2f45219134058e07f10585fa6d3 Mon Sep 17 00:00:00 2001 +From: Jeremy Tan +Date: Thu, 2 Apr 2020 18:03:47 +0800 +Subject: [PATCH] Call gdk_set_allowed_backends before gdk_init + +Fixes #4247 +--- + fontforgeexe/startui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fontforgeexe/startui.c b/fontforgeexe/startui.c +index 06f5200a4..114bb7fb6 100644 +--- a/fontforgeexe/startui.c ++++ b/fontforgeexe/startui.c +@@ -1182,8 +1182,8 @@ int fontforge_main( int argc, char **argv ) { + #endif + } + #ifdef FONTFORGE_CAN_USE_GDK +- gdk_init(&argc, &argv); + gdk_set_allowed_backends("win32,quartz,x11"); ++ gdk_init(&argc, &argv); + #endif + ensureDotFontForgeIsSetup(); + #if defined(__MINGW32__) && !defined(_NO_LIBCAIRO) +-- +2.26.0 + diff --git a/fontforge.spec b/fontforge.spec index eb48945..b5f7200 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,13 +3,16 @@ Name: fontforge Version: 20200314 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ URL: http://fontforge.github.io/ Source0: https://github.com/fontforge/%{name}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz +# https://github.com/fontforge/fontforge/pull/4253 +Patch0: fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch + Requires: xdg-utils Requires: autotrace Requires: hicolor-icon-theme @@ -64,6 +67,7 @@ This package contains documentation files for %{name}. %prep %setup -q +%patch0 -p1 # Remove tests that requires Internet access sed -i '45d;83d;101d;102d;114d;115d;125d' tests/CMakeLists.txt @@ -76,9 +80,7 @@ rm -rf build && mkdir build pushd build export CFLAGS="%{optflags} -fno-strict-aliasing" -%cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DENABLE_X11=ON \ - -DTHEME=2012 +%cmake .. -DCMAKE_BUILD_TYPE=Release %{make_build} popd @@ -131,6 +133,10 @@ popd %doc %{_pkgdocdir} %changelog +* Thu Apr 02 2020 Parag Nemade - 20200314-3 +- Fix the GDK backend UI issues +- Move back to using GDK backend + * Fri Mar 27 2020 Parag Nemade - 20200314-2 - Enabled X11 and 2012 theme From cf517d7106b6a73f76867e0306c91958a8ecd8b7 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Wed, 15 Apr 2020 20:42:48 +0530 Subject: [PATCH 04/42] Resolves:rhbz#1823525 - fontforge fails to build with Sphinx 3.0.0 --- ...inx-make-changes-to-support-Sphinx-3.patch | 62 +++++++++++++++++++ fontforge.spec | 8 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 fontforge-20200314-sphinx-make-changes-to-support-Sphinx-3.patch diff --git a/fontforge-20200314-sphinx-make-changes-to-support-Sphinx-3.patch b/fontforge-20200314-sphinx-make-changes-to-support-Sphinx-3.patch new file mode 100644 index 0000000..886a161 --- /dev/null +++ b/fontforge-20200314-sphinx-make-changes-to-support-Sphinx-3.patch @@ -0,0 +1,62 @@ +From 36b52b9902a9e3858ef34ec006b6ad5da6374de1 Mon Sep 17 00:00:00 2001 +From: Jeremy Tan +Date: Mon, 6 Apr 2020 20:57:14 +1000 +Subject: [PATCH] sphinx: make changes to support Sphinx 3 + +--- + doc/sphinx/scripting/python/fontforge.rst | 18 +++--------------- + 1 file changed, 3 insertions(+), 15 deletions(-) + +diff --git a/doc/sphinx/scripting/python/fontforge.rst b/doc/sphinx/scripting/python/fontforge.rst +index b97332229..f726b1ed4 100644 +--- a/doc/sphinx/scripting/python/fontforge.rst ++++ b/doc/sphinx/scripting/python/fontforge.rst +@@ -1365,6 +1365,7 @@ Layers may be compared to see if their contours are similar. + layer.stroke("calligraphic", width, height, angle[, FLAGS]) + layer.stroke("polygon", contour[, FLAGS]) + (Legacy interface) ++ :noindex: + + .. method:: layer.stroke("circular", width [, CAP, JOIN, ANGLE, KEYWORD]) + layer.stroke("elliptical", width, minor_width [, ANGLE, CAP, JOIN, KEYWORD]) +@@ -2458,6 +2459,7 @@ must be created through the font. + glyph.stroke("calligraphic", width, height, angle[, FLAGS]) + glyph.stroke("polygon", contour[, FLAGS]) + (Legacy interface) ++ :noindex: + + .. method:: glyph.stroke("circular", width[, CAP, JOIN, ANGLE, KEYWORD]) + glyph.stroke("elliptical", width, minor_width[, ANGLE, CAP, JOIN, KEYWORD]) +@@ -4786,21 +4788,6 @@ See the :class:`selection` type for how to alter the selection. + Extrema should be marked by on-curve points. If a curve in any selected + glyph lacks a point at a significant extremum this command will add one. + +-.. method:: font.addSmallCaps() +- +- For all selected upper or lower case letters in the latin, greek and +- cyrillic scripts this will try to create a small caps version of that glyph +- in a new glyph slot. +- +- So if you select "A" (or "a") then a glyph "a.sc" will be created (if "a.sc" +- already exists, it will be reused, and its current contents cleared). +- +- The contents of "a.sc" will be based on the upper case variant of this glyph +- (and that variant must be present for the command to work). FontForge will +- also create two lookups (unless appropriate ones already exist) one, bound +- to the feature 'c2sc' will map upper case letters to small caps, the other, +- bound to feature 'smcp' will map lower case letters to small caps. +- + .. method:: font.autoHint() + + Generates PostScript hints for all selected glyphs. +@@ -4993,6 +4980,7 @@ See the :class:`selection` type for how to alter the selection. + font.stroke("calligraphic", width, height, angle[, FLAGS]) + font.stroke("polygon", contour[, FLAGS]) + (Legacy interface) ++ :noindex: + + .. method:: font.stroke("circular", width[, CAP, JOIN, ANGLE, KEYWORD]) + font.stroke("elliptical", width, minor_width[, ANGLE, CAP, JOIN, KEYWORD]) +-- +2.26.0 + diff --git a/fontforge.spec b/fontforge.spec index b5f7200..9749f5e 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,7 +3,7 @@ Name: fontforge Version: 20200314 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ @@ -12,6 +12,8 @@ Source0: https://github.com/fontforge/%{name}/archive/%{gittag0}.tar.gz#/ # https://github.com/fontforge/fontforge/pull/4253 Patch0: fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch +# https://github.com/fontforge/fontforge/pull/4269 +Patch1: fontforge-20200314-sphinx-make-changes-to-support-Sphinx-3.patch Requires: xdg-utils Requires: autotrace @@ -68,6 +70,7 @@ This package contains documentation files for %{name}. %prep %setup -q %patch0 -p1 +%patch1 -p1 # Remove tests that requires Internet access sed -i '45d;83d;101d;102d;114d;115d;125d' tests/CMakeLists.txt @@ -133,6 +136,9 @@ popd %doc %{_pkgdocdir} %changelog +* Wed Apr 15 2020 Parag Nemade - 20200314-4 +- Resolves:rhbz#1823525 - fontforge fails to build with Sphinx 3.0.0 + * Thu Apr 02 2020 Parag Nemade - 20200314-3 - Fix the GDK backend UI issues - Move back to using GDK backend From af582c23473220152d75e2850ae1f48255ca052d Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Sat, 2 May 2020 16:17:56 +0530 Subject: [PATCH 05/42] Resolves:rhbz#1830502 - Add missing WOFF2 support --- fontforge.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fontforge.spec b/fontforge.spec index 9749f5e..e102332 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,7 +3,7 @@ Name: fontforge Version: 20200314 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ @@ -38,6 +38,7 @@ BuildRequires: libspiro-devel BuildRequires: python3-devel BuildRequires: readline-devel BuildRequires: libappstream-glib +BuildRequires: woff2-devel # F25 build is failing add following to fix BuildRequires: shared-mime-info # F33 onward need now @@ -83,7 +84,8 @@ rm -rf build && mkdir build pushd build export CFLAGS="%{optflags} -fno-strict-aliasing" -%cmake .. -DCMAKE_BUILD_TYPE=Release +%cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_WOFF2=ON %{make_build} popd @@ -136,6 +138,9 @@ popd %doc %{_pkgdocdir} %changelog +* Sat May 02 2020 Parag Nemade - 20200314-5 +- Resolves:rhbz#1830502 - Add missing WOFF2 support + * Wed Apr 15 2020 Parag Nemade - 20200314-4 - Resolves:rhbz#1823525 - fontforge fails to build with Sphinx 3.0.0 From fec2fdf263ae9f4d79ae853e014e22f330e1a96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 26 May 2020 02:45:38 +0200 Subject: [PATCH 06/42] Rebuilt for Python 3.9 --- fontforge.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fontforge.spec b/fontforge.spec index e102332..7a5617a 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,7 +3,7 @@ Name: fontforge Version: 20200314 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ @@ -138,6 +138,9 @@ popd %doc %{_pkgdocdir} %changelog +* Tue May 26 2020 Miro Hrončok - 20200314-6 +- Rebuilt for Python 3.9 + * Sat May 02 2020 Parag Nemade - 20200314-5 - Resolves:rhbz#1830502 - Add missing WOFF2 support From 8dfb846928ae556bc198b3a66f5f865ca99d8966 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 27 Jul 2020 17:41:17 +0000 Subject: [PATCH 07/42] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- fontforge.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fontforge.spec b/fontforge.spec index 7a5617a..bc76b1a 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,7 +3,7 @@ Name: fontforge Version: 20200314 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ @@ -138,6 +138,9 @@ popd %doc %{_pkgdocdir} %changelog +* Mon Jul 27 2020 Fedora Release Engineering - 20200314-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue May 26 2020 Miro Hrončok - 20200314-6 - Rebuilt for Python 3.9 From d970007d8790f73f7775b45c592dd0732e01f93c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 01:02:25 +0000 Subject: [PATCH 08/42] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- fontforge.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fontforge.spec b/fontforge.spec index bc76b1a..3a9919d 100644 --- a/fontforge.spec +++ b/fontforge.spec @@ -3,7 +3,7 @@ Name: fontforge Version: 20200314 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Outline and bitmap font editor License: GPLv3+ @@ -138,6 +138,10 @@ popd %doc %{_pkgdocdir} %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 20200314-8 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon Jul 27 2020 Fedora Release Engineering - 20200314-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 7c8685957603b3bd7490489d3abd86b4e1a44548 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Wed, 5 Aug 2020 13:02:09 +0530 Subject: [PATCH 09/42] Fix FTBFS bug by fixing glossary.rst and using new CMake macros --- ...forge-20200314-fix-glossary.rst-file.patch | 284 ++++++++++++++++++ fontforge.spec | 24 +- 2 files changed, 295 insertions(+), 13 deletions(-) create mode 100644 fontforge-20200314-fix-glossary.rst-file.patch diff --git a/fontforge-20200314-fix-glossary.rst-file.patch b/fontforge-20200314-fix-glossary.rst-file.patch new file mode 100644 index 0000000..2d511e7 --- /dev/null +++ b/fontforge-20200314-fix-glossary.rst-file.patch @@ -0,0 +1,284 @@ +--- doc/sphinx/glossary.rst.old 2020-03-14 09:06:49.000000000 +0530 ++++ doc/sphinx/glossary.rst 2020-08-05 12:06:45.574903248 +0530 +@@ -23,13 +23,13 @@ + Both Hebrew and Arabic have optional vowel marks and are called "impure" + abjads. Ancient Phoenician had nothing but consonants and is a "pure" abjad. + +- See Also: :term:`alphabet`, +- :term:`abugida`, :term:`syllabary` and ++ See Also: :term:`Alphabet`, ++ :term:`Abugida`, :term:`Syllabary` and + the relevant `Wikipedia article `__. + + Abugida +- An abugida is somewhere in between an :term:`alphabet` and +- a :term:`syllabary`. The Indic writing systems are ++ An abugida is somewhere in between an :term:`alphabet ` and ++ a :term:`syllabary `. The Indic writing systems are + probably the best known abugidas. + + In most abugidas there are independant glyphs for the consonants, and each +@@ -45,8 +45,8 @@ + An abugida differs from an abjad in that vowels (other than the default) must + be marked in the abugida. + +- See Also: :term:`alphabet`, :term:`abjad`, +- :term:`syllabary` and the relevant ++ See Also: :term:`Alphabet`, :term:`Abjad`, ++ :term:`Syllabary` and the relevant + `Wikipedia article `__. + + Advance Width +@@ -62,8 +62,8 @@ + vowels alike -- and (in theory anyway) all phonemes in a word will be marked + by an appropriate glyph. + +- See Also: :term:`abjad`, :term:`abugida`, +- :term:`syllabary` and the relevant ++ See Also: :term:`Abjad`, :term:`Abugida`, ++ :term:`Syllabary` and the relevant + `Wikipedia article `__. + + Apple Advanced Typography +@@ -83,7 +83,7 @@ + + Ascent + In traditional typography the ascent of a font was the distance from the top +- of a block of type to the :term:`baseline`. ++ of a block of type to the :term:`baseline `. + + Its precise meaning in modern typography seems to vary with different + definers. +@@ -127,7 +127,7 @@ + Black letter + Any of various type families based on medieval handwriting. + +- See also :term:`gothic`. ++ See also :term:`Gothic`. + + BMP + Basic Multilingual Plane +@@ -142,13 +142,13 @@ + (0xE0000-0xEFFFF) + + Bold +- A common font :term:`style`. The stems of the glyphs are ++ A common font :term:`style