Compare commits
No commits in common. "2e6fb9afef420433e33b8df4833ca0483bff3a60" and "9c783b60f88a69c8420a6489110a8792b4b01569" have entirely different histories.
2e6fb9afef
...
9c783b60f8
519
Add-python3-support.patch
Normal file
519
Add-python3-support.patch
Normal file
@ -0,0 +1,519 @@
|
|||||||
|
From b2c5de7835a753cad1f35db8202c4733b5fc2990 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Parag A Nemade <pnemade@fedoraproject.org>
|
||||||
|
Date: Mon, 3 Oct 2016 12:56:29 +0530
|
||||||
|
Subject: [PATCH] Add python3 support
|
||||||
|
|
||||||
|
Signed-off-by: Parag A Nemade <pnemade@fedoraproject.org>
|
||||||
|
---
|
||||||
|
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 | 4 +--
|
||||||
|
pycontrib/gdraw/gdraw.py | 20 +++++++--------
|
||||||
|
pycontrib/graphicore.py | 4 +--
|
||||||
|
pycontrib/graphicore/ipython_view.py | 13 +++++-----
|
||||||
|
pycontrib/graphicore/shell.py | 4 +--
|
||||||
|
pycontrib/svg2sfd.py | 38 ++++++++++++++--------------
|
||||||
|
pycontrib/webcollab.py | 6 ++---
|
||||||
|
15 files changed, 70 insertions(+), 69 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..dde7ea8 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
|
||||||
|
@@ -22,7 +22,7 @@ Copyright <hashao2@gmail.com> 2009
|
||||||
|
__all__ = ['Timer', 'GtkRunner', 'gtkrunner']
|
||||||
|
__version__ = '0.1'
|
||||||
|
|
||||||
|
-from gdraw import *
|
||||||
|
+from .gdraw import *
|
||||||
|
|
||||||
|
def main():
|
||||||
|
pass
|
||||||
|
diff --git a/pycontrib/gdraw/gdraw.py b/pycontrib/gdraw/gdraw.py
|
||||||
|
index f2d5e50..8b6e693 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
|
||||||
|
@@ -67,7 +67,7 @@ def setup_syspath(modpath="modules"):
|
||||||
|
|
||||||
|
__all__ = ['Timer', 'GtkRunner', 'gtkrunner']
|
||||||
|
|
||||||
|
-from _gdraw import *
|
||||||
|
+from ._gdraw import *
|
||||||
|
from ctypes import *
|
||||||
|
import types
|
||||||
|
|
||||||
|
@@ -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..229a2b7 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
|
||||||
|
@@ -22,4 +22,4 @@ sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
|
||||||
|
sys.path.reverse();
|
||||||
|
|
||||||
|
#load the modules
|
||||||
|
-import graphicore.shell
|
||||||
|
\ No newline at end of file
|
||||||
|
+import graphicore.shell
|
||||||
|
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..32fa584 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
|
||||||
|
@@ -32,7 +32,7 @@ if len(sys.argv) == 0:
|
||||||
|
# some versions of IPython need content in sys.argv
|
||||||
|
sys.argv.append('')
|
||||||
|
|
||||||
|
-from ipython_view import *
|
||||||
|
+from .ipython_view import *
|
||||||
|
import gdraw
|
||||||
|
|
||||||
|
def runShell(data = None, glyphOrFont = None):
|
||||||
|
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..4be07ec 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
|
||||||
|
@@ -44,8 +44,8 @@ def startWebServerInCollabMode(data = None, glyphOrFont = None):
|
||||||
|
global child
|
||||||
|
global childNodejs
|
||||||
|
ensureChildClosed()
|
||||||
|
- print("FONTFORGE:" + FONTFORGE)
|
||||||
|
- print("script path:" + collabpath + "web-test-collab.py")
|
||||||
|
+ print(("FONTFORGE:" + FONTFORGE))
|
||||||
|
+ print(("script path:" + collabpath + "web-test-collab.py"))
|
||||||
|
child = subprocess.Popen( [ FONTFORGE, "-forceuihidden", "-script", collabpath + "web-test-collab.py" ] )
|
||||||
|
#
|
||||||
|
# start the nodejs server
|
||||||
|
--
|
||||||
|
2.9.3
|
||||||
|
|
||||||
@ -1,178 +0,0 @@
|
|||||||
From 216eb14b558df344b206bf82e2bdaf03a1f2f429 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Peter Kydas <pk@canva.com>
|
|
||||||
Date: Tue, 6 Feb 2024 20:03:04 +1100
|
|
||||||
Subject: [PATCH] fix splinefont shell command injection (#5367)
|
|
||||||
|
|
||||||
---
|
|
||||||
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) {
|
|
||||||
30
fontforge-20140813-use-system-uthash.patch
Normal file
30
fontforge-20140813-use-system-uthash.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
--- ./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.
|
||||||
|
|
||||||
Binary file not shown.
@ -1,27 +0,0 @@
|
|||||||
From ee14a6389d19e2f45219134058e07f10585fa6d3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jeremy Tan <jtanx@outlook.com>
|
|
||||||
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
|
|
||||||
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
From 36b52b9902a9e3858ef34ec006b6ad5da6374de1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jeremy Tan <jtanx@outlook.com>
|
|
||||||
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
|
|
||||||
|
|
||||||
158
fontforge.spec
158
fontforge.spec
@ -1,134 +1,108 @@
|
|||||||
%global gettext_package FontForge
|
|
||||||
%global gittag0 20200314
|
|
||||||
|
|
||||||
Name: fontforge
|
Name: fontforge
|
||||||
Version: 20200314
|
Version: 20170731
|
||||||
Release: 5
|
Release: 12
|
||||||
Summary: Outline and bitmap font editor
|
Summary: Outline and bitmap font editor
|
||||||
|
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
URL: http://fontforge.github.io/
|
URL: http://fontforge.github.io/
|
||||||
Source0: https://github.com/fontforge/%{name}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz
|
Source0: https://github.com/fontforge/fontforge/archive/20170731.tar.gz#/fontforge-%{version}.tar.gz
|
||||||
|
Source1: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=b324052;sf=tgz;name=gnulib-b324052.tar.gz
|
||||||
|
Patch0000: fontforge-20140813-use-system-uthash.patch
|
||||||
|
Patch0001: Add-python3-support.patch
|
||||||
|
|
||||||
Patch0001: fontforge-20200314-Call-gdk_set_allowed_backends-before-gdk_init.patch
|
Requires: xdg-utils hicolor-icon-theme
|
||||||
Patch0002: fontforge-20200314-sphinx-make-changes-to-support-Sphinx-3.patch
|
|
||||||
# https://github.com/fontforge/fontforge/commit/216eb14b558df344b206bf82e2bdaf03a1f2f429
|
|
||||||
Patch0003: CVE-2024-25081_CVE-2024-25082.patch
|
|
||||||
|
|
||||||
Requires: xdg-utils potrace hicolor-icon-theme
|
BuildRequires: gcc git libjpeg-devel libtiff-devel libpng-devel giflib-devel libxml2-devel freetype-devel
|
||||||
BuildRequires: gcc-c++ cmake libjpeg-devel libtiff-devel libpng-devel giflib-devel libxml2-devel
|
BuildRequires: desktop-file-utils libXt-devel libXi-devel xorg-x11-proto-devel gettext pango-devel cairo-devel
|
||||||
BuildRequires: freetype-devel desktop-file-utils libuninameslist-devel libXt-devel xorg-x11-proto-devel
|
BuildRequires: python3-devel gnulib-devel libtool-ltdl-devel readline-devel uthash-devel shared-mime-info
|
||||||
BuildRequires: gettext pango-devel cairo-devel libspiro-devel python3-devel readline-devel
|
|
||||||
BuildRequires: libappstream-glib woff2-devel shared-mime-info gtk3-devel python3-sphinx
|
Provides: bundled(gnulib)
|
||||||
|
|
||||||
%description
|
%description
|
||||||
FontForge (former PfaEdit) is a font editor for outline and bitmap
|
FontForge is designed for editing outline and bitmap fonts in various formats, such as PostScript (ASCII and
|
||||||
fonts. It supports a range of font formats, including PostScript
|
binary Type 1, some Type 3 and Type 0), TrueType, OpenType (Type2) and CID-keyed fonts.
|
||||||
(ASCII and binary Type 1, some Type 3 and Type 0), TrueType, OpenType
|
|
||||||
(Type2) and CID-keyed fonts.
|
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for fontforge
|
Summary: Development tools for fontforge
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: fontforge = %{version}-%{release} fontforge-help = %{version}-%{release} pkgconfig
|
||||||
Requires: %{name}-help = %{version}-%{release}
|
|
||||||
Requires: pkgconfig
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
This package includes the library files you will need to compile
|
This package includes the libraries and header files for developing applications against fontforge.
|
||||||
applications against fontforge.
|
|
||||||
|
|
||||||
%package help
|
%package help
|
||||||
Summary: Documentation files for %{name}
|
Summary: Documentation files for fontforge
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Provides: %{name}-doc = %{version}-%{release}
|
|
||||||
Obsoletes: %{name}-doc < %{version}-%{release}
|
Provides: fontforge-doc = %{version}-%{release}
|
||||||
|
Obsoletes: fontforge-doc < %{version}-%{release}
|
||||||
|
|
||||||
|
%description help
|
||||||
|
This package contains documentation files for fontforge.
|
||||||
|
|
||||||
%description help
|
|
||||||
This package contains documentation files for %{name}.
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{version} -p1
|
%autosetup -p1
|
||||||
|
tar xzf %{SOURCE1}
|
||||||
# Remove tests that requires Internet access
|
sed -i -e '/^#!\//, 1d' pycontrib/webcollab.py
|
||||||
sed -i '45d;83d;101d;102d;114d;115d;125d' tests/CMakeLists.txt
|
mkdir htdocs
|
||||||
rm tests/test003.pe tests/test130.pe tests/test0101.py tests/test929.py
|
cp -pr doc/html/* htdocs
|
||||||
# Remove tests for s390x
|
%{__sed} -i 's/\r//' htdocs/Big5.txt
|
||||||
rm tests/test0004.py tests/test1009.py tests/test1010.py
|
%{__sed} -i 's/\r//' htdocs/corpchar.txt
|
||||||
|
|
||||||
%build
|
%build
|
||||||
rm -rf build && mkdir build
|
./bootstrap --skip-git --gnulib-srcdir=gnulib-b324052
|
||||||
pushd build
|
|
||||||
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
||||||
|
|
||||||
%cmake .. -DCMAKE_BUILD_TYPE=Release \
|
%configure PYTHON=python3 --without-libspiro --without-libuninameslist
|
||||||
-DENABLE_WOFF2=ON \
|
%make_build V=1
|
||||||
-DENABLE_DOCS=NO
|
|
||||||
|
|
||||||
%{make_build}
|
|
||||||
popd
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
pushd build
|
%make_install
|
||||||
%{make_install}
|
rm -f $RPM_BUILD_ROOT%{_libdir}/libgdraw.la
|
||||||
popd
|
rm -f $RPM_BUILD_ROOT%{_libdir}/libgunicode.la
|
||||||
|
rm -f $RPM_BUILD_ROOT%{_libdir}/libgdraw.so
|
||||||
|
rm -f $RPM_BUILD_ROOT%{_libdir}/libgunicode.so
|
||||||
|
|
||||||
|
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
|
||||||
|
desktop/fontforge.desktop
|
||||||
|
|
||||||
|
|
||||||
desktop-file-install \
|
%delete_la_and_a
|
||||||
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
|
|
||||||
--add-category X-Fedora \
|
|
||||||
desktop/org.fontforge.FontForge.desktop
|
|
||||||
|
|
||||||
# remove unneeded .la and .a files
|
%find_lang FontForge
|
||||||
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}
|
install -d $RPM_BUILD_ROOT%{_datadir}/appdata
|
||||||
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
|
install -pm 644 desktop/fontforge.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata
|
||||||
|
|
||||||
# Find translations
|
install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages
|
||||||
%find_lang %{gettext_package}
|
install -pm 644 desktop/fontforge.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/
|
||||||
|
|
||||||
%check
|
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/python/gdraw/_gdraw.py
|
||||||
pushd build
|
|
||||||
make check
|
|
||||||
popd
|
|
||||||
|
|
||||||
%files -f %{gettext_package}.lang
|
%files -f FontForge.lang
|
||||||
%doc AUTHORS
|
%doc AUTHORS
|
||||||
%license LICENSE COPYING.gplv3
|
%license LICENSE
|
||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
%{_libdir}/lib*.so.*
|
%{_libdir}/lib*.so.*
|
||||||
%{_datadir}/applications/*FontForge.desktop
|
%{_datadir}/applications/*fontforge.desktop
|
||||||
%{_datadir}/fontforge
|
%{_datadir}/fontforge
|
||||||
%{_datadir}/icons/hicolor/*/apps/org.fontforge.FontForge*
|
%{_datadir}/icons/*
|
||||||
%{_datadir}/pixmaps/org.fontforge.FontForge*
|
%{_datadir}/mime/*
|
||||||
%{_datadir}/mime/packages/fontforge.xml
|
%{_datadir}/appdata/*
|
||||||
%{_metainfodir}/org.fontforge.FontForge.appdata.xml
|
|
||||||
%{python3_sitearch}/fontforge.so
|
%{python3_sitearch}/fontforge.so
|
||||||
%{python3_sitearch}/psMat.so
|
%{python3_sitearch}/psMat.so
|
||||||
|
%exclude %{_datadir}/doc/fontforge
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
|
%{_includedir}/fontforge/
|
||||||
%{_libdir}/lib*.so
|
%{_libdir}/lib*.so
|
||||||
|
%{_libdir}/pkgconfig/*.pc
|
||||||
|
|
||||||
%files help
|
%files help
|
||||||
%doc %{_pkgdocdir}
|
%doc htdocs
|
||||||
%{_mandir}/man1/*.1*
|
%{_mandir}/man1/*.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Feb 27 2024 yaoxin <yao_xin001@hoperun.com> - 20200314-5
|
|
||||||
- Fix CVE-2024-25081 and CVE-2024-25082
|
|
||||||
|
|
||||||
* Fri May 21 2021 wutao <wutao61@huawei.com> - 20200314-4
|
|
||||||
- update release
|
|
||||||
|
|
||||||
* Wed Dec 16 2020 Ge Wang <wangge20@huawei.com> - 20200314-2
|
|
||||||
- change install require autotrace to potrace
|
|
||||||
|
|
||||||
* Wed Aug 26 2020 jinzhimin <jinzhimin2@huawei.com> - 20200314-1
|
|
||||||
- upgrade to 20200314
|
|
||||||
|
|
||||||
* Tue Aug 18 2020 senlin<xiasenlin1@huawei.com> - 20170731-13
|
|
||||||
- add release for update
|
|
||||||
|
|
||||||
* Thu Apr 3 2020 zhujunhao <zhujunhao5@huawei.com> - 20170731-12
|
* Thu Apr 3 2020 zhujunhao <zhujunhao5@huawei.com> - 20170731-12
|
||||||
- Modify build option
|
- Modify build option
|
||||||
|
|
||||||
|
|||||||
BIN
gnulib-b324052.tar.gz
Normal file
BIN
gnulib-b324052.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user