-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export #34
Comments
Having some errors with this
Here is the code: self.main_path = "ufo/sample.ufo"
self.main_font = Font(self.main_path) the export function def _write_ttf(self, button):
##NOT WORKING##
##Error: defcon.errors.DefconError: the kerning data is not valid##
file_name = os.path.join(self.get_activity_root(), 'instance',
'%s.ttf' % self.metadata['title'])
#file_name = self.metadata['title'] + '.ttf'
ttf = compileTTF(self.main_font)
ttf.save(file_name)
jobject = datastore.create()
jobject.metadata['icon-color'] = profile.get_color().to_string()
jobject.metadata['mime_type'] = 'application/ttf'
jobject.metadata['title'] = self.metadata['title']
jobject.file_path = file_name
# jobject.metadata['preview'] = \
# self._get_preview_image(file_name)
datastore.write(jobject, transfer_ownership=True)
self._object_id = jobject.object_id
self._show_journal_alert(_('Success'),
_('A TTF Font file was created in the Journal')) |
I suggest NOT doing TTFs, only OTFs. |
the commands are same for both of them, so its the same thing On Thu, Jun 16, 2016 at 6:19 PM Dave Crossland [email protected]
|
Can you successfully export both kinds? :) |
Yes, I can from ufo2ft import compileOTF, compileTTF
from defcon import Font
ufo = Font('abc.ufo')
otf = compileOTF(ufo)
ttf = compileTTF(ufo)
ttf.save('MyFont-Regular.ttf')
otf.save('MyFont-Regular.otf') |
If the only problem is with kerning, then we can just ignore kerning for the 1.0 release |
I recommend using fontmake itself; your example misses steps like https://github.com/googlei18n/fontmake/blob/master/Lib/fontmake/font_project.py#L129-L135 |
I believe the next step is to confirm this works in the upcoming .xo release |
I'm getting the following error "can't find module compreffor" when using the module ufo2ft |
ah, I figured out how to add the compreffor module but now I'm getting an error in it
|
I suggest reporting the bug upstream |
the previous error was due to the ufo2ft module
|
Can anyone help with the above error? |
The problem is that the You can try installing the https://pypi.python.org/pypi/pyclipper package and using that instead of the .so file included in the git repo |
yesterday in IM @davelab6 suggested to use the selective functions out of FontProject to avoid pyclipper by avoiding booleanOperations completely import fontmake.font_project import FontProject in a python interpreter in the terminal activity inside sugar importing booleanOperation can not be avoided and hence we get the same GLIBXX not found error If I comment out the booleanOperations import statement in the font_project still there are other modules like compreffor which require the same GLIBXX and hence we get the same error I think if we can somehow add the fontmake's setup.py file to the activities setup.py so that it is compiled with the activity itself |
@walterbender can you have a look at this import fontmake.font_project import FontProject still gives the error
I've tried copying the way using in the Physics activity but that doesn't even get called because here the then I tried importing the ``libstdc++.so` file before importing fontmake, from ctypes import cdll
from sys import path
path.insert(0, 'third_party/pyclipper/pyclipper_64')
libstdc = cdll.LoadLibrary("third_party/pyclipper/pyclipper_64/libstdc++.so")
libstdc = cdll.LoadLibrary("third_party/pyclipper/pyclipper_64/libstdc++.so.6") but then I get the error on this line
saying(roughly)
but I can see the file in the directory mentioned PS: all this was tried in a sugar dev env on my 64bit Ubuntu 16.04 using the terminal activity |
@YashAgarwal I suggest looking again at avoiding booleanOperations. With only a few days left, I would prefer to have a .xo that can export fonts with overlaps. |
The text was updated successfully, but these errors were encountered: