Update to 20190317 release (#1689629)
This commit is contained in:
parent
4e0eb6062d
commit
3bd08274a0
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ fontforge_full-20100501.tar.bz2
|
|||||||
/fontforge-20161012.tar.gz
|
/fontforge-20161012.tar.gz
|
||||||
/fontforge-20170731.tar.gz
|
/fontforge-20170731.tar.gz
|
||||||
/gnulib-b324052.tar.gz
|
/gnulib-b324052.tar.gz
|
||||||
|
/fontforge-20190317.tar.gz
|
||||||
|
@ -1,519 +0,0 @@
|
|||||||
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,6 +1,7 @@
|
|||||||
--- ./Makefile.am.old 2014-08-12 10:07:32.000000000 +0530
|
diff -urN fontforge-20190317.old/Makefile.am fontforge-20190317/Makefile.am
|
||||||
+++ ./Makefile.am 2014-09-08 16:23:56.046996941 +0530
|
--- fontforge-20190317.old/Makefile.am 2019-03-17 08:54:14.000000000 +0530
|
||||||
@@ -43,7 +43,6 @@
|
+++ fontforge-20190317/Makefile.am 2019-03-22 10:54:57.634463197 +0530
|
||||||
|
@@ -47,7 +47,6 @@
|
||||||
AM_CPPFLAGS =
|
AM_CPPFLAGS =
|
||||||
AM_LDFLAGS =
|
AM_LDFLAGS =
|
||||||
|
|
||||||
@ -8,15 +9,15 @@
|
|||||||
EXTRA_DIST =
|
EXTRA_DIST =
|
||||||
CLEANFILES =
|
CLEANFILES =
|
||||||
MOSTLYCLEANFILES =
|
MOSTLYCLEANFILES =
|
||||||
@@ -113,7 +112,6 @@
|
@@ -118,7 +117,6 @@
|
||||||
Packaging/FontForge-doc.spec \
|
|
||||||
Packaging/FontForge.spec \
|
Packaging/FontForge.spec \
|
||||||
Packaging/FontForge.static.spec \
|
Packaging/FontForge.static.spec \
|
||||||
|
README \
|
||||||
- uthash/src \
|
- uthash/src \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
@@ -129,11 +127,6 @@
|
@@ -134,11 +132,6 @@
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
@ -1,10 +1,10 @@
|
|||||||
%global gettext_package FontForge
|
%global gettext_package FontForge
|
||||||
%global gnulib_githead b324052
|
%global gnulib_githead b324052
|
||||||
%global gittag0 20170731
|
%global gittag0 20190317
|
||||||
|
|
||||||
Name: fontforge
|
Name: fontforge
|
||||||
Version: %{gittag0}
|
Version: %{gittag0}
|
||||||
Release: 12%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Outline and bitmap font editor
|
Summary: Outline and bitmap font editor
|
||||||
|
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
@ -13,9 +13,7 @@ Source0: https://github.com/fontforge/%{name}/archive/%{gittag0}.tar.gz#/
|
|||||||
# https://github.com/fontforge/fontforge/issues/1725
|
# 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
|
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
|
# https://github.com/fontforge/fontforge/pull/1723
|
||||||
Patch0: fontforge-20140813-use-system-uthash.patch
|
Patch0: fontforge-20190317-use-system-uthash.patch
|
||||||
# Fedora specific patch to have python3 support only
|
|
||||||
Patch1: Add-python3-support.patch
|
|
||||||
|
|
||||||
Requires: xdg-utils
|
Requires: xdg-utils
|
||||||
Requires: autotrace
|
Requires: autotrace
|
||||||
@ -41,11 +39,14 @@ BuildRequires: python3-devel
|
|||||||
BuildRequires: gnulib-devel
|
BuildRequires: gnulib-devel
|
||||||
BuildRequires: libtool-ltdl-devel
|
BuildRequires: libtool-ltdl-devel
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
|
BuildRequires: libappstream-glib
|
||||||
# This is failing on aarch64 so drop it
|
# This is failing on aarch64 so drop it
|
||||||
#BuildRequires: python-ipython
|
#BuildRequires: python-ipython
|
||||||
BuildRequires: uthash-devel
|
BuildRequires: uthash-devel
|
||||||
# F25 build is failing add following to fix
|
# F25 build is failing add following to fix
|
||||||
BuildRequires: shared-mime-info
|
BuildRequires: shared-mime-info
|
||||||
|
# F30 onward need now
|
||||||
|
BuildRequires: /usr/bin/pathfix.py
|
||||||
|
|
||||||
Provides: bundled(gnulib)
|
Provides: bundled(gnulib)
|
||||||
|
|
||||||
@ -86,6 +87,8 @@ chmod 644 htdocs/nonBMP/index.html
|
|||||||
%{__sed} -i 's/\r//' htdocs/Big5.txt
|
%{__sed} -i 's/\r//' htdocs/Big5.txt
|
||||||
%{__sed} -i 's/\r//' htdocs/corpchar.txt
|
%{__sed} -i 's/\r//' htdocs/corpchar.txt
|
||||||
|
|
||||||
|
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" pycontrib/gdraw/
|
||||||
|
|
||||||
%build
|
%build
|
||||||
./bootstrap --skip-git --gnulib-srcdir=gnulib-%{gnulib_githead}
|
./bootstrap --skip-git --gnulib-srcdir=gnulib-%{gnulib_githead}
|
||||||
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
||||||
@ -100,7 +103,14 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libg{draw,unicode}.{la,so}
|
|||||||
desktop-file-install \
|
desktop-file-install \
|
||||||
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
|
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
|
||||||
--add-category X-Fedora \
|
--add-category X-Fedora \
|
||||||
desktop/fontforge.desktop
|
desktop/org.fontforge.FontForge.desktop
|
||||||
|
|
||||||
|
# Let's remove the appdata file as it does not contain translation
|
||||||
|
# and <name> 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
|
# The fontforge makefiles install htdocs as well, but we
|
||||||
# prefer to have them under the standard RPM location, so
|
# prefer to have them under the standard RPM location, so
|
||||||
@ -114,12 +124,6 @@ find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';'
|
|||||||
# Find translations
|
# Find translations
|
||||||
%find_lang %{gettext_package}
|
%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.
|
#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/graphicore/__init__.py
|
||||||
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/python/gdraw/_gdraw.py
|
chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/python/gdraw/_gdraw.py
|
||||||
@ -130,15 +134,16 @@ chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/nodejs/collabwebview/js/contentEd
|
|||||||
|
|
||||||
%files -f %{gettext_package}.lang
|
%files -f %{gettext_package}.lang
|
||||||
%doc AUTHORS
|
%doc AUTHORS
|
||||||
%license LICENSE
|
%license LICENSE COPYING.gplv3
|
||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
%{_libdir}/lib*.so.*
|
%{_libdir}/lib*.so.*
|
||||||
%{_datadir}/applications/*fontforge.desktop
|
%{_datadir}/applications/*FontForge.desktop
|
||||||
%{_datadir}/fontforge
|
%{_datadir}/fontforge
|
||||||
%{_datadir}/icons/hicolor/*/apps/fontforge.*
|
%{_datadir}/icons/hicolor/*/apps/org.fontforge.FontForge*
|
||||||
%{_mandir}/man1/*.1*
|
%{_mandir}/man1/*.1*
|
||||||
|
%{_datadir}/pixmaps/org.fontforge.FontForge*
|
||||||
%{_datadir}/mime/packages/fontforge.xml
|
%{_datadir}/mime/packages/fontforge.xml
|
||||||
%{_datadir}/appdata/fontforge.appdata.xml
|
%{_metainfodir}/org.fontforge.FontForge.metainfo.xml
|
||||||
%{python3_sitearch}/fontforge.so
|
%{python3_sitearch}/fontforge.so
|
||||||
%{python3_sitearch}/psMat.so
|
%{python3_sitearch}/psMat.so
|
||||||
|
|
||||||
@ -151,6 +156,9 @@ chmod 644 $RPM_BUILD_ROOT%{_datadir}/fontforge/nodejs/collabwebview/js/contentEd
|
|||||||
%doc htdocs
|
%doc htdocs
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* 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
|
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 20170731-12
|
||||||
- Rebuild for readline 8.0
|
- Rebuild for readline 8.0
|
||||||
|
|
||||||
|
2
sources
2
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (fontforge-20170731.tar.gz) = 756b80cf1b0416dbb649838f98e24ba696f0064d4d66720776e52c236fe9339c752cfac629b1c288fdce25fa6790be0e8d186f60291edf1736081fe76a2c5d7e
|
SHA512 (fontforge-20190317.tar.gz) = a32a5c2c54f614ba94c46bfdb049e42433224aa97713fb5033f8a05decca01bdc8a329ae9740f2e948080c1c1c47d24458a80d78c31ae0b9b50c18bf2484a10c
|
||||||
SHA512 (gnulib-b324052.tar.gz) = 5aeb563698a744f77c73deefcda2c3cd99f7b85c5475f30de9f0fcee7ef68b289092e40192a690a5b70a827921b1a2a05efe43f70538dc1840dba6ebef4f20ed
|
SHA512 (gnulib-b324052.tar.gz) = 5aeb563698a744f77c73deefcda2c3cd99f7b85c5475f30de9f0fcee7ef68b289092e40192a690a5b70a827921b1a2a05efe43f70538dc1840dba6ebef4f20ed
|
||||||
|
Loading…
Reference in New Issue
Block a user