diff --git a/apple410/plot_to_cairo.py b/apple410/plot_to_cairo.py index b6f1927..2f2edf1 100755 --- a/apple410/plot_to_cairo.py +++ b/apple410/plot_to_cairo.py @@ -2,6 +2,8 @@ import sys import math import cairo +import pkg_resources +import pickle def coordlist(line,expected=-1): l = list(map(float,line.split(','))) @@ -42,6 +44,10 @@ class CairoPlotter: self.text_theta = 0 self.text_size = 1 self.update_ctm() + # load plotter fonts + char_f = open(pkg_resources.resource_filename('apple410','data/a410_chars.pickle'),'rb') + self.char_map = pickle.load(char_f) + # A quick review of coordinate systems: # Cairo native: origin at upper left, x+ to right, y+ down. diff --git a/setup.py b/setup.py index 8387f81..a19cff7 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,8 @@ setup( # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). - packages=find_packages(exclude=['contrib', 'docs', 'tests']), + packages=['apple410'], + package_data={'apple410' : ['data/*.pickle']}, install_requires=['pyserial'], python_requires='>=3',