pax_global_header00006660000000000000000000000064136172623370014524gustar00rootroot0000000000000052 comment=eaeef05bf07b317b4ec45d24975c45731e995e97 cu2qu-1.6.7/000077500000000000000000000000001361726233700125765ustar00rootroot00000000000000cu2qu-1.6.7/.codecov.yml000066400000000000000000000001151361726233700150160ustar00rootroot00000000000000comment: false coverage: status: project: off patch: off cu2qu-1.6.7/.coveragerc000066400000000000000000000016231361726233700147210ustar00rootroot00000000000000[run] # measure 'branch' coverage in addition to 'statement' coverage # See: http://coverage.readthedocs.org/en/coverage-4.0.3/branch.html#branch branch = True # list of directories or packages to measure source = cu2qu # this is simply vendored, no need to include in coverage report omit = */cu2qu/cython.py # these are treated as equivalent when combining data [paths] source = Lib/cu2qu .tox/*/lib/python*/site-packages/cu2qu .tox/pypy*/site-packages/cu2qu [report] # Regexes for lines to exclude from consideration exclude_lines = # keywords to use in inline comments to skip coverage pragma: no cover # don't complain if tests don't hit defensive assertion code raise AssertionError raise NotImplementedError # don't complain if non-runnable code isn't run if 0: if __name__ == .__main__.: # ignore source code that can’t be found ignore_errors = True cu2qu-1.6.7/.gitignore000066400000000000000000000005341361726233700145700ustar00rootroot00000000000000# Byte-compiled and optimized files __pycache__/ *.py[cod] *$py.class *.so # cython generated C/HTML files Lib/cu2qu/*.c Lib/cu2qu/*.html # Packaging *.egg-info *.eggs build dist # Unit test and coverage files .cache .coverage .coverage.* .tox htmlcov .pytest_cache/ # OS X Finder .DS_Store # auto-generated version file Lib/cu2qu/_version.py cu2qu-1.6.7/.pyup.yml000066400000000000000000000002501361726233700143710ustar00rootroot00000000000000# controls the frequency of updates (undocumented beta feature) schedule: every week # do not pin dependencies unless they have explicit version specifiers pin: False cu2qu-1.6.7/.travis.yml000066400000000000000000000024531361726233700147130ustar00rootroot00000000000000sudo: false language: python env: global: - TWINE_USERNAME="anthrotype" - secure: uIlWYz63F0Y/pDZawW2mS5DolWghdIodM8VtJtGbyIYB3fL3/edwTG5z+FWKaNeRtNfTAGDMs0y2dF45IJ7ZqTzw4yotgHz0uzLqjGjQ1/MOu99tppoXA6wQocZvmrdZpUcRbvBzJQzpAUcjldPLAP200mV9cG8+LfODn8Di2eJ329Ts3aA140pjUF8791jRLHBhUTpxK5RDPn1Q7OlugjryS7yNVIfT1/DaNDXAu4OZ8oNkygioRcyZ9QiFLjv5yBZ7uHB4UXWxw89RYPyz4NfHwyzDR38X/A6vfP19w2V0kecAK5BVBUE+WI7d26XjQzxDuH6Z0phB3x6MFuCXrX/pdrvNr7hs5kTAdQ7R1YA6MH4lPa+7oXha1/j353StzDMUKByXGVHyLAv7Ct2RSXOHUM6hAB4T+JbyJp/YkPWh968GKpl1lwvziKTi7K1qpngbXCdYIYKJ78IbmDcxzmQ+3j+fsXt9+gArZW7ICLgWrs+Lr1FiJsBOKLmqigOSmqrjHa+ef+wjieFSgzCVIfr9zvibzCEtYeqkuJuDQcSBIS0JG/heOfBGQ6FIxSXzwvICyWpldmfP67nBjVOVzPcyEAT8w+45LOM0HPCm6+Xjn7mKstc7x9TD7dVjWeyKJzZuKSmuAFA4UtGGKDQ93YQlAY2SCW4irYsusj80LHU= matrix: include: - env: TOXENV=py27-nocy python: 2.7 - env: TOXENV=py36-nocy python: 3.6 - env: TOXENV=py27-cy python: 2.7 - env: - TOXENV=py36-cy - BUILD_DIST=true python: 3.6 branches: only: - master - /^v\d+\.\d+.*$/ install: pip install tox script: tox after_success: - if [ -z "$TRAVIS_TAG" ]; then tox -e codecov; fi # deploy to PyPI on tags - | if [ -n "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "googlefonts/cu2qu" ] && [ "$BUILD_DIST" == true ]; then tox -e pypi fi cu2qu-1.6.7/CONTRIBUTING.md000066400000000000000000000026521361726233700150340ustar00rootroot00000000000000Want to contribute? Great! First, read this page (including the small print at the end). ### Before you contribute Before we can use your code, you must sign the [Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual) (CLA), which you can do online. The CLA is necessary mainly because you own the copyright to your changes, even after your contribution becomes part of our codebase, so we need your permission to use and distribute your code. We also need to be sure of various other things—for instance that you'll tell us if you know that your code infringes on other people's patents. You don't have to sign the CLA until after you've submitted your code for review and a member has approved it, but you must do it before we can put your code into our codebase. Before you start working on a larger contribution, you should get in touch with us first through the issue tracker with your idea so that we can help out and possibly guide you. Coordinating up front makes it much easier to avoid frustration later on. ### Code reviews All submissions, including submissions by project members, require review. We use Github pull requests for this purpose. ### The small print Contributions made by corporations are covered by a different agreement than the one above, the [Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). cu2qu-1.6.7/LICENSE000066400000000000000000000261351361726233700136120ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. cu2qu-1.6.7/Lib/000077500000000000000000000000001361726233700133045ustar00rootroot00000000000000cu2qu-1.6.7/Lib/cu2qu/000077500000000000000000000000001361726233700143435ustar00rootroot00000000000000cu2qu-1.6.7/Lib/cu2qu/__init__.py000066400000000000000000000014321361726233700164540ustar00rootroot00000000000000# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function, division, absolute_import try: from ._version import version as __version__ except ImportError: __version__ = "0.0.0+unknown" from .cu2qu import * cu2qu-1.6.7/Lib/cu2qu/__main__.py000066400000000000000000000001301361726233700164270ustar00rootroot00000000000000import sys from cu2qu.cli import main if __name__ == "__main__": sys.exit(main()) cu2qu-1.6.7/Lib/cu2qu/cli.py000066400000000000000000000121501361726233700154630ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import os import argparse import logging import shutil import multiprocessing as mp from contextlib import closing from functools import partial import cu2qu from cu2qu.ufo import font_to_quadratic, fonts_to_quadratic import defcon logger = logging.getLogger("cu2qu") def _cpu_count(): try: return mp.cpu_count() except NotImplementedError: # pragma: no cover return 1 def _font_to_quadratic(zipped_paths, **kwargs): input_path, output_path = zipped_paths ufo = defcon.Font(input_path) logger.info('Converting curves for %s', input_path) if font_to_quadratic(ufo, **kwargs): logger.info("Saving %s", output_path) ufo.save(output_path) else: _copytree(input_path, output_path) def _samepath(path1, path2): # TODO on python3+, there's os.path.samefile path1 = os.path.normcase(os.path.abspath(os.path.realpath(path1))) path2 = os.path.normcase(os.path.abspath(os.path.realpath(path2))) return path1 == path2 def _copytree(input_path, output_path): if _samepath(input_path, output_path): logger.debug("input and output paths are the same file; skipped copy") return if os.path.exists(output_path): shutil.rmtree(output_path) shutil.copytree(input_path, output_path) def main(args=None): parser = argparse.ArgumentParser(prog="cu2qu") parser.add_argument( "--version", action="version", version=cu2qu.__version__) parser.add_argument( "infiles", nargs="+", metavar="INPUT", help="one or more input UFO source file(s).") parser.add_argument("-v", "--verbose", action="count", default=0) parser.add_argument( "-e", "--conversion-error", type=float, metavar="ERROR", default=None, help="maxiumum approximation error measured in EM (default: 0.001)") parser.add_argument( "--keep-direction", dest="reverse_direction", action="store_false", help="do not reverse the contour direction") mode_parser = parser.add_mutually_exclusive_group() mode_parser.add_argument( "-i", "--interpolatable", action="store_true", help="whether curve conversion should keep interpolation compatibility" ) mode_parser.add_argument( "-j", "--jobs", type=int, nargs="?", default=1, const=_cpu_count(), metavar="N", help="Convert using N multiple processes (default: %(default)s)") output_parser = parser.add_mutually_exclusive_group() output_parser.add_argument( "-o", "--output-file", default=None, metavar="OUTPUT", help=("output filename for the converted UFO. By default fonts are " "modified in place. This only works with a single input.")) output_parser.add_argument( "-d", "--output-dir", default=None, metavar="DIRECTORY", help="output directory where to save converted UFOs") options = parser.parse_args(args) if not options.verbose: level = "WARNING" elif options.verbose == 1: level = "INFO" else: level = "DEBUG" logging.basicConfig(level=level) if len(options.infiles) > 1 and options.output_file: parser.error("-o/--output-file can't be used with multile inputs") if options.output_dir: output_dir = options.output_dir if not os.path.exists(output_dir): os.mkdir(output_dir) elif not os.path.isdir(output_dir): parser.error("'%s' is not a directory" % output_dir) output_paths = [ os.path.join(output_dir, os.path.basename(p)) for p in options.infiles ] elif options.output_file: output_paths = [options.output_file] else: # save in-place output_paths = list(options.infiles) kwargs = dict(dump_stats=options.verbose > 0, max_err_em=options.conversion_error, reverse_direction=options.reverse_direction) if options.interpolatable: logger.info('Converting curves compatibly') ufos = [defcon.Font(infile) for infile in options.infiles] if fonts_to_quadratic(ufos, **kwargs): for ufo, output_path in zip(ufos, output_paths): logger.info("Saving %s", output_path) ufo.save(output_path) else: for input_path, output_path in zip(options.infiles, output_paths): _copytree(input_path, output_path) else: jobs = min(len(options.infiles), options.jobs) if options.jobs > 1 else 1 if jobs > 1: func = partial(_font_to_quadratic, **kwargs) logger.info('Running %d parallel processes', jobs) with closing(mp.Pool(jobs)) as pool: # can't use Pool.starmap as it's 3.3+ only pool.map(func, zip(options.infiles, output_paths)) else: for paths in zip(options.infiles, output_paths): _font_to_quadratic(paths, **kwargs) cu2qu-1.6.7/Lib/cu2qu/cu2qu.py000066400000000000000000000302421361726233700157550ustar00rootroot00000000000000#cython: language_level=3 #distutils: define_macros=CYTHON_TRACE_NOGIL=1 # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function, division, absolute_import try: import cython except ImportError: # if not installed, use the embedded (no-op) copy of Cython.Shadow from . import cython import math from .errors import Error as Cu2QuError, ApproxNotFoundError __all__ = ['curve_to_quadratic', 'curves_to_quadratic'] MAX_N = 100 NAN = float("NaN") if cython.compiled: # Yep, I'm compiled. COMPILED = True else: # Just a lowly interpreted script. COMPILED = False @cython.cfunc @cython.inline @cython.returns(cython.double) @cython.locals(v1=cython.complex, v2=cython.complex) def dot(v1, v2): """Return the dot product of two vectors.""" return (v1 * v2.conjugate()).real @cython.cfunc @cython.inline @cython.locals(a=cython.complex, b=cython.complex, c=cython.complex, d=cython.complex) @cython.locals(_1=cython.complex, _2=cython.complex, _3=cython.complex, _4=cython.complex) def calc_cubic_points(a, b, c, d): _1 = d _2 = (c / 3.0) + d _3 = (b + c) / 3.0 + _2 _4 = a + d + c + b return _1, _2, _3, _4 @cython.cfunc @cython.inline @cython.locals(p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex) @cython.locals(a=cython.complex, b=cython.complex, c=cython.complex, d=cython.complex) def calc_cubic_parameters(p0, p1, p2, p3): c = (p1 - p0) * 3.0 b = (p2 - p1) * 3.0 - c d = p0 a = p3 - d - c - b return a, b, c, d @cython.cfunc @cython.locals(p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex) def split_cubic_into_n_iter(p0, p1, p2, p3, n): # Hand-coded special-cases if n == 2: return iter(split_cubic_into_two(p0, p1, p2, p3)) if n == 3: return iter(split_cubic_into_three(p0, p1, p2, p3)) if n == 4: a, b = split_cubic_into_two(p0, p1, p2, p3) return iter(split_cubic_into_two(*a) + split_cubic_into_two(*b)) if n == 6: a, b = split_cubic_into_two(p0, p1, p2, p3) return iter(split_cubic_into_three(*a) + split_cubic_into_three(*b)) return _split_cubic_into_n_gen(p0,p1,p2,p3,n) @cython.locals(p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex, n=cython.int) @cython.locals(a=cython.complex, b=cython.complex, c=cython.complex, d=cython.complex) @cython.locals(dt=cython.double, delta_2=cython.double, delta_3=cython.double, i=cython.int) @cython.locals(a1=cython.complex, b1=cython.complex, c1=cython.complex, d1=cython.complex) def _split_cubic_into_n_gen(p0, p1, p2, p3, n): a, b, c, d = calc_cubic_parameters(p0, p1, p2, p3) dt = 1 / n delta_2 = dt * dt delta_3 = dt * delta_2 for i in range(n): t1 = i * dt t1_2 = t1 * t1 # calc new a, b, c and d a1 = a * delta_3 b1 = (3*a*t1 + b) * delta_2 c1 = (2*b*t1 + c + 3*a*t1_2) * dt d1 = a*t1*t1_2 + b*t1_2 + c*t1 + d yield calc_cubic_points(a1, b1, c1, d1) @cython.locals(p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex) @cython.locals(mid=cython.complex, deriv3=cython.complex) def split_cubic_into_two(p0, p1, p2, p3): mid = (p0 + 3 * (p1 + p2) + p3) * .125 deriv3 = (p3 + p2 - p1 - p0) * .125 return ((p0, (p0 + p1) * .5, mid - deriv3, mid), (mid, mid + deriv3, (p2 + p3) * .5, p3)) @cython.locals(p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex, _27=cython.double) @cython.locals(mid1=cython.complex, deriv1=cython.complex, mid2=cython.complex, deriv2=cython.complex) def split_cubic_into_three(p0, p1, p2, p3, _27=1/27): # we define 1/27 as a keyword argument so that it will be evaluated only # once but still in the scope of this function mid1 = (8*p0 + 12*p1 + 6*p2 + p3) * _27 deriv1 = (p3 + 3*p2 - 4*p0) * _27 mid2 = (p0 + 6*p1 + 12*p2 + 8*p3) * _27 deriv2 = (4*p3 - 3*p1 - p0) * _27 return ((p0, (2*p0 + p1) / 3.0, mid1 - deriv1, mid1), (mid1, mid1 + deriv1, mid2 - deriv2, mid2), (mid2, mid2 + deriv2, (p2 + 2*p3) / 3.0, p3)) @cython.returns(cython.complex) @cython.locals(t=cython.double, p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex) @cython.locals(_p1=cython.complex, _p2=cython.complex) def cubic_approx_control(t, p0, p1, p2, p3): """Approximate a cubic bezier curve with a quadratic one. Returns the candidate control point.""" _p1 = p0 + (p1 - p0) * 1.5 _p2 = p3 + (p2 - p3) * 1.5 return _p1 + (_p2 - _p1) * t @cython.returns(cython.complex) @cython.locals(a=cython.complex, b=cython.complex, c=cython.complex, d=cython.complex) @cython.locals(ab=cython.complex, cd=cython.complex, p=cython.complex, h=cython.double) def calc_intersect(a, b, c, d): """Calculate the intersection of ab and cd, given a, b, c, d.""" ab = b - a cd = d - c p = ab * 1j try: h = dot(p, a - c) / dot(p, cd) except ZeroDivisionError: return complex(NAN, NAN) return c + cd * h @cython.cfunc @cython.returns(cython.int) @cython.locals(tolerance=cython.double, p0=cython.complex, p1=cython.complex, p2=cython.complex, p3=cython.complex) @cython.locals(mid=cython.complex, deriv3=cython.complex) def cubic_farthest_fit_inside(p0, p1, p2, p3, tolerance): """Returns True if the cubic Bezier p entirely lies within a distance tolerance of origin, False otherwise. Assumes that p0 and p3 do fit within tolerance of origin, and just checks the inside of the curve.""" # First check p2 then p1, as p2 has higher error early on. if abs(p2) <= tolerance and abs(p1) <= tolerance: return True # Split. mid = (p0 + 3 * (p1 + p2) + p3) * .125 if abs(mid) > tolerance: return False deriv3 = (p3 + p2 - p1 - p0) * .125 return (cubic_farthest_fit_inside(p0, (p0+p1)*.5, mid-deriv3, mid, tolerance) and cubic_farthest_fit_inside(mid, mid+deriv3, (p2+p3)*.5, p3, tolerance)) @cython.cfunc @cython.locals(tolerance=cython.double, _2_3=cython.double) @cython.locals(q1=cython.complex, c0=cython.complex, c1=cython.complex, c2=cython.complex, c3=cython.complex) def cubic_approx_quadratic(cubic, tolerance, _2_3=2/3): """Return the uniq quadratic approximating cubic that maintains endpoint tangents if that is within tolerance, None otherwise.""" # we define 2/3 as a keyword argument so that it will be evaluated only # once but still in the scope of this function q1 = calc_intersect(*cubic) if math.isnan(q1.imag): return None c0 = cubic[0] c3 = cubic[3] c1 = c0 + (q1 - c0) * _2_3 c2 = c3 + (q1 - c3) * _2_3 if not cubic_farthest_fit_inside(0, c1 - cubic[1], c2 - cubic[2], 0, tolerance): return None return c0, q1, c3 @cython.cfunc @cython.locals(n=cython.int, tolerance=cython.double, _2_3=cython.double) @cython.locals(i=cython.int) @cython.locals(c0=cython.complex, c1=cython.complex, c2=cython.complex, c3=cython.complex) @cython.locals(q0=cython.complex, q1=cython.complex, next_q1=cython.complex, q2=cython.complex, d1=cython.complex) def cubic_approx_spline(cubic, n, tolerance, _2_3=2/3): """Approximate a cubic bezier curve with a spline of n quadratics. Returns None if no quadratic approximation is found which lies entirely within a distance `tolerance` from the original curve. """ # we define 2/3 as a keyword argument so that it will be evaluated only # once but still in the scope of this function if n == 1: return cubic_approx_quadratic(cubic, tolerance) cubics = split_cubic_into_n_iter(cubic[0], cubic[1], cubic[2], cubic[3], n) # calculate the spline of quadratics and check errors at the same time. next_cubic = next(cubics) next_q1 = cubic_approx_control(0, *next_cubic) q2 = cubic[0] d1 = 0j spline = [cubic[0], next_q1] for i in range(1, n+1): # Current cubic to convert c0, c1, c2, c3 = next_cubic # Current quadratic approximation of current cubic q0 = q2 q1 = next_q1 if i < n: next_cubic = next(cubics) next_q1 = cubic_approx_control(i / (n-1), *next_cubic) spline.append(next_q1) q2 = (q1 + next_q1) * .5 else: q2 = c3 # End-point deltas d0 = d1 d1 = q2 - c3 if (abs(d1) > tolerance or not cubic_farthest_fit_inside(d0, q0 + (q1 - q0) * _2_3 - c1, q2 + (q1 - q2) * _2_3 - c2, d1, tolerance)): return None spline.append(cubic[3]) return spline @cython.locals(max_err=cython.double) @cython.locals(n=cython.int) def curve_to_quadratic(curve, max_err): """Return a quadratic spline approximating this cubic bezier. Raise 'ApproxNotFoundError' if no suitable approximation can be found with the given parameters. """ curve = [complex(*p) for p in curve] for n in range(1, MAX_N + 1): spline = cubic_approx_spline(curve, n, max_err) if spline is not None: # done. go home return [(s.real, s.imag) for s in spline] raise ApproxNotFoundError(curve) @cython.locals(l=cython.int, last_i=cython.int, i=cython.int) def curves_to_quadratic(curves, max_errors): """Return quadratic splines approximating these cubic beziers. Raise 'ApproxNotFoundError' if no suitable approximation can be found for all curves with the given parameters. """ curves = [[complex(*p) for p in curve] for curve in curves] assert len(max_errors) == len(curves) l = len(curves) splines = [None] * l last_i = i = 0 n = 1 while True: spline = cubic_approx_spline(curves[i], n, max_errors[i]) if spline is None: if n == MAX_N: break n += 1 last_i = i continue splines[i] = spline i = (i + 1) % l if i == last_i: # done. go home return [[(s.real, s.imag) for s in spline] for spline in splines] raise ApproxNotFoundError(curves) if __name__ == '__main__': import random import timeit MAX_ERR = 5 def generate_curve(): return [ tuple(float(random.randint(0, 2048)) for coord in range(2)) for point in range(4)] def setup_curve_to_quadratic(): return generate_curve(), MAX_ERR def setup_curves_to_quadratic(): num_curves = 3 return ( [generate_curve() for curve in range(num_curves)], [MAX_ERR] * num_curves) def run_benchmark( benchmark_module, module, function, setup_suffix='', repeat=5, number=1000): setup_func = 'setup_' + function if setup_suffix: print('%s with %s:' % (function, setup_suffix), end='') setup_func += '_' + setup_suffix else: print('%s:' % function, end='') def wrapper(function, setup_func): function = globals()[function] setup_func = globals()[setup_func] def wrapped(): return function(*setup_func()) return wrapped results = timeit.repeat(wrapper(function, setup_func), repeat=repeat, number=number) print('\t%5.1fus' % (min(results) * 1000000. / number)) def main(): run_benchmark('cu2qu.benchmark', 'cu2qu', 'curve_to_quadratic') run_benchmark('cu2qu.benchmark', 'cu2qu', 'curves_to_quadratic') random.seed(1) main() cu2qu-1.6.7/Lib/cu2qu/cython.py000066400000000000000000000315261361726233700162300ustar00rootroot00000000000000""" This module is copied verbatim from the "Cython.Shadow" module: https://github.com/cython/cython/blob/master/Cython/Shadow.py Cython is licensed under the Apache 2.0 Software License. """ # cython.* namespace for pure mode. from __future__ import absolute_import __version__ = "0.29.14" try: from __builtin__ import basestring except ImportError: basestring = str # BEGIN shameless copy from Cython/minivect/minitypes.py class _ArrayType(object): is_array = True subtypes = ['dtype'] def __init__(self, dtype, ndim, is_c_contig=False, is_f_contig=False, inner_contig=False, broadcasting=None): self.dtype = dtype self.ndim = ndim self.is_c_contig = is_c_contig self.is_f_contig = is_f_contig self.inner_contig = inner_contig or is_c_contig or is_f_contig self.broadcasting = broadcasting def __repr__(self): axes = [":"] * self.ndim if self.is_c_contig: axes[-1] = "::1" elif self.is_f_contig: axes[0] = "::1" return "%s[%s]" % (self.dtype, ", ".join(axes)) def index_type(base_type, item): """ Support array type creation by slicing, e.g. double[:, :] specifies a 2D strided array of doubles. The syntax is the same as for Cython memoryviews. """ class InvalidTypeSpecification(Exception): pass def verify_slice(s): if s.start or s.stop or s.step not in (None, 1): raise InvalidTypeSpecification( "Only a step of 1 may be provided to indicate C or " "Fortran contiguity") if isinstance(item, tuple): step_idx = None for idx, s in enumerate(item): verify_slice(s) if s.step and (step_idx or idx not in (0, len(item) - 1)): raise InvalidTypeSpecification( "Step may only be provided once, and only in the " "first or last dimension.") if s.step == 1: step_idx = idx return _ArrayType(base_type, len(item), is_c_contig=step_idx == len(item) - 1, is_f_contig=step_idx == 0) elif isinstance(item, slice): verify_slice(item) return _ArrayType(base_type, 1, is_c_contig=bool(item.step)) else: # int[8] etc. assert int(item) == item # array size must be a plain integer array(base_type, item) # END shameless copy compiled = False _Unspecified = object() # Function decorators def _empty_decorator(x): return x def locals(**arg_types): return _empty_decorator def test_assert_path_exists(*paths): return _empty_decorator def test_fail_if_path_exists(*paths): return _empty_decorator class _EmptyDecoratorAndManager(object): def __call__(self, x): return x def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass class _Optimization(object): pass cclass = ccall = cfunc = _EmptyDecoratorAndManager() returns = wraparound = boundscheck = initializedcheck = nonecheck = \ embedsignature = cdivision = cdivision_warnings = \ always_allows_keywords = profile = linetrace = infer_types = \ unraisable_tracebacks = freelist = \ lambda _: _EmptyDecoratorAndManager() exceptval = lambda _=None, check=True: _EmptyDecoratorAndManager() overflowcheck = lambda _: _EmptyDecoratorAndManager() optimization = _Optimization() overflowcheck.fold = optimization.use_switch = \ optimization.unpack_method_calls = lambda arg: _EmptyDecoratorAndManager() final = internal = type_version_tag = no_gc_clear = no_gc = _empty_decorator _cython_inline = None def inline(f, *args, **kwds): if isinstance(f, basestring): global _cython_inline if _cython_inline is None: from Cython.Build.Inline import cython_inline as _cython_inline return _cython_inline(f, *args, **kwds) else: assert len(args) == len(kwds) == 0 return f def compile(f): from Cython.Build.Inline import RuntimeCompiledFunction return RuntimeCompiledFunction(f) # Special functions def cdiv(a, b): q = a / b if q < 0: q += 1 return q def cmod(a, b): r = a % b if (a*b) < 0: r -= b return r # Emulated language constructs def cast(type, *args, **kwargs): kwargs.pop('typecheck', None) assert not kwargs if hasattr(type, '__call__'): return type(*args) else: return args[0] def sizeof(arg): return 1 def typeof(arg): return arg.__class__.__name__ # return type(arg) def address(arg): return pointer(type(arg))([arg]) def declare(type=None, value=_Unspecified, **kwds): if type not in (None, object) and hasattr(type, '__call__'): if value is not _Unspecified: return type(value) else: return type() else: return value class _nogil(object): """Support for 'with nogil' statement and @nogil decorator. """ def __call__(self, x): if callable(x): # Used as function decorator => return the function unchanged. return x # Used as conditional context manager or to create an "@nogil(True/False)" decorator => keep going. return self def __enter__(self): pass def __exit__(self, exc_class, exc, tb): return exc_class is None nogil = _nogil() gil = _nogil() del _nogil # Emulated types class CythonMetaType(type): def __getitem__(type, ix): return array(type, ix) CythonTypeObject = CythonMetaType('CythonTypeObject', (object,), {}) class CythonType(CythonTypeObject): def _pointer(self, n=1): for i in range(n): self = pointer(self) return self class PointerType(CythonType): def __init__(self, value=None): if isinstance(value, (ArrayType, PointerType)): self._items = [cast(self._basetype, a) for a in value._items] elif isinstance(value, list): self._items = [cast(self._basetype, a) for a in value] elif value is None or value == 0: self._items = [] else: raise ValueError def __getitem__(self, ix): if ix < 0: raise IndexError("negative indexing not allowed in C") return self._items[ix] def __setitem__(self, ix, value): if ix < 0: raise IndexError("negative indexing not allowed in C") self._items[ix] = cast(self._basetype, value) def __eq__(self, value): if value is None and not self._items: return True elif type(self) != type(value): return False else: return not self._items and not value._items def __repr__(self): return "%s *" % (self._basetype,) class ArrayType(PointerType): def __init__(self): self._items = [None] * self._n class StructType(CythonType): def __init__(self, cast_from=_Unspecified, **data): if cast_from is not _Unspecified: # do cast if len(data) > 0: raise ValueError('Cannot accept keyword arguments when casting.') if type(cast_from) is not type(self): raise ValueError('Cannot cast from %s'%cast_from) for key, value in cast_from.__dict__.items(): setattr(self, key, value) else: for key, value in data.items(): setattr(self, key, value) def __setattr__(self, key, value): if key in self._members: self.__dict__[key] = cast(self._members[key], value) else: raise AttributeError("Struct has no member '%s'" % key) class UnionType(CythonType): def __init__(self, cast_from=_Unspecified, **data): if cast_from is not _Unspecified: # do type cast if len(data) > 0: raise ValueError('Cannot accept keyword arguments when casting.') if isinstance(cast_from, dict): datadict = cast_from elif type(cast_from) is type(self): datadict = cast_from.__dict__ else: raise ValueError('Cannot cast from %s'%cast_from) else: datadict = data if len(datadict) > 1: raise AttributeError("Union can only store one field at a time.") for key, value in datadict.items(): setattr(self, key, value) def __setattr__(self, key, value): if key in '__dict__': CythonType.__setattr__(self, key, value) elif key in self._members: self.__dict__ = {key: cast(self._members[key], value)} else: raise AttributeError("Union has no member '%s'" % key) def pointer(basetype): class PointerInstance(PointerType): _basetype = basetype return PointerInstance def array(basetype, n): class ArrayInstance(ArrayType): _basetype = basetype _n = n return ArrayInstance def struct(**members): class StructInstance(StructType): _members = members for key in members: setattr(StructInstance, key, None) return StructInstance def union(**members): class UnionInstance(UnionType): _members = members for key in members: setattr(UnionInstance, key, None) return UnionInstance class typedef(CythonType): def __init__(self, type, name=None): self._basetype = type self.name = name def __call__(self, *arg): value = cast(self._basetype, *arg) return value def __repr__(self): return self.name or str(self._basetype) __getitem__ = index_type class _FusedType(CythonType): pass def fused_type(*args): if not args: raise TypeError("Expected at least one type as argument") # Find the numeric type with biggest rank if all types are numeric rank = -1 for type in args: if type not in (py_int, py_long, py_float, py_complex): break if type_ordering.index(type) > rank: result_type = type else: return result_type # Not a simple numeric type, return a fused type instance. The result # isn't really meant to be used, as we can't keep track of the context in # pure-mode. Casting won't do anything in this case. return _FusedType() def _specialized_from_args(signatures, args, kwargs): "Perhaps this should be implemented in a TreeFragment in Cython code" raise Exception("yet to be implemented") py_int = typedef(int, "int") try: py_long = typedef(long, "long") except NameError: # Py3 py_long = typedef(int, "long") py_float = typedef(float, "float") py_complex = typedef(complex, "double complex") # Predefined types int_types = ['char', 'short', 'Py_UNICODE', 'int', 'Py_UCS4', 'long', 'longlong', 'Py_ssize_t', 'size_t'] float_types = ['longdouble', 'double', 'float'] complex_types = ['longdoublecomplex', 'doublecomplex', 'floatcomplex', 'complex'] other_types = ['bint', 'void', 'Py_tss_t'] to_repr = { 'longlong': 'long long', 'longdouble': 'long double', 'longdoublecomplex': 'long double complex', 'doublecomplex': 'double complex', 'floatcomplex': 'float complex', }.get gs = globals() # note: cannot simply name the unicode type here as 2to3 gets in the way and replaces it by str try: import __builtin__ as builtins except ImportError: # Py3 import builtins gs['unicode'] = typedef(getattr(builtins, 'unicode', str), 'unicode') del builtins for name in int_types: reprname = to_repr(name, name) gs[name] = typedef(py_int, reprname) if name not in ('Py_UNICODE', 'Py_UCS4') and not name.endswith('size_t'): gs['u'+name] = typedef(py_int, "unsigned " + reprname) gs['s'+name] = typedef(py_int, "signed " + reprname) for name in float_types: gs[name] = typedef(py_float, to_repr(name, name)) for name in complex_types: gs[name] = typedef(py_complex, to_repr(name, name)) bint = typedef(bool, "bint") void = typedef(None, "void") Py_tss_t = typedef(None, "Py_tss_t") for t in int_types + float_types + complex_types + other_types: for i in range(1, 4): gs["%s_%s" % ('p'*i, t)] = gs[t]._pointer(i) NULL = gs['p_void'](0) # looks like 'gs' has some users out there by now... #del gs integral = floating = numeric = _FusedType() type_ordering = [py_int, py_long, py_float, py_complex] class CythonDotParallel(object): """ The cython.parallel module. """ __all__ = ['parallel', 'prange', 'threadid'] def parallel(self, num_threads=None): return nogil def prange(self, start=0, stop=None, step=1, nogil=False, schedule=None, chunksize=None, num_threads=None): if stop is None: stop = start start = 0 return range(start, stop, step) def threadid(self): return 0 # def threadsavailable(self): # return 1 import sys sys.modules['cython.parallel'] = CythonDotParallel() del sys cu2qu-1.6.7/Lib/cu2qu/errors.py000066400000000000000000000036011361726233700162310ustar00rootroot00000000000000from __future__ import print_function, absolute_import, division class Error(Exception): """Base Cu2Qu exception class for all other errors.""" class ApproxNotFoundError(Error): def __init__(self, curve): message = "no approximation found: %s" % curve super(Error, self).__init__(message) self.curve = curve class UnequalZipLengthsError(Error): pass class IncompatibleGlyphsError(Error): def __init__(self, glyphs): assert len(glyphs) > 1 self.glyphs = glyphs names = set(repr(g.name) for g in glyphs) if len(names) > 1: self.combined_name = "{%s}" % ", ".join(sorted(names)) else: self.combined_name = names.pop() def __repr__(self): return "<%s %s>" % (type(self).__name__, self.combined_name) class IncompatibleSegmentNumberError(IncompatibleGlyphsError): def __str__(self): return "Glyphs named %s have different number of segments" % ( self.combined_name ) class IncompatibleSegmentTypesError(IncompatibleGlyphsError): def __init__(self, glyphs, segments): IncompatibleGlyphsError.__init__(self, glyphs) self.segments = segments def __str__(self): lines = [] ndigits = len(str(max(self.segments))) for i, tags in sorted(self.segments.items()): lines.append( "%s: (%s)" % (str(i).rjust(ndigits), ", ".join(repr(t) for t in tags)) ) return "Glyphs named %s have incompatible segment types:\n %s" % ( self.combined_name, "\n ".join(lines), ) class IncompatibleFontsError(Error): def __init__(self, glyph_errors): self.glyph_errors = glyph_errors def __str__(self): return "fonts contains incompatible glyphs: %s" % ( ", ".join(repr(g) for g in sorted(self.glyph_errors.keys())) ) cu2qu-1.6.7/Lib/cu2qu/pens.py000066400000000000000000000235651361726233700156750ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import from cu2qu import curve_to_quadratic from fontTools.pens.basePen import AbstractPen, decomposeSuperBezierSegment from fontTools.pens.reverseContourPen import ReverseContourPen from fontTools.pens.pointPen import BasePointToSegmentPen from fontTools.pens.pointPen import ReverseContourPointPen class Cu2QuPen(AbstractPen): """ A filter pen to convert cubic bezier curves to quadratic b-splines using the FontTools SegmentPen protocol. other_pen: another SegmentPen used to draw the transformed outline. max_err: maximum approximation error in font units. reverse_direction: flip the contours' direction but keep starting point. stats: a dictionary counting the point numbers of quadratic segments. ignore_single_points: don't emit contours containing only a single point NOTE: The "ignore_single_points" argument is deprecated since v1.3.0, which dropped Robofab subpport. It's no longer needed to special-case UFO2-style anchors (aka "named points") when using ufoLib >= 2.0, as these are no longer drawn onto pens as single-point contours, but are handled separately as anchors. """ def __init__(self, other_pen, max_err, reverse_direction=False, stats=None, ignore_single_points=False): if reverse_direction: self.pen = ReverseContourPen(other_pen) else: self.pen = other_pen self.max_err = max_err self.stats = stats if ignore_single_points: import warnings warnings.warn("ignore_single_points is deprecated and " "will be removed in future versions", UserWarning, stacklevel=2) self.ignore_single_points = ignore_single_points self.start_pt = None self.current_pt = None def _check_contour_is_open(self): if self.current_pt is None: raise AssertionError("moveTo is required") def _check_contour_is_closed(self): if self.current_pt is not None: raise AssertionError("closePath or endPath is required") def _add_moveTo(self): if self.start_pt is not None: self.pen.moveTo(self.start_pt) self.start_pt = None def moveTo(self, pt): self._check_contour_is_closed() self.start_pt = self.current_pt = pt if not self.ignore_single_points: self._add_moveTo() def lineTo(self, pt): self._check_contour_is_open() self._add_moveTo() self.pen.lineTo(pt) self.current_pt = pt def qCurveTo(self, *points): self._check_contour_is_open() n = len(points) if n == 1: self.lineTo(points[0]) elif n > 1: self._add_moveTo() self.pen.qCurveTo(*points) self.current_pt = points[-1] else: raise AssertionError("illegal qcurve segment point count: %d" % n) def _curve_to_quadratic(self, pt1, pt2, pt3): curve = (self.current_pt, pt1, pt2, pt3) quadratic = curve_to_quadratic(curve, self.max_err) if self.stats is not None: n = str(len(quadratic) - 2) self.stats[n] = self.stats.get(n, 0) + 1 self.qCurveTo(*quadratic[1:]) def curveTo(self, *points): self._check_contour_is_open() n = len(points) if n == 3: # this is the most common case, so we special-case it self._curve_to_quadratic(*points) elif n > 3: for segment in decomposeSuperBezierSegment(points): self._curve_to_quadratic(*segment) elif n == 2: self.qCurveTo(*points) elif n == 1: self.lineTo(points[0]) else: raise AssertionError("illegal curve segment point count: %d" % n) def closePath(self): self._check_contour_is_open() if self.start_pt is None: # if 'start_pt' is _not_ None, we are ignoring single-point paths self.pen.closePath() self.current_pt = self.start_pt = None def endPath(self): self._check_contour_is_open() if self.start_pt is None: self.pen.endPath() self.current_pt = self.start_pt = None def addComponent(self, glyphName, transformation): self._check_contour_is_closed() self.pen.addComponent(glyphName, transformation) class Cu2QuPointPen(BasePointToSegmentPen): """ A filter pen to convert cubic bezier curves to quadratic b-splines using the RoboFab PointPen protocol. other_point_pen: another PointPen used to draw the transformed outline. max_err: maximum approximation error in font units. reverse_direction: reverse the winding direction of all contours. stats: a dictionary counting the point numbers of quadratic segments. """ def __init__(self, other_point_pen, max_err, reverse_direction=False, stats=None): BasePointToSegmentPen.__init__(self) if reverse_direction: self.pen = ReverseContourPointPen(other_point_pen) else: self.pen = other_point_pen self.max_err = max_err self.stats = stats def _flushContour(self, segments): assert len(segments) >= 1 closed = segments[0][0] != "move" new_segments = [] prev_points = segments[-1][1] prev_on_curve = prev_points[-1][0] for segment_type, points in segments: if segment_type == 'curve': for sub_points in self._split_super_bezier_segments(points): on_curve, smooth, name, kwargs = sub_points[-1] bcp1, bcp2 = sub_points[0][0], sub_points[1][0] cubic = [prev_on_curve, bcp1, bcp2, on_curve] quad = curve_to_quadratic(cubic, self.max_err) if self.stats is not None: n = str(len(quad) - 2) self.stats[n] = self.stats.get(n, 0) + 1 new_points = [(pt, False, None, {}) for pt in quad[1:-1]] new_points.append((on_curve, smooth, name, kwargs)) new_segments.append(["qcurve", new_points]) prev_on_curve = sub_points[-1][0] else: new_segments.append([segment_type, points]) prev_on_curve = points[-1][0] if closed: # the BasePointToSegmentPen.endPath method that calls _flushContour # rotates the point list of closed contours so that they end with # the first on-curve point. We restore the original starting point. new_segments = new_segments[-1:] + new_segments[:-1] self._drawPoints(new_segments) def _split_super_bezier_segments(self, points): sub_segments = [] # n is the number of control points n = len(points) - 1 if n == 2: # a simple bezier curve segment sub_segments.append(points) elif n > 2: # a "super" bezier; decompose it on_curve, smooth, name, kwargs = points[-1] num_sub_segments = n - 1 for i, sub_points in enumerate(decomposeSuperBezierSegment([ pt for pt, _, _, _ in points])): new_segment = [] for point in sub_points[:-1]: new_segment.append((point, False, None, {})) if i == (num_sub_segments - 1): # the last on-curve keeps its original attributes new_segment.append((on_curve, smooth, name, kwargs)) else: # on-curves of sub-segments are always "smooth" new_segment.append((sub_points[-1], True, None, {})) sub_segments.append(new_segment) else: raise AssertionError( "expected 2 control points, found: %d" % n) return sub_segments def _drawPoints(self, segments): pen = self.pen pen.beginPath() last_offcurves = [] for i, (segment_type, points) in enumerate(segments): if segment_type in ("move", "line"): assert len(points) == 1, ( "illegal line segment point count: %d" % len(points)) pt, smooth, name, kwargs = points[0] pen.addPoint(pt, segment_type, smooth, name, **kwargs) elif segment_type == "qcurve": assert len(points) >= 2, ( "illegal qcurve segment point count: %d" % len(points)) offcurves = points[:-1] if offcurves: if i == 0: # any off-curve points preceding the first on-curve # will be appended at the end of the contour last_offcurves = offcurves else: for (pt, smooth, name, kwargs) in offcurves: pen.addPoint(pt, None, smooth, name, **kwargs) pt, smooth, name, kwargs = points[-1] if pt is None: # special quadratic contour with no on-curve points: # we need to skip the "None" point. See also the Pen # protocol's qCurveTo() method and fontTools.pens.basePen pass else: pen.addPoint(pt, segment_type, smooth, name, **kwargs) else: # 'curve' segments must have been converted to 'qcurve' by now raise AssertionError( "unexpected segment type: %r" % segment_type) for (pt, smooth, name, kwargs) in last_offcurves: pen.addPoint(pt, None, smooth, name, **kwargs) pen.endPath() def addComponent(self, baseGlyphName, transformation): assert self.currentPath is None self.pen.addComponent(baseGlyphName, transformation) cu2qu-1.6.7/Lib/cu2qu/ufo.py000066400000000000000000000256101361726233700155120ustar00rootroot00000000000000# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Converts cubic bezier curves to quadratic splines. Conversion is performed such that the quadratic splines keep the same end-curve tangents as the original cubics. The approach is iterative, increasing the number of segments for a spline until the error gets below a bound. Respective curves from multiple fonts will be converted at once to ensure that the resulting splines are interpolation-compatible. """ from __future__ import print_function, division, absolute_import import logging from fontTools.pens.basePen import AbstractPen from fontTools.pens.pointPen import PointToSegmentPen from fontTools.pens.reverseContourPen import ReverseContourPen from cu2qu import curves_to_quadratic from cu2qu.errors import ( UnequalZipLengthsError, IncompatibleSegmentNumberError, IncompatibleSegmentTypesError, IncompatibleGlyphsError, IncompatibleFontsError) __all__ = ['fonts_to_quadratic', 'font_to_quadratic'] DEFAULT_MAX_ERR = 0.001 CURVE_TYPE_LIB_KEY = "com.github.googlei18n.cu2qu.curve_type" logger = logging.getLogger(__name__) _zip = zip def zip(*args): """Ensure each argument to zip has the same length. Also make sure a list is returned for python 2/3 compatibility. """ if len(set(len(a) for a in args)) != 1: raise UnequalZipLengthsError(*args) return list(_zip(*args)) class GetSegmentsPen(AbstractPen): """Pen to collect segments into lists of points for conversion. Curves always include their initial on-curve point, so some points are duplicated between segments. """ def __init__(self): self._last_pt = None self.segments = [] def _add_segment(self, tag, *args): if tag in ['move', 'line', 'qcurve', 'curve']: self._last_pt = args[-1] self.segments.append((tag, args)) def moveTo(self, pt): self._add_segment('move', pt) def lineTo(self, pt): self._add_segment('line', pt) def qCurveTo(self, *points): self._add_segment('qcurve', self._last_pt, *points) def curveTo(self, *points): self._add_segment('curve', self._last_pt, *points) def closePath(self): self._add_segment('close') def endPath(self): self._add_segment('end') def addComponent(self, glyphName, transformation): pass def _get_segments(glyph): """Get a glyph's segments as extracted by GetSegmentsPen.""" pen = GetSegmentsPen() # glyph.draw(pen) # We can't simply draw the glyph with the pen, but we must initialize the # PointToSegmentPen explicitly with outputImpliedClosingLine=True. # By default PointToSegmentPen does not outputImpliedClosingLine -- unless # last and first point on closed contour are duplicated. Because we are # converting multiple glyphs at the same time, we want to make sure # this function returns the same number of segments, whether or not # the last and first point overlap. # https://github.com/googlefonts/fontmake/issues/572 # https://github.com/fonttools/fonttools/pull/1720 pointPen = PointToSegmentPen(pen, outputImpliedClosingLine=True) glyph.drawPoints(pointPen) return pen.segments def _set_segments(glyph, segments, reverse_direction): """Draw segments as extracted by GetSegmentsPen back to a glyph.""" glyph.clearContours() pen = glyph.getPen() if reverse_direction: pen = ReverseContourPen(pen) for tag, args in segments: if tag == 'move': pen.moveTo(*args) elif tag == 'line': pen.lineTo(*args) elif tag == 'curve': pen.curveTo(*args[1:]) elif tag == 'qcurve': pen.qCurveTo(*args[1:]) elif tag == 'close': pen.closePath() elif tag == 'end': pen.endPath() else: raise AssertionError('Unhandled segment type "%s"' % tag) def _segments_to_quadratic(segments, max_err, stats): """Return quadratic approximations of cubic segments.""" assert all(s[0] == 'curve' for s in segments), 'Non-cubic given to convert' new_points = curves_to_quadratic([s[1] for s in segments], max_err) n = len(new_points[0]) assert all(len(s) == n for s in new_points[1:]), 'Converted incompatibly' spline_length = str(n - 2) stats[spline_length] = stats.get(spline_length, 0) + 1 return [('qcurve', p) for p in new_points] def _glyphs_to_quadratic(glyphs, max_err, reverse_direction, stats): """Do the actual conversion of a set of compatible glyphs, after arguments have been set up. Return True if the glyphs were modified, else return False. """ try: segments_by_location = zip(*[_get_segments(g) for g in glyphs]) except UnequalZipLengthsError: raise IncompatibleSegmentNumberError(glyphs) if not any(segments_by_location): return False # always modify input glyphs if reverse_direction is True glyphs_modified = reverse_direction new_segments_by_location = [] incompatible = {} for i, segments in enumerate(segments_by_location): tag = segments[0][0] if not all(s[0] == tag for s in segments[1:]): incompatible[i] = [s[0] for s in segments] elif tag == 'curve': segments = _segments_to_quadratic(segments, max_err, stats) glyphs_modified = True new_segments_by_location.append(segments) if glyphs_modified: new_segments_by_glyph = zip(*new_segments_by_location) for glyph, new_segments in zip(glyphs, new_segments_by_glyph): _set_segments(glyph, new_segments, reverse_direction) if incompatible: raise IncompatibleSegmentTypesError(glyphs, segments=incompatible) return glyphs_modified def glyphs_to_quadratic( glyphs, max_err=None, reverse_direction=False, stats=None): """Convert the curves of a set of compatible of glyphs to quadratic. All curves will be converted to quadratic at once, ensuring interpolation compatibility. If this is not required, calling glyphs_to_quadratic with one glyph at a time may yield slightly more optimized results. Return True if glyphs were modified, else return False. Raises IncompatibleGlyphsError if glyphs have non-interpolatable outlines. """ if stats is None: stats = {} if not max_err: # assume 1000 is the default UPEM max_err = DEFAULT_MAX_ERR * 1000 if isinstance(max_err, (list, tuple)): max_errors = max_err else: max_errors = [max_err] * len(glyphs) assert len(max_errors) == len(glyphs) return _glyphs_to_quadratic(glyphs, max_errors, reverse_direction, stats) def fonts_to_quadratic( fonts, max_err_em=None, max_err=None, reverse_direction=False, stats=None, dump_stats=False, remember_curve_type=True): """Convert the curves of a collection of fonts to quadratic. All curves will be converted to quadratic at once, ensuring interpolation compatibility. If this is not required, calling fonts_to_quadratic with one font at a time may yield slightly more optimized results. Return True if fonts were modified, else return False. By default, cu2qu stores the curve type in the fonts' lib, under a private key "com.github.googlei18n.cu2qu.curve_type", and will not try to convert them again if the curve type is already set to "quadratic". Setting 'remember_curve_type' to False disables this optimization. Raises IncompatibleFontsError if same-named glyphs from different fonts have non-interpolatable outlines. """ if remember_curve_type: curve_types = {f.lib.get(CURVE_TYPE_LIB_KEY, "cubic") for f in fonts} if len(curve_types) == 1: curve_type = next(iter(curve_types)) if curve_type == "quadratic": logger.info("Curves already converted to quadratic") return False elif curve_type == "cubic": pass # keep converting else: raise NotImplementedError(curve_type) elif len(curve_types) > 1: # going to crash later if they do differ logger.warning("fonts may contain different curve types") if stats is None: stats = {} if max_err_em and max_err: raise TypeError('Only one of max_err and max_err_em can be specified.') if not (max_err_em or max_err): max_err_em = DEFAULT_MAX_ERR if isinstance(max_err, (list, tuple)): assert len(max_err) == len(fonts) max_errors = max_err elif max_err: max_errors = [max_err] * len(fonts) if isinstance(max_err_em, (list, tuple)): assert len(fonts) == len(max_err_em) max_errors = [f.info.unitsPerEm * e for f, e in zip(fonts, max_err_em)] elif max_err_em: max_errors = [f.info.unitsPerEm * max_err_em for f in fonts] modified = False glyph_errors = {} for name in set().union(*(f.keys() for f in fonts)): glyphs = [] cur_max_errors = [] for font, error in zip(fonts, max_errors): if name in font: glyphs.append(font[name]) cur_max_errors.append(error) try: modified |= _glyphs_to_quadratic( glyphs, cur_max_errors, reverse_direction, stats) except IncompatibleGlyphsError as exc: logger.error(exc) glyph_errors[name] = exc if glyph_errors: raise IncompatibleFontsError(glyph_errors) if modified and dump_stats: spline_lengths = sorted(stats.keys()) logger.info('New spline lengths: %s' % (', '.join( '%s: %d' % (l, stats[l]) for l in spline_lengths))) if remember_curve_type: for font in fonts: curve_type = font.lib.get(CURVE_TYPE_LIB_KEY, "cubic") if curve_type != "quadratic": font.lib[CURVE_TYPE_LIB_KEY] = "quadratic" modified = True return modified def glyph_to_quadratic(glyph, **kwargs): """Convenience wrapper around glyphs_to_quadratic, for just one glyph. Return True if the glyph was modified, else return False. """ return glyphs_to_quadratic([glyph], **kwargs) def font_to_quadratic(font, **kwargs): """Convenience wrapper around fonts_to_quadratic, for just one font. Return True if the font was modified, else return False. """ return fonts_to_quadratic([font], **kwargs) cu2qu-1.6.7/MANIFEST.in000066400000000000000000000005301361726233700143320ustar00rootroot00000000000000include LICENSE include README.rst include CONTRIBUTING.md include requirements.txt include test-requirements.txt include tox.ini include .coveragerc recursive-include tests *.py recursive-include tests/data *.json recursive-include tests/data */*.glif recursive-include tests/data */*.plist */*/*.glif */*/*.plist recursive-include tools *.py cu2qu-1.6.7/README.rst000066400000000000000000000075601361726233700142750ustar00rootroot00000000000000|Build Status| |PyPI Version| |Coverage| cu2qu ===== This library provides functions which take in UFO objects (Defcon Fonts or Robofab RFonts) and converts any cubic curves to quadratic. The most useful function is probably ``fonts_to_quadratic``: .. code:: python from defcon import Font from cu2qu.ufo import fonts_to_quadratic thin_font = Font('MyFont-Thin.ufo') bold_font = Font('MyFont-Bold.ufo') fonts_to_quadratic([thin_font, bold_font]) Interpolation compatibility is guaranteed during conversion. If it's not needed, converting one font at a time may yield more optimized results: .. code:: python for font in [thin_font, bold_font]: fonts_to_quadratic([font]) Some fonts may need a different error threshold than the default (0.001 em). This can also be provided by the caller: .. code:: python fonts_to_quadratic([thin_font, bold_font], max_err_em=0.005) .. code:: python for font in [thin_font, bold_font]: fonts_to_quadratic([font], max_err_em=0.001) ``fonts_to_quadratic`` can print a string reporting the number of curves of each length. For example ``fonts_to_quadratic([font], dump_stats=True)`` may print something like: :: 3: 1000 4: 2000 5: 100 meaning that the font now contains 1000 curves with three points, 2000 with four points, and 100 with five. Given multiple fonts, the function will report the total counts across all fonts. You can also accumulate statistics between calls by providing your own report dictionary: .. code:: python stats = {} for font in [thin_font, bold_font]: fonts_to_quadratic([font], stats=stats) # "stats" will report combined statistics for both fonts The library also provides a command-line script also named ``cu2qu``. Check its ``--help`` to see all the options. Installation ------------ You can install/upgrade cu2qu using pip, like any other Python package. .. code:: sh $ pip install --upgrade cu2qu This will download the latest stable version available from the Python Package Index (PyPI). If you wish to modify the sources in-place, you can clone the git repository from Github and install in ``--editable`` (or ``-e``) mode: .. code:: sh $ git clone https://github.com/googlefonts/cu2qu $ cd cu2qu $ pip install --editable . Optionally, you can build an optimized version of cu2qu which uses Cython_ to compile Python to C. The extension module thus created is *more than twice as fast* than its pure-Python equivalent. When installing cu2qu from PyPI using pip, as long as you have a C compiler available, the cu2qu setup script will automatically attempt to build a C/Python extension module. If the compilation fails for any reasons, an error is printed and cu2qu will be installed as pure-Python, without the optimized extension. If you have cloned the git repository, the C source files are not present and need to be regenerated. To do that, you need to install the latest Cython (as usual, ``pip install -U cython``), and then use the global option ``--with-cython`` when invoking the ``setup.py`` script. You can also export a ``CU2QU_WITH_CYTHON=1`` environment variable if you prefer. For example, to build the cu2qu extension module in-place (i.e. in the same source directory): .. code:: sh $ python setup.py --with-cython build_ext --inplace You can also pass ``--global-option`` when installing with pip from a local source checkout, like so: .. code:: sh $ pip install --global-option="--with-cython" -e . .. _Cython: https://github.com/cython/cython .. |Build Status| image:: https://travis-ci.org/googlefonts/cu2qu.svg :target: https://travis-ci.org/googlefonts/cu2qu .. |PyPI Version| image:: https://img.shields.io/pypi/v/cu2qu.svg :target: https://pypi.org/project/cu2qu/ .. |Coverage| image:: https://codecov.io/gh/googlefonts/cu2qu/branch/master/graph/badge.svg :target: https://codecov.io/gh/googlefonts/cu2qu cu2qu-1.6.7/pyproject.toml000066400000000000000000000002111361726233700155040ustar00rootroot00000000000000[build-system] requires = [ "setuptools", "wheel", "setuptools_scm", "cython", ] build-backend = "setuptools.build_meta" cu2qu-1.6.7/requirements.txt000066400000000000000000000000451361726233700160610ustar00rootroot00000000000000fonttools[ufo]==3.32.0 defcon==0.6.0 cu2qu-1.6.7/setup.cfg000066400000000000000000000005321361726233700144170ustar00rootroot00000000000000[bdist_wheel] universal = 1 [sdist] formats = zip [aliases] test = pytest [metadata] license_file = LICENSE [tool:pytest] minversion = 3.0 testpaths = tests python_files = *_test.py python_classes = *Test addopts = -s -v -r a --doctest-modules --doctest-ignore-import-errors filterwarnings: ignore:.*bytes:DeprecationWarning:fs.base cu2qu-1.6.7/setup.py000066400000000000000000000210311361726233700143050ustar00rootroot00000000000000# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from setuptools import setup, find_packages, Extension from setuptools.command.build_ext import build_ext as _build_ext from setuptools.command.sdist import sdist as _sdist import pkg_resources from distutils import log import sys import os import re from io import open needs_pytest = {'pytest', 'test'}.intersection(sys.argv) pytest_runner = ['pytest_runner'] if needs_pytest else [] needs_wheel = {'bdist_wheel'}.intersection(sys.argv) wheel = ['wheel'] if needs_wheel else [] # Check if minimum required Cython is available. # For consistency, we require the same as our vendored Cython.Shadow module cymod = "Lib/cu2qu/cython.py" cython_version_re = re.compile('__version__ = ["\']([0-9][0-9\w\.]+)["\']') with open(cymod, "r", encoding="utf-8") as fp: for line in fp: m = cython_version_re.match(line) if m: cython_min_version = m.group(1) break else: sys.exit("error: failed to parse cython version in '%s'" % cymod) required_cython = "cython >= %s" % cython_min_version try: pkg_resources.require(required_cython) except pkg_resources.ResolutionError: has_cython = False else: has_cython = True # First, check if the CU2QU_WITH_CYTHON environment variable is set. # Values "1", "true" or "yes" mean that Cython is required and will be used # to regenerate the *.c sources from which the native extension is built; # "0", "false" or "no" mean that Cython is not required and no extension # module will be compiled (i.e. the wheel is pure-python and universal). # If the variable is not set, then the pre-generated *.c sources that # are included in the sdist package will be used to try build the extension. # However, if any error occurs during compilation (e.g. the host # machine doesn't have the required compiler toolchain installed), the # installation proceeds without the compiled extensions, but will only have # the pure-python module. env_with_cython = os.environ.get("CU2QU_WITH_CYTHON") with_cython = ( True if env_with_cython in {"1", "true", "yes"} else False if env_with_cython in {"0", "false", "no"} else None ) # command line options --with-cython and --without-cython are also supported. # They override the environment variable opt_with_cython = {'--with-cython'}.intersection(sys.argv) opt_without_cython = {'--without-cython'}.intersection(sys.argv) if opt_with_cython and opt_without_cython: sys.exit( "error: the options '--with-cython' and '--without-cython' are " "mutually exclusive" ) elif opt_with_cython: sys.argv.remove("--with-cython") with_cython = True elif opt_without_cython: sys.argv.remove("--without-cython") with_cython = False class cython_build_ext(_build_ext): """Compile *.pyx source files to *.c using cythonize if Cython is installed, else use the pre-generated *.c sources. """ def finalize_options(self): if with_cython: if not has_cython: from distutils.errors import DistutilsSetupError raise DistutilsSetupError( "%s is required when using --with-cython" % required_cython ) from Cython.Build import cythonize # optionally enable line tracing for test coverage support linetrace = os.environ.get("CYTHON_TRACE") == "1" self.distribution.ext_modules[:] = cythonize( self.distribution.ext_modules, force=linetrace or self.force, annotate=os.environ.get("CYTHON_ANNOTATE") == "1", quiet=not self.verbose, compiler_directives={ "linetrace": linetrace, "language_level": 3, "embedsignature": True, }, ) else: # replace *.py/.pyx sources with their pre-generated *.c versions for ext in self.distribution.ext_modules: ext.sources = [re.sub("\.pyx?$", ".c", n) for n in ext.sources] _build_ext.finalize_options(self) def build_extensions(self): if not has_cython: log.info( "%s is not installed. Pre-generated *.c sources will be " "will be used to build the extensions." % required_cython ) try: _build_ext.build_extensions(self) except Exception as e: if with_cython: raise from distutils.errors import DistutilsModuleError # optional compilation failed: we delete 'ext_modules' and make sure # the generated wheel is 'pure' del self.distribution.ext_modules[:] try: bdist_wheel = self.get_finalized_command("bdist_wheel") except DistutilsModuleError: # 'bdist_wheel' command not available as wheel is not installed pass else: bdist_wheel.root_is_pure = True log.error('error: building extensions failed: %s' % e) def get_source_files(self): filenames = _build_ext.get_source_files(self) # include pre-generated *.c sources inside sdist, but only if cython is # installed (and hence they will be updated upon making the sdist) if has_cython: for ext in self.extensions: filenames.extend( [re.sub("\.pyx?$", ".c", n) for n in ext.sources] ) return filenames class cython_sdist(_sdist): """ Run 'cythonize' on *.pyx sources to ensure the *.c files included in the source distribution are up-to-date. """ def run(self): if with_cython and not has_cython: from distutils.errors import DistutilsSetupError raise DistutilsSetupError( "%s is required when creating sdist --with-cython" % required_cython ) if has_cython: from Cython.Build import cythonize cythonize( self.distribution.ext_modules, force=True, # always regenerate *.c sources quiet=not self.verbose, compiler_directives={ "language_level": 3, "embedsignature": True }, ) _sdist.run(self) # don't build extensions if user explicitly requested --without-cython if with_cython is False: extensions = [] else: extensions = [ Extension("cu2qu.cu2qu", ["Lib/cu2qu/cu2qu.py"]), ] with open('README.rst', 'r') as f: long_description = f.read() setup( name='cu2qu', use_scm_version={"write_to": "Lib/cu2qu/_version.py"}, description='Cubic-to-quadratic bezier curve conversion', author="James Godfrey-Kittle, Behdad Esfahbod", author_email="jamesgk@google.com", url="https://github.com/googlefonts", license="Apache License, Version 2.0", long_description=long_description, packages=find_packages('Lib'), package_dir={'': 'Lib'}, ext_modules=extensions, include_package_data=True, setup_requires=pytest_runner + wheel + ["setuptools_scm"], tests_require=[ 'pytest>=2.8', ], install_requires=[ "fonttools[ufo] >= 3.32.0", ], extras_require={"cli": ["defcon >= 0.6.0"]}, entry_points={"console_scripts": ["cu2qu = cu2qu.cli:main [cli]"]}, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Multimedia :: Graphics :: Graphics Conversion', 'Topic :: Multimedia :: Graphics :: Editors :: Vector-Based', 'Topic :: Software Development :: Libraries :: Python Modules', ], cmdclass={"build_ext": cython_build_ext, "sdist": cython_sdist}, ) cu2qu-1.6.7/test-requirements.txt000066400000000000000000000000201361726233700170270ustar00rootroot00000000000000coverage pytest cu2qu-1.6.7/tests/000077500000000000000000000000001361726233700137405ustar00rootroot00000000000000cu2qu-1.6.7/tests/__init__.py000066400000000000000000000010241361726233700160460ustar00rootroot00000000000000import os from fontTools.ufoLib.glifLib import GlyphSet import pkg_resources DATADIR = os.path.join(os.path.dirname(__file__), 'data') CUBIC_GLYPHS = GlyphSet(os.path.join(DATADIR, 'cubic')) QUAD_GLYPHS = GlyphSet(os.path.join(DATADIR, 'quadratic')) import unittest # Python 3 renamed 'assertRaisesRegexp' to 'assertRaisesRegex', and fires # deprecation warnings if a program uses the old name. if not hasattr(unittest.TestCase, 'assertRaisesRegex'): unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp cu2qu-1.6.7/tests/cli_test.py000066400000000000000000000050451361726233700161240ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import defcon from . import DATADIR import pytest import py from cu2qu.ufo import CURVE_TYPE_LIB_KEY from cu2qu.cli import main TEST_UFOS = [ py.path.local(DATADIR).join("RobotoSubset-Regular.ufo"), py.path.local(DATADIR).join("RobotoSubset-Bold.ufo"), ] @pytest.fixture def test_paths(tmpdir): result = [] for path in TEST_UFOS: new_path = tmpdir / path.basename path.copy(new_path) result.append(new_path) return result class MainTest(object): @staticmethod def run_main(*args): main([str(p) for p in args if p]) def test_single_input_no_output(self, test_paths): ufo_path = test_paths[0] self.run_main(ufo_path) font = defcon.Font(str(ufo_path)) assert font.lib[CURVE_TYPE_LIB_KEY] == "quadratic" def test_single_input_output_file(self, tmpdir): input_path = TEST_UFOS[0] output_path = tmpdir / input_path.basename self.run_main('-o', output_path, input_path) assert output_path.check(dir=1) def test_multiple_inputs_output_dir(self, tmpdir): output_dir = tmpdir / "output_dir" self.run_main('-d', output_dir, *TEST_UFOS) assert output_dir.check(dir=1) outputs = set(p.basename for p in output_dir.listdir()) assert "RobotoSubset-Regular.ufo" in outputs assert "RobotoSubset-Bold.ufo" in outputs def test_interpolatable_inplace(self, test_paths): self.run_main('-i', *test_paths) self.run_main('-i', *test_paths) # idempotent @pytest.mark.parametrize( "mode", ["", "-i"], ids=["normal", "interpolatable"]) def test_copytree(self, mode, tmpdir): output_dir = tmpdir / "output_dir" self.run_main(mode, '-d', output_dir, *TEST_UFOS) output_dir_2 = tmpdir / "output_dir_2" # no conversion when curves are already quadratic, just copy self.run_main(mode, '-d', output_dir_2, *output_dir.listdir()) # running again overwrites existing with the copy self.run_main(mode, '-d', output_dir_2, *output_dir.listdir()) def test_multiprocessing(self, tmpdir, test_paths): self.run_main(*(test_paths + ["-j"])) def test_keep_direction(self, test_paths): self.run_main('--keep-direction', *test_paths) def test_conversion_error(self, test_paths): self.run_main('--conversion-error', 0.002, *test_paths) def test_conversion_error_short(self, test_paths): self.run_main('-e', 0.003, test_paths[0]) cu2qu-1.6.7/tests/cu2qu_test.py000066400000000000000000000134151361726233700164140ustar00rootroot00000000000000# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function, division, absolute_import import collections import math import unittest import os import json from cu2qu import curve_to_quadratic, curves_to_quadratic from . import DATADIR MAX_ERR = 5 class CurveToQuadraticTest(unittest.TestCase): @classmethod def setUpClass(cls): """Do the curve conversion ahead of time, and run tests on results.""" with open(os.path.join(DATADIR, "curves.json"), "r") as fp: curves = json.load(fp) cls.single_splines = [ curve_to_quadratic(c, MAX_ERR) for c in curves] cls.single_errors = [ cls.curve_spline_dist(c, s) for c, s in zip(curves, cls.single_splines)] curve_groups = [curves[i:i + 3] for i in range(0, 300, 3)] cls.compat_splines = [ curves_to_quadratic(c, [MAX_ERR] * 3) for c in curve_groups] cls.compat_errors = [ [cls.curve_spline_dist(c, s) for c, s in zip(curve_group, splines)] for curve_group, splines in zip(curve_groups, cls.compat_splines)] cls.results = [] @classmethod def tearDownClass(cls): """Print stats from conversion, as determined during tests.""" for tag, results in cls.results: print('\n%s\n%s' % ( tag, '\n'.join( '%s: %s (%d)' % (k, '#' * (v // 10 + 1), v) for k, v in sorted(results.items())))) def test_results_unchanged(self): """Tests that the results of conversion haven't changed since the time of this test's writing. Useful as a quick check whenever one modifies the conversion algorithm. """ expected = { 2: 6, 3: 26, 4: 82, 5: 232, 6: 360, 7: 266, 8: 28} results = collections.defaultdict(int) for spline in self.single_splines: n = len(spline) - 2 results[n] += 1 self.assertEqual(results, expected) self.results.append(('single spline lengths', results)) def test_results_unchanged_multiple(self): """Test that conversion results are unchanged for multiple curves.""" expected = { 5: 11, 6: 35, 7: 49, 8: 5} results = collections.defaultdict(int) for splines in self.compat_splines: n = len(splines[0]) - 2 for spline in splines[1:]: self.assertEqual(len(spline) - 2, n, 'Got incompatible conversion results') results[n] += 1 self.assertEqual(results, expected) self.results.append(('compatible spline lengths', results)) def test_does_not_exceed_tolerance(self): """Test that conversion results do not exceed given error tolerance.""" results = collections.defaultdict(int) for error in self.single_errors: results[round(error, 1)] += 1 self.assertLessEqual(error, MAX_ERR) self.results.append(('single errors', results)) def test_does_not_exceed_tolerance_multiple(self): """Test that error tolerance isn't exceeded for multiple curves.""" results = collections.defaultdict(int) for errors in self.compat_errors: for error in errors: results[round(error, 1)] += 1 self.assertLessEqual(error, MAX_ERR) self.results.append(('compatible errors', results)) @classmethod def curve_spline_dist(cls, bezier, spline, total_steps=20): """Max distance between a bezier and quadratic spline at sampled points.""" error = 0 n = len(spline) - 2 steps = total_steps // n for i in range(0, n - 1): p1 = spline[0] if i == 0 else p3 p2 = spline[i + 1] if i < n - 1: p3 = cls.lerp(spline[i + 1], spline[i + 2], 0.5) else: p3 = spline[n + 2] segment = p1, p2, p3 for j in range(steps): error = max(error, cls.dist( cls.cubic_bezier_at(bezier, (j / steps + i) / n), cls.quadratic_bezier_at(segment, j / steps))) return error @classmethod def lerp(cls, p1, p2, t): (x1, y1), (x2, y2) = p1, p2 return x1 + (x2 - x1) * t, y1 + (y2 - y1) * t @classmethod def dist(cls, p1, p2): (x1, y1), (x2, y2) = p1, p2 return math.hypot(x1 - x2, y1 - y2) @classmethod def quadratic_bezier_at(cls, b, t): (x1, y1), (x2, y2), (x3, y3) = b _t = 1 - t t2 = t * t _t2 = _t * _t _2_t_t = 2 * t * _t return (_t2 * x1 + _2_t_t * x2 + t2 * x3, _t2 * y1 + _2_t_t * y2 + t2 * y3) @classmethod def cubic_bezier_at(cls, b, t): (x1, y1), (x2, y2), (x3, y3), (x4, y4) = b _t = 1 - t t2 = t * t _t2 = _t * _t t3 = t * t2 _t3 = _t * _t2 _3_t2_t = 3 * t2 * _t _3_t_t2 = 3 * t * _t2 return (_t3 * x1 + _3_t_t2 * x2 + _3_t2_t * x3 + t3 * x4, _t3 * y1 + _3_t_t2 * y2 + _3_t2_t * y3 + t3 * y4) if __name__ == '__main__': unittest.main() cu2qu-1.6.7/tests/data/000077500000000000000000000000001361726233700146515ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/000077500000000000000000000000001361726233700207515ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/fontinfo.plist000066400000000000000000000120611361726233700236500ustar00rootroot00000000000000 ascender 2146 capHeight 1456 copyright Copyright 2011 Google Inc. All Rights Reserved. descender -555 familyName RobotoSubset italicAngle 0 openTypeHeadCreated 2008/09/12 12:29:34 openTypeHeadFlags 0 1 3 4 openTypeHeadLowestRecPPEM 9 openTypeHheaAscender 1900 openTypeHheaDescender -500 openTypeHheaLineGap 0 openTypeNameDescription openTypeNameDesigner openTypeNameDesignerURL openTypeNameLicense openTypeNameLicenseURL openTypeNameManufacturer openTypeNameManufacturerURL openTypeNameSampleText openTypeOS2CodePageRanges 0 1 2 3 4 7 8 29 openTypeOS2FamilyClass 0 0 openTypeOS2Panose 0 0 0 0 0 0 0 0 0 0 openTypeOS2Selection openTypeOS2StrikeoutPosition 512 openTypeOS2StrikeoutSize 102 openTypeOS2SubscriptXOffset 0 openTypeOS2SubscriptXSize 1434 openTypeOS2SubscriptYOffset 287 openTypeOS2SubscriptYSize 1331 openTypeOS2SuperscriptXOffset 0 openTypeOS2SuperscriptXSize 1434 openTypeOS2SuperscriptYOffset 977 openTypeOS2SuperscriptYSize 1331 openTypeOS2Type openTypeOS2TypoAscender 2146 openTypeOS2TypoDescender -555 openTypeOS2TypoLineGap 0 openTypeOS2UnicodeRanges 0 1 2 3 4 5 6 7 9 11 29 30 31 32 33 34 35 36 37 38 40 45 60 62 64 69 openTypeOS2VendorID GOOG openTypeOS2WeightClass 700 openTypeOS2WidthClass 5 openTypeOS2WinAscent 2146 openTypeOS2WinDescent 555 postscriptBlueFuzz 1 postscriptBlueScale 0.039625 postscriptBlueShift 7 postscriptBlueValues -20 0 1082 1102 1456 1476 postscriptDefaultCharacter space postscriptForceBold postscriptIsFixedPitch postscriptOtherBlues -436 -416 postscriptStemSnapH 250 postscriptStemSnapV 316 postscriptUnderlinePosition -150 postscriptUnderlineThickness 100 postscriptUniqueID -1 styleName Bold trademark unitsPerEm 2048 versionMajor 1 versionMinor 0 xHeight 1082 year 2017 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/000077500000000000000000000000001361726233700222575ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/A_.glif000066400000000000000000000014161361726233700234430ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/B_.glif000066400000000000000000000032121361726233700234400ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/C_.glif000066400000000000000000000022561361726233700234500ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/D_.glif000066400000000000000000000020721361726233700234450ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/E_.glif000066400000000000000000000015731361726233700234530ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/F_.glif000066400000000000000000000013041361726233700234440ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/G_.glif000066400000000000000000000025501361726233700234510ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/H_.glif000066400000000000000000000012761361726233700234560ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/I_.glif000066400000000000000000000005111361726233700234460ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/J_.glif000066400000000000000000000013551361726233700234560ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/K_.glif000066400000000000000000000014141361726233700234530ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/L_.glif000066400000000000000000000010011361726233700234440ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/M_.glif000066400000000000000000000016121361726233700234550ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/N_.glif000066400000000000000000000010721361726233700234560ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/O_.glif000066400000000000000000000023071361726233700234610ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/P_.glif000066400000000000000000000015711361726233700234640ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/Q_.glif000066400000000000000000000026021361726233700234610ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/R_.glif000066400000000000000000000023151361726233700234630ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/S_.glif000066400000000000000000000027471361726233700234750ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/T_.glif000066400000000000000000000010071361726233700234620ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/U_.glif000066400000000000000000000015341361726233700234700ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/V_.glif000066400000000000000000000011201361726233700234600ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/W_.glif000066400000000000000000000021511361726233700234660ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/X_.glif000066400000000000000000000012101361726233700234620ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/Y_.glif000066400000000000000000000010241361726233700234660ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/Z_.glif000066400000000000000000000014171361726233700234750ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/a.glif000066400000000000000000000034321361726233700233440ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/b.glif000066400000000000000000000026731361726233700233530ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/c.glif000066400000000000000000000022451361726233700233470ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/contents.plist000066400000000000000000000045351361726233700252000ustar00rootroot00000000000000 A A_.glif B B_.glif C C_.glif D D_.glif E E_.glif F F_.glif G G_.glif H H_.glif I I_.glif J J_.glif K K_.glif L L_.glif M M_.glif N N_.glif O O_.glif P P_.glif Q Q_.glif R R_.glif S S_.glif T T_.glif U U_.glif V V_.glif W W_.glif X X_.glif Y Y_.glif Z Z_.glif a a.glif b b.glif c c.glif d d.glif e e.glif f f.glif g g.glif h h.glif i i.glif j j.glif k k.glif l l.glif m m.glif n n.glif o o.glif p p.glif q q.glif r r.glif s s.glif space space.glif t t.glif u u.glif v v.glif w w.glif x x.glif y y.glif z z.glif cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/d.glif000066400000000000000000000026651361726233700233560ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/e.glif000066400000000000000000000026201361726233700233460ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/f.glif000066400000000000000000000016701361726233700233530ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/g.glif000066400000000000000000000035721361726233700233570ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/h.glif000066400000000000000000000016731361726233700233600ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/i.glif000066400000000000000000000014431361726233700233540ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/j.glif000066400000000000000000000023211361726233700233510ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/k.glif000066400000000000000000000014141361726233700233540ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/l.glif000066400000000000000000000005111361726233700233520ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/m.glif000066400000000000000000000031111361726233700233520ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/n.glif000066400000000000000000000017111361726233700233570ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/o.glif000066400000000000000000000022441361726233700233620ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/p.glif000066400000000000000000000027011361726233700233610ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/q.glif000066400000000000000000000026731361726233700233720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/r.glif000066400000000000000000000015431361726233700233660ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/s.glif000066400000000000000000000027411361726233700233700ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/space.glif000066400000000000000000000013451361726233700242200ustar00rootroot00000000000000 com.typemytype.robofont.guides angle 0 isGlobal magnetic 5 x 0 y 901 angle 0 isGlobal magnetic 5 x 0 y 555 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/t.glif000066400000000000000000000016411361726233700233670ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/u.glif000066400000000000000000000017111361726233700233660ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/v.glif000066400000000000000000000011201361726233700233610ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/w.glif000066400000000000000000000021451361726233700233720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/x.glif000066400000000000000000000012101361726233700233630ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/y.glif000066400000000000000000000020211361726233700233650ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/glyphs/z.glif000066400000000000000000000014061361726233700233740ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/layercontents.plist000066400000000000000000000004231361726233700247170ustar00rootroot00000000000000 public.default glyphs cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/lib.plist000066400000000000000000000026041361726233700225760ustar00rootroot00000000000000 public.glyphOrder space A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z cu2qu-1.6.7/tests/data/RobotoSubset-Bold.ufo/metainfo.plist000066400000000000000000000004531361726233700236320ustar00rootroot00000000000000 creator org.robofab.ufoLib formatVersion 3 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/000077500000000000000000000000001361726233700214725ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/fontinfo.plist000066400000000000000000000126261361726233700244000ustar00rootroot00000000000000 ascender 2146 capHeight 1456 copyright Copyright 2011 Google Inc. All Rights Reserved. descender -555 familyName RobotoSubset guidelines italicAngle 0 openTypeHeadCreated 2008/09/12 12:29:34 openTypeHeadFlags 0 1 3 4 openTypeHeadLowestRecPPEM 9 openTypeHheaAscender 1900 openTypeHheaDescender -500 openTypeHheaLineGap 0 openTypeNameDescription openTypeNameDesigner openTypeNameDesignerURL openTypeNameLicense openTypeNameLicenseURL openTypeNameManufacturer openTypeNameManufacturerURL openTypeNameSampleText openTypeOS2CodePageRanges 0 1 2 3 4 7 8 29 openTypeOS2FamilyClass 0 0 openTypeOS2Panose 2 0 0 0 0 0 0 0 0 0 openTypeOS2Selection openTypeOS2StrikeoutPosition 512 openTypeOS2StrikeoutSize 102 openTypeOS2SubscriptXOffset 0 openTypeOS2SubscriptXSize 1434 openTypeOS2SubscriptYOffset 287 openTypeOS2SubscriptYSize 1331 openTypeOS2SuperscriptXOffset 0 openTypeOS2SuperscriptXSize 1434 openTypeOS2SuperscriptYOffset 977 openTypeOS2SuperscriptYSize 1331 openTypeOS2Type openTypeOS2TypoAscender 2146 openTypeOS2TypoDescender -555 openTypeOS2TypoLineGap 0 openTypeOS2UnicodeRanges 0 1 2 3 4 5 6 7 9 11 29 30 31 32 33 34 35 36 37 38 40 45 60 62 64 69 openTypeOS2VendorID GOOG openTypeOS2WeightClass 400 openTypeOS2WidthClass 5 openTypeOS2WinAscent 2146 openTypeOS2WinDescent 555 postscriptBlueFuzz 1 postscriptBlueScale 0.039625 postscriptBlueShift 7 postscriptBlueValues -20 0 1082 1102 1456 1476 postscriptDefaultCharacter space postscriptFamilyBlues postscriptFamilyOtherBlues postscriptForceBold postscriptIsFixedPitch postscriptOtherBlues -436 -416 postscriptStemSnapH 154 postscriptStemSnapV 196 postscriptUnderlinePosition -150 postscriptUnderlineThickness 100 postscriptUniqueID -1 styleName Regular trademark unitsPerEm 2048 versionMajor 1 versionMinor 0 xHeight 1082 year 2017 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/000077500000000000000000000000001361726233700230005ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/A_.glif000066400000000000000000000014171361726233700241650ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/B_.glif000066400000000000000000000032101361726233700241570ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/C_.glif000066400000000000000000000022661361726233700241720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/D_.glif000066400000000000000000000020761361726233700241720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/E_.glif000066400000000000000000000015711361726233700241720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/F_.glif000066400000000000000000000013021361726233700241630ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/G_.glif000066400000000000000000000025641361726233700241770ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/H_.glif000066400000000000000000000013001361726233700241630ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/I_.glif000066400000000000000000000005111361726233700241670ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/J_.glif000066400000000000000000000013521361726233700241740ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/K_.glif000066400000000000000000000014151361726233700241750ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/L_.glif000066400000000000000000000010011361726233700241650ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/M_.glif000066400000000000000000000016111361726233700241750ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/N_.glif000066400000000000000000000010761361726233700242030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/O_.glif000066400000000000000000000023171361726233700242030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/P_.glif000066400000000000000000000015761361726233700242120ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/Q_.glif000066400000000000000000000026131361726233700242040ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/R_.glif000066400000000000000000000023021361726233700242000ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/S_.glif000066400000000000000000000027321361726233700242100ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/T_.glif000066400000000000000000000010071361726233700242030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/U_.glif000066400000000000000000000015331361726233700242100ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/V_.glif000066400000000000000000000011221361726233700242030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/W_.glif000066400000000000000000000021511361726233700242070ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/X_.glif000066400000000000000000000012101361726233700242030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/Y_.glif000066400000000000000000000010241361726233700242070ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/Z_.glif000066400000000000000000000014171361726233700242160ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/a.glif000066400000000000000000000034221361726233700240640ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/b.glif000066400000000000000000000026411361726233700240670ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/c.glif000066400000000000000000000022451361726233700240700ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/contents.plist000066400000000000000000000045351361726233700257210ustar00rootroot00000000000000 A A_.glif B B_.glif C C_.glif D D_.glif E E_.glif F F_.glif G G_.glif H H_.glif I I_.glif J J_.glif K K_.glif L L_.glif M M_.glif N N_.glif O O_.glif P P_.glif Q Q_.glif R R_.glif S S_.glif T T_.glif U U_.glif V V_.glif W W_.glif X X_.glif Y Y_.glif Z Z_.glif a a.glif b b.glif c c.glif d d.glif e e.glif f f.glif g g.glif h h.glif i i.glif j j.glif k k.glif l l.glif m m.glif n n.glif o o.glif p p.glif q q.glif r r.glif s s.glif space space.glif t t.glif u u.glif v v.glif w w.glif x x.glif y y.glif z z.glif cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/d.glif000066400000000000000000000026331361726233700240720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/e.glif000066400000000000000000000025211361726233700240670ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/f.glif000066400000000000000000000016541361726233700240760ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/g.glif000066400000000000000000000035421361726233700240750ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/h.glif000066400000000000000000000016721361726233700241000ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/i.glif000066400000000000000000000013771361726233700241030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/j.glif000066400000000000000000000023211361726233700240720ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/k.glif000066400000000000000000000014131361726233700240740ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/l.glif000066400000000000000000000005111361726233700240730ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/m.glif000066400000000000000000000031041361726233700240750ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/n.glif000066400000000000000000000017421361726233700241040ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/o.glif000066400000000000000000000022441361726233700241030ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/p.glif000066400000000000000000000026471361726233700241130ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/q.glif000066400000000000000000000026411361726233700241060ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/r.glif000066400000000000000000000015431361726233700241070ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/s.glif000066400000000000000000000027441361726233700241140ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/space.glif000066400000000000000000000001771361726233700247430ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/t.glif000066400000000000000000000016361361726233700241140ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/u.glif000066400000000000000000000017121361726233700241100ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/v.glif000066400000000000000000000011171361726233700241100ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/w.glif000066400000000000000000000021461361726233700241140ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/x.glif000066400000000000000000000012061361726233700241110ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/y.glif000066400000000000000000000020301361726233700241060ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/glyphs/z.glif000066400000000000000000000014061361726233700241150ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/layercontents.plist000066400000000000000000000004231361726233700254400ustar00rootroot00000000000000 public.default glyphs cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/lib.plist000066400000000000000000000026041361726233700233170ustar00rootroot00000000000000 public.glyphOrder space A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z cu2qu-1.6.7/tests/data/RobotoSubset-Regular.ufo/metainfo.plist000066400000000000000000000004531361726233700243530ustar00rootroot00000000000000 creator org.robofab.ufoLib formatVersion 3 cu2qu-1.6.7/tests/data/cubic/000077500000000000000000000000001361726233700157365ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/cubic/A_.glif000077500000000000000000000034411361726233700171250ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/cubic/A_acute.glif000077500000000000000000000003461361726233700201500ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/cubic/E_acute.glif000077500000000000000000000034731361726233700201600ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/cubic/a.glif000066400000000000000000000046261361726233700170310ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/cubic/acute.glif000077500000000000000000000005161361726233700177070ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/cubic/contents.plist000066400000000000000000000006471361726233700206570ustar00rootroot00000000000000 A A_.glif Aacute A_acute.glif Eacute E_acute.glif a a.glif acute acute.glif cu2qu-1.6.7/tests/data/curves.json000066400000000000000000001703631361726233700170650ustar00rootroot00000000000000[[[550.0,258.0],[1044.0,482.0],[2029.0,1841.0],[1934.0,1554.0]],[[859.0,384.0],[1998.0,116.0],[1596.0,1772.0],[8.0,1824.0]],[[1090.0,937.0],[418.0,1300.0],[125.0,91.0],[104.0,37.0]],[[1561.0,887.0],[1728.0,118.0],[908.0,1793.0],[2030.0,954.0]],[[1415.0,945.0],[896.0,1882.0],[1186.0,88.0],[1704.0,409.0]],[[761.0,1214.0],[495.0,1362.0],[1728.0,777.0],[1242.0,1163.0]],[[2045.0,1611.0],[141.0,1967.0],[994.0,1655.0],[1697.0,708.0]],[[1503.0,1534.0],[354.0,1797.0],[442.0,670.0],[1610.0,1517.0]],[[2005.0,121.0],[1922.0,178.0],[1263.0,1612.0],[697.0,690.0]],[[929.0,50.0],[817.0,950.0],[1656.0,1408.0],[1447.0,1880.0]],[[1102.0,23.0],[1571.0,529.0],[841.0,1745.0],[229.0,1970.0]],[[1493.0,818.0],[1693.0,1986.0],[1461.0,1697.0],[1417.0,6.0]],[[1356.0,1876.0],[114.0,940.0],[725.0,740.0],[375.0,1045.0]],[[132.0,288.0],[340.0,68.0],[1855.0,59.0],[1151.0,1022.0]],[[1100.0,448.0],[756.0,1410.0],[1189.0,284.0],[685.0,653.0]],[[1045.0,688.0],[1117.0,1206.0],[1862.0,1318.0],[2033.0,1940.0]],[[467.0,96.0],[1277.0,1583.0],[1406.0,1724.0],[770.0,1058.0]],[[445.0,1038.0],[856.0,1768.0],[85.0,923.0],[73.0,1627.0]],[[599.0,144.0],[656.0,1825.0],[1747.0,903.0],[1846.0,914.0]],[[125.0,1617.0],[1315.0,1746.0],[240.0,1223.0],[514.0,868.0]],[[194.0,1254.0],[289.0,313.0],[1271.0,1220.0],[648.0,1704.0]],[[1033.0,534.0],[34.0,155.0],[891.0,1887.0],[702.0,153.0]],[[1548.0,820.0],[1421.0,405.0],[842.0,1773.0],[795.0,2016.0]],[[427.0,1597.0],[1212.0,2047.0],[70.0,1332.0],[1647.0,1152.0]],[[74.0,642.0],[822.0,1342.0],[553.0,1388.0],[1758.0,872.0]],[[1091.0,394.0],[1553.0,1408.0],[1984.0,961.0],[267.0,165.0]],[[346.0,544.0],[695.0,682.0],[872.0,1097.0],[1360.0,1045.0]],[[1507.0,1387.0],[1393.0,466.0],[1192.0,963.0],[2002.0,554.0]],[[427.0,1313.0],[160.0,1665.0],[299.0,1557.0],[603.0,512.0]],[[1396.0,469.0],[1548.0,313.0],[916.0,334.0],[1092.0,1494.0]],[[1210.0,468.0],[1875.0,1135.0],[441.0,187.0],[1211.0,50.0]],[[59.0,375.0],[1693.0,471.0],[163.0,769.0],[981.0,1724.0]],[[663.0,473.0],[1846.0,685.0],[988.0,651.0],[421.0,1782.0]],[[1549.0,1204.0],[1037.0,1953.0],[1288.0,410.0],[850.0,1300.0]],[[162.0,111.0],[43.0,1210.0],[1311.0,1842.0],[1602.0,1283.0]],[[1632.0,257.0],[262.0,1299.0],[1867.0,456.0],[1024.0,881.0]],[[1920.0,1457.0],[1061.0,750.0],[851.0,1258.0],[815.0,1009.0]],[[1476.0,333.0],[1150.0,366.0],[1834.0,370.0],[1388.0,931.0]],[[1599.0,1256.0],[168.0,1340.0],[765.0,1297.0],[1240.0,1006.0]],[[1369.0,413.0],[377.0,1003.0],[901.0,83.0],[998.0,1645.0]],[[296.0,1097.0],[290.0,307.0],[88.0,40.0],[1191.0,1471.0]],[[2020.0,1920.0],[631.0,413.0],[1343.0,315.0],[709.0,735.0]],[[612.0,579.0],[1309.0,1251.0],[437.0,1202.0],[517.0,846.0]],[[580.0,130.0],[1294.0,841.0],[729.0,1224.0],[1772.0,646.0]],[[198.0,1012.0],[1034.0,263.0],[1829.0,1761.0],[1024.0,1799.0]],[[1856.0,44.0],[1620.0,1387.0],[702.0,1056.0],[1989.0,99.0]],[[1706.0,77.0],[255.0,1453.0],[566.0,512.0],[567.0,1061.0]],[[1134.0,1629.0],[1642.0,705.0],[365.0,956.0],[1990.0,30.0]],[[727.0,1299.0],[1795.0,924.0],[976.0,1281.0],[2027.0,1961.0]],[[921.0,1688.0],[1380.0,1127.0],[898.0,197.0],[293.0,1510.0]],[[653.0,834.0],[1277.0,1223.0],[1227.0,1522.0],[676.0,1903.0]],[[348.0,504.0],[1545.0,722.0],[638.0,1026.0],[1747.0,891.0]],[[213.0,2027.0],[1612.0,1425.0],[1572.0,675.0],[166.0,370.0]],[[1045.0,413.0],[1095.0,342.0],[569.0,335.0],[1822.0,987.0]],[[1566.0,1773.0],[1627.0,674.0],[1333.0,1794.0],[517.0,1998.0]],[[868.0,488.0],[1766.0,1672.0],[483.0,1210.0],[1137.0,1016.0]],[[1551.0,16.0],[777.0,1797.0],[86.0,126.0],[992.0,1066.0]],[[846.0,708.0],[1166.0,607.0],[821.0,1119.0],[1274.0,1027.0]],[[1828.0,688.0],[1462.0,2010.0],[1720.0,498.0],[855.0,1569.0]],[[838.0,1163.0],[442.0,98.0],[483.0,54.0],[1214.0,559.0]],[[307.0,1530.0],[1274.0,1790.0],[1461.0,1325.0],[3.0,507.0]],[[1811.0,1841.0],[1434.0,1248.0],[1635.0,1390.0],[2016.0,463.0]],[[1546.0,1566.0],[835.0,15.0],[1137.0,814.0],[1890.0,1675.0]],[[1250.0,697.0],[1840.0,808.0],[1472.0,14.0],[1594.0,1744.0]],[[1659.0,1376.0],[277.0,2018.0],[1014.0,1191.0],[85.0,1667.0]],[[639.0,1627.0],[1106.0,729.0],[300.0,41.0],[1431.0,1083.0]],[[1684.0,1243.0],[622.0,1892.0],[1062.0,1984.0],[694.0,1913.0]],[[185.0,1109.0],[403.0,1730.0],[285.0,1454.0],[274.0,1812.0]],[[80.0,672.0],[662.0,381.0],[1646.0,1129.0],[1246.0,855.0]],[[850.0,971.0],[1367.0,1102.0],[280.0,306.0],[1508.0,1916.0]],[[203.0,690.0],[1216.0,1104.0],[1457.0,950.0],[1607.0,1637.0]],[[705.0,1980.0],[1063.0,1350.0],[910.0,1059.0],[1000.0,125.0]],[[1649.0,1296.0],[1768.0,1017.0],[1102.0,777.0],[297.0,678.0]],[[1816.0,606.0],[1073.0,1881.0],[665.0,567.0],[565.0,1805.0]],[[1479.0,1268.0],[1641.0,985.0],[474.0,844.0],[1251.0,279.0]],[[435.0,932.0],[1626.0,1316.0],[2016.0,409.0],[764.0,184.0]],[[226.0,95.0],[887.0,142.0],[2025.0,1811.0],[1402.0,1124.0]],[[483.0,707.0],[390.0,909.0],[1637.0,955.0],[2027.0,1842.0]],[[1547.0,690.0],[949.0,965.0],[1161.0,1894.0],[1595.0,867.0]],[[1850.0,1056.0],[1352.0,2032.0],[454.0,875.0],[322.0,189.0]],[[63.0,21.0],[1967.0,1308.0],[1569.0,1176.0],[802.0,1638.0]],[[655.0,623.0],[124.0,62.0],[1586.0,594.0],[233.0,1554.0]],[[1041.0,532.0],[325.0,1895.0],[1242.0,59.0],[145.0,249.0]],[[528.0,175.0],[1120.0,481.0],[1771.0,372.0],[778.0,113.0]],[[2046.0,533.0],[1143.0,786.0],[1833.0,1596.0],[1350.0,1097.0]],[[1064.0,995.0],[1005.0,246.0],[717.0,1432.0],[1755.0,249.0]],[[1446.0,1690.0],[816.0,1737.0],[287.0,1094.0],[296.0,1030.0]],[[727.0,395.0],[618.0,240.0],[832.0,1753.0],[183.0,216.0]],[[373.0,1921.0],[1516.0,406.0],[1280.0,164.0],[518.0,135.0]],[[1815.0,525.0],[1618.0,1827.0],[100.0,1105.0],[370.0,1024.0]],[[1332.0,351.0],[1236.0,140.0],[1573.0,238.0],[1069.0,1282.0]],[[532.0,1066.0],[1557.0,479.0],[1244.0,385.0],[1740.0,1005.0]],[[841.0,1352.0],[1387.0,1601.0],[1970.0,428.0],[531.0,1837.0]],[[123.0,1193.0],[643.0,819.0],[1516.0,1594.0],[1328.0,398.0]],[[1677.0,1414.0],[517.0,265.0],[178.0,1230.0],[1284.0,1710.0]],[[1221.0,1305.0],[1444.0,1116.0],[1332.0,35.0],[499.0,609.0]],[[1298.0,1333.0],[1341.0,281.0],[1850.0,1145.0],[1964.0,1860.0]],[[1491.0,1558.0],[320.0,229.0],[551.0,199.0],[2015.0,1031.0]],[[1005.0,1387.0],[1481.0,1516.0],[1648.0,1259.0],[1902.0,1394.0]],[[687.0,119.0],[607.0,1024.0],[905.0,546.0],[461.0,756.0]],[[1683.0,205.0],[406.0,1088.0],[438.0,836.0],[1071.0,273.0]],[[321.0,298.0],[890.0,710.0],[1769.0,89.0],[1507.0,1993.0]],[[1162.0,900.0],[820.0,2021.0],[963.0,1742.0],[1852.0,1503.0]],[[773.0,1974.0],[297.0,1050.0],[1668.0,824.0],[33.0,1559.0]],[[1995.0,312.0],[1653.0,1743.0],[164.0,1441.0],[1877.0,26.0]],[[777.0,1226.0],[22.0,491.0],[1239.0,1292.0],[1157.0,1685.0]],[[1672.0,1260.0],[1853.0,1236.0],[536.0,1819.0],[574.0,667.0]],[[1035.0,39.0],[1737.0,148.0],[1508.0,1723.0],[1647.0,1153.0]],[[75.0,370.0],[368.0,19.0],[1570.0,1101.0],[1902.0,1113.0]],[[1526.0,1971.0],[1378.0,1591.0],[1868.0,477.0],[1981.0,1452.0]],[[592.0,1700.0],[607.0,74.0],[704.0,1065.0],[1506.0,520.0]],[[1176.0,1691.0],[1056.0,1176.0],[1723.0,1120.0],[1775.0,1375.0]],[[1989.0,882.0],[2012.0,1646.0],[1741.0,374.0],[263.0,530.0]],[[844.0,612.0],[938.0,107.0],[422.0,1037.0],[637.0,1965.0]],[[405.0,1634.0],[767.0,12.0],[365.0,1751.0],[208.0,894.0]],[[1728.0,1420.0],[192.0,422.0],[1718.0,485.0],[1086.0,1141.0]],[[733.0,1964.0],[195.0,877.0],[357.0,1596.0],[507.0,1832.0]],[[1205.0,2039.0],[1610.0,475.0],[1962.0,433.0],[610.0,1582.0]],[[824.0,684.0],[1055.0,1706.0],[1182.0,2017.0],[879.0,1380.0]],[[1990.0,421.0],[35.0,1420.0],[1095.0,231.0],[1803.0,1228.0]],[[412.0,936.0],[1124.0,1107.0],[1009.0,1686.0],[607.0,533.0]],[[1049.0,799.0],[1670.0,239.0],[609.0,1694.0],[1106.0,1146.0]],[[1966.0,1252.0],[1093.0,2012.0],[878.0,2042.0],[1506.0,1927.0]],[[989.0,1386.0],[721.0,742.0],[1847.0,612.0],[238.0,1335.0]],[[553.0,873.0],[1291.0,2022.0],[1967.0,1351.0],[484.0,523.0]],[[573.0,1050.0],[921.0,360.0],[204.0,704.0],[475.0,926.0]],[[816.0,1261.0],[1729.0,1342.0],[17.0,82.0],[1250.0,902.0]],[[346.0,919.0],[1147.0,1397.0],[1102.0,1553.0],[94.0,498.0]],[[1351.0,1421.0],[571.0,464.0],[1027.0,586.0],[168.0,1421.0]],[[316.0,376.0],[422.0,1228.0],[1298.0,1019.0],[1103.0,203.0]],[[1481.0,127.0],[320.0,569.0],[1635.0,1523.0],[991.0,384.0]],[[1346.0,1120.0],[32.0,1318.0],[459.0,1443.0],[515.0,1110.0]],[[1659.0,373.0],[1947.0,1715.0],[1612.0,1233.0],[898.0,1239.0]],[[545.0,220.0],[450.0,717.0],[985.0,880.0],[1780.0,1124.0]],[[81.0,1025.0],[1109.0,1072.0],[1938.0,516.0],[1651.0,424.0]],[[1529.0,282.0],[1487.0,124.0],[1262.0,1824.0],[541.0,638.0]],[[304.0,581.0],[885.0,1982.0],[1374.0,1495.0],[1197.0,654.0]],[[637.0,1563.0],[1801.0,1661.0],[482.0,594.0],[1104.0,1209.0]],[[33.0,39.0],[543.0,1554.0],[414.0,1882.0],[124.0,1769.0]],[[1729.0,1130.0],[1516.0,1672.0],[1663.0,1892.0],[218.0,406.0]],[[1928.0,153.0],[2.0,172.0],[455.0,571.0],[1459.0,1109.0]],[[1459.0,1941.0],[1004.0,982.0],[432.0,1465.0],[649.0,476.0]],[[166.0,1284.0],[1730.0,1418.0],[1038.0,228.0],[1781.0,1699.0]],[[1541.0,1469.0],[1203.0,1397.0],[1806.0,975.0],[591.0,229.0]],[[1398.0,464.0],[705.0,1996.0],[1396.0,497.0],[88.0,1967.0]],[[856.0,1569.0],[715.0,1627.0],[933.0,408.0],[1017.0,1374.0]],[[1347.0,1004.0],[1889.0,1929.0],[1513.0,2017.0],[793.0,1769.0]],[[1804.0,1633.0],[493.0,1999.0],[1091.0,512.0],[613.0,48.0]],[[1540.0,1698.0],[446.0,107.0],[305.0,749.0],[1879.0,1544.0]],[[1181.0,636.0],[631.0,433.0],[1042.0,76.0],[1902.0,1624.0]],[[935.0,1600.0],[21.0,1021.0],[1732.0,650.0],[733.0,1402.0]],[[979.0,311.0],[659.0,719.0],[1538.0,88.0],[888.0,1750.0]],[[965.0,165.0],[779.0,316.0],[1015.0,1630.0],[1904.0,487.0]],[[198.0,1585.0],[367.0,387.0],[1961.0,184.0],[979.0,49.0]],[[85.0,1277.0],[1910.0,1138.0],[1702.0,682.0],[545.0,1303.0]],[[1837.0,1710.0],[686.0,1619.0],[1593.0,822.0],[2029.0,1140.0]],[[1474.0,620.0],[1062.0,1144.0],[717.0,342.0],[1476.0,1376.0]],[[584.0,1058.0],[1044.0,1033.0],[1430.0,1573.0],[1143.0,1915.0]],[[55.0,610.0],[533.0,1035.0],[925.0,804.0],[288.0,812.0]],[[1758.0,982.0],[570.0,1886.0],[1602.0,802.0],[338.0,316.0]],[[627.0,235.0],[123.0,1660.0],[1567.0,1709.0],[563.0,529.0]],[[303.0,988.0],[1563.0,571.0],[1170.0,829.0],[1626.0,1461.0]],[[730.0,922.0],[1219.0,589.0],[1424.0,2015.0],[1195.0,362.0]],[[1224.0,855.0],[1898.0,89.0],[1189.0,422.0],[1526.0,1816.0]],[[1044.0,238.0],[213.0,1292.0],[654.0,542.0],[423.0,460.0]],[[1782.0,1007.0],[851.0,1625.0],[497.0,869.0],[1572.0,548.0]],[[1042.0,14.0],[495.0,825.0],[1548.0,1974.0],[944.0,1096.0]],[[154.0,687.0],[954.0,1681.0],[1121.0,1725.0],[1632.0,1114.0]],[[2023.0,400.0],[530.0,764.0],[65.0,1859.0],[183.0,2000.0]],[[877.0,1613.0],[1377.0,997.0],[385.0,315.0],[174.0,1731.0]],[[1809.0,773.0],[709.0,778.0],[1576.0,1476.0],[807.0,953.0]],[[1473.0,264.0],[1396.0,212.0],[1877.0,181.0],[724.0,604.0]],[[1169.0,1921.0],[176.0,265.0],[1623.0,376.0],[1638.0,1234.0]],[[1615.0,1097.0],[1442.0,1927.0],[201.0,1954.0],[71.0,1748.0]],[[1247.0,1299.0],[611.0,1137.0],[269.0,1478.0],[1700.0,1601.0]],[[96.0,464.0],[151.0,58.0],[413.0,1360.0],[1379.0,1508.0]],[[141.0,1516.0],[303.0,1986.0],[343.0,1827.0],[1370.0,2048.0]],[[13.0,658.0],[1331.0,1478.0],[876.0,598.0],[607.0,441.0]],[[1654.0,1299.0],[1723.0,1474.0],[1398.0,1064.0],[1509.0,154.0]],[[259.0,1010.0],[1087.0,1626.0],[1162.0,341.0],[306.0,697.0]],[[1094.0,1694.0],[341.0,517.0],[1156.0,1076.0],[961.0,862.0]],[[404.0,1135.0],[1967.0,192.0],[1234.0,835.0],[307.0,1292.0]],[[1391.0,1212.0],[545.0,144.0],[1811.0,1490.0],[152.0,117.0]],[[1292.0,1710.0],[670.0,166.0],[1739.0,755.0],[808.0,953.0]],[[470.0,532.0],[501.0,1091.0],[1877.0,804.0],[226.0,1479.0]],[[1868.0,1371.0],[1452.0,900.0],[38.0,57.0],[2001.0,132.0]],[[673.0,1037.0],[163.0,37.0],[942.0,346.0],[709.0,143.0]],[[820.0,857.0],[1814.0,1182.0],[995.0,2009.0],[1521.0,1330.0]],[[1605.0,300.0],[799.0,743.0],[768.0,1216.0],[1745.0,1941.0]],[[1488.0,94.0],[1996.0,84.0],[429.0,1771.0],[1407.0,1388.0]],[[303.0,1721.0],[799.0,2024.0],[1956.0,1843.0],[1929.0,677.0]],[[1098.0,1235.0],[1623.0,1061.0],[1046.0,1270.0],[60.0,187.0]],[[1874.0,1874.0],[1456.0,950.0],[1819.0,856.0],[1949.0,1374.0]],[[593.0,1572.0],[1791.0,222.0],[455.0,1459.0],[33.0,1047.0]],[[221.0,1255.0],[1551.0,61.0],[1329.0,1385.0],[1264.0,203.0]],[[854.0,334.0],[1346.0,491.0],[271.0,525.0],[1205.0,1677.0]],[[1395.0,952.0],[111.0,749.0],[1498.0,1239.0],[1203.0,1548.0]],[[1722.0,1890.0],[303.0,815.0],[1669.0,948.0],[172.0,986.0]],[[919.0,997.0],[1616.0,1553.0],[860.0,622.0],[1225.0,1474.0]],[[5.0,1258.0],[1819.0,2039.0],[699.0,599.0],[127.0,1518.0]],[[1789.0,1400.0],[2005.0,1300.0],[456.0,1197.0],[1130.0,1759.0]],[[46.0,1272.0],[354.0,2014.0],[470.0,903.0],[1084.0,1789.0]],[[1526.0,944.0],[222.0,419.0],[667.0,531.0],[1196.0,197.0]],[[279.0,893.0],[12.0,253.0],[1732.0,86.0],[271.0,225.0]],[[36.0,142.0],[1389.0,1362.0],[76.0,36.0],[865.0,1920.0]],[[819.0,1090.0],[1209.0,1029.0],[956.0,748.0],[863.0,1603.0]],[[244.0,977.0],[1853.0,144.0],[1357.0,1338.0],[1666.0,490.0]],[[65.0,757.0],[383.0,757.0],[894.0,921.0],[723.0,1245.0]],[[400.0,240.0],[1285.0,599.0],[257.0,1815.0],[614.0,945.0]],[[176.0,1172.0],[1410.0,238.0],[365.0,1812.0],[820.0,933.0]],[[758.0,488.0],[235.0,828.0],[221.0,474.0],[358.0,900.0]],[[1171.0,1032.0],[1731.0,1018.0],[132.0,1031.0],[797.0,1334.0]],[[1433.0,1463.0],[1860.0,1566.0],[1583.0,366.0],[1745.0,1001.0]],[[2004.0,1407.0],[731.0,466.0],[981.0,296.0],[1788.0,1134.0]],[[1244.0,1372.0],[1517.0,1676.0],[1869.0,1492.0],[1441.0,1293.0]],[[1622.0,1930.0],[70.0,1516.0],[521.0,1238.0],[688.0,1237.0]],[[519.0,612.0],[683.0,1874.0],[623.0,553.0],[659.0,326.0]],[[1039.0,964.0],[1457.0,1291.0],[702.0,1135.0],[1937.0,1268.0]],[[316.0,1754.0],[630.0,1446.0],[1841.0,440.0],[638.0,1293.0]],[[283.0,765.0],[1964.0,143.0],[191.0,785.0],[1458.0,1499.0]],[[1455.0,1534.0],[1401.0,493.0],[756.0,1537.0],[133.0,1109.0]],[[860.0,255.0],[1011.0,1246.0],[1339.0,1650.0],[1000.0,1473.0]],[[202.0,949.0],[1190.0,27.0],[800.0,397.0],[554.0,912.0]],[[1510.0,1091.0],[576.0,665.0],[934.0,308.0],[1275.0,1769.0]],[[1799.0,1945.0],[749.0,1456.0],[800.0,1773.0],[303.0,1134.0]],[[840.0,937.0],[582.0,547.0],[852.0,86.0],[670.0,1989.0]],[[1486.0,753.0],[201.0,1475.0],[337.0,972.0],[865.0,356.0]],[[1807.0,804.0],[1402.0,675.0],[73.0,891.0],[1294.0,1967.0]],[[148.0,214.0],[1502.0,2047.0],[1431.0,555.0],[1999.0,279.0]],[[1305.0,1276.0],[1301.0,366.0],[1969.0,1384.0],[1702.0,292.0]],[[1073.0,257.0],[1322.0,78.0],[738.0,1341.0],[924.0,1282.0]],[[1075.0,1033.0],[1254.0,1997.0],[1703.0,49.0],[1206.0,665.0]],[[1191.0,199.0],[474.0,1767.0],[1763.0,890.0],[1139.0,1460.0]],[[2024.0,1152.0],[1048.0,706.0],[1321.0,584.0],[1440.0,387.0]],[[1626.0,1461.0],[787.0,1621.0],[1840.0,614.0],[1970.0,994.0]],[[154.0,1014.0],[323.0,288.0],[157.0,1931.0],[1983.0,1340.0]],[[698.0,2036.0],[1628.0,54.0],[1581.0,1845.0],[677.0,1528.0]],[[211.0,1508.0],[1445.0,1793.0],[972.0,1243.0],[361.0,1809.0]],[[1462.0,799.0],[660.0,551.0],[1811.0,184.0],[1491.0,1381.0]],[[710.0,2008.0],[1959.0,34.0],[958.0,243.0],[1819.0,669.0]],[[853.0,1639.0],[1908.0,505.0],[1289.0,1073.0],[566.0,693.0]],[[1351.0,539.0],[739.0,1262.0],[959.0,1750.0],[1917.0,1875.0]],[[1274.0,695.0],[1264.0,846.0],[1157.0,633.0],[26.0,1394.0]],[[487.0,1742.0],[1556.0,732.0],[1800.0,1840.0],[1811.0,1489.0]],[[845.0,221.0],[348.0,439.0],[398.0,1587.0],[562.0,1816.0]],[[1626.0,745.0],[1945.0,1838.0],[149.0,794.0],[1843.0,2000.0]],[[1596.0,1190.0],[1428.0,710.0],[1119.0,738.0],[112.0,248.0]],[[265.0,941.0],[1825.0,1306.0],[1808.0,1373.0],[416.0,1590.0]],[[220.0,1918.0],[1139.0,1676.0],[1905.0,1356.0],[393.0,672.0]],[[1643.0,1749.0],[1956.0,610.0],[1308.0,597.0],[1433.0,562.0]],[[792.0,921.0],[885.0,1859.0],[637.0,423.0],[421.0,1741.0]],[[215.0,1857.0],[621.0,1534.0],[1317.0,1147.0],[1630.0,58.0]],[[1587.0,1995.0],[1824.0,1235.0],[1241.0,1585.0],[1282.0,1186.0]],[[713.0,410.0],[2004.0,736.0],[1825.0,628.0],[1878.0,432.0]],[[505.0,1304.0],[1295.0,2024.0],[1396.0,1309.0],[1894.0,1324.0]],[[1984.0,1614.0],[893.0,680.0],[987.0,819.0],[1004.0,211.0]],[[1314.0,252.0],[1344.0,1719.0],[121.0,1410.0],[1472.0,1480.0]],[[1674.0,856.0],[1182.0,919.0],[1284.0,1627.0],[1575.0,719.0]],[[34.0,1592.0],[1434.0,910.0],[958.0,269.0],[1311.0,1575.0]],[[834.0,1202.0],[392.0,1777.0],[16.0,1437.0],[381.0,1670.0]],[[627.0,456.0],[734.0,1394.0],[590.0,1538.0],[1789.0,1333.0]],[[1135.0,854.0],[794.0,648.0],[674.0,657.0],[600.0,490.0]],[[1810.0,532.0],[1766.0,548.0],[1367.0,1299.0],[561.0,84.0]],[[1468.0,713.0],[926.0,962.0],[2035.0,2001.0],[140.0,367.0]],[[547.0,1920.0],[584.0,856.0],[1476.0,564.0],[1147.0,1427.0]],[[265.0,1571.0],[1946.0,122.0],[1891.0,806.0],[986.0,844.0]],[[20.0,1245.0],[172.0,1093.0],[775.0,294.0],[433.0,451.0]],[[1639.0,1359.0],[429.0,1824.0],[1977.0,1149.0],[584.0,1766.0]],[[1521.0,1429.0],[1571.0,1685.0],[1786.0,1507.0],[843.0,801.0]],[[267.0,593.0],[974.0,982.0],[85.0,987.0],[1612.0,1870.0]],[[1805.0,390.0],[221.0,705.0],[31.0,181.0],[1762.0,1140.0]],[[1701.0,543.0],[965.0,1533.0],[1698.0,1400.0],[193.0,1861.0]],[[529.0,1491.0],[246.0,1430.0],[480.0,1005.0],[510.0,1788.0]],[[609.0,78.0],[1496.0,532.0],[616.0,1180.0],[101.0,1934.0]],[[109.0,1978.0],[274.0,1765.0],[376.0,1924.0],[396.0,527.0]],[[1612.0,1679.0],[990.0,1555.0],[1956.0,1299.0],[1793.0,478.0]],[[275.0,862.0],[1512.0,427.0],[393.0,1453.0],[432.0,802.0]],[[455.0,358.0],[14.0,1768.0],[960.0,374.0],[1258.0,1997.0]],[[253.0,1757.0],[1221.0,1605.0],[167.0,118.0],[1133.0,1959.0]],[[1793.0,896.0],[1100.0,1317.0],[1956.0,1808.0],[224.0,1101.0]],[[711.0,1793.0],[1865.0,1211.0],[747.0,1314.0],[1629.0,1694.0]],[[1631.0,1955.0],[903.0,1254.0],[70.0,258.0],[605.0,2021.0]],[[474.0,1472.0],[1061.0,1266.0],[1241.0,567.0],[437.0,565.0]],[[1864.0,155.0],[1825.0,1923.0],[1334.0,1520.0],[512.0,59.0]],[[825.0,1100.0],[265.0,1892.0],[1160.0,49.0],[1089.0,88.0]],[[1644.0,458.0],[400.0,1319.0],[1832.0,374.0],[2041.0,1407.0]],[[178.0,769.0],[694.0,227.0],[476.0,174.0],[480.0,1249.0]],[[821.0,663.0],[615.0,933.0],[890.0,367.0],[1445.0,1783.0]],[[1092.0,551.0],[1171.0,1016.0],[284.0,1084.0],[232.0,89.0]],[[1768.0,1156.0],[1944.0,1728.0],[1787.0,278.0],[758.0,879.0]],[[139.0,1758.0],[1697.0,1453.0],[1453.0,607.0],[732.0,925.0]],[[939.0,243.0],[1497.0,274.0],[1828.0,1318.0],[891.0,897.0]],[[1055.0,634.0],[1562.0,439.0],[1956.0,7.0],[1933.0,1278.0]],[[1075.0,1192.0],[854.0,543.0],[1558.0,143.0],[1566.0,1872.0]],[[99.0,539.0],[948.0,2020.0],[405.0,1212.0],[1786.0,822.0]],[[1367.0,402.0],[1019.0,993.0],[2013.0,474.0],[728.0,2033.0]],[[1468.0,1774.0],[1639.0,1727.0],[97.0,1635.0],[579.0,1743.0]],[[521.0,248.0],[1197.0,1591.0],[1761.0,390.0],[825.0,1111.0]],[[1961.0,1729.0],[1082.0,436.0],[1334.0,626.0],[1063.0,100.0]],[[397.0,1518.0],[1860.0,1085.0],[387.0,1163.0],[569.0,346.0]],[[1664.0,1558.0],[114.0,1961.0],[532.0,1603.0],[2015.0,954.0]],[[115.0,1540.0],[253.0,1681.0],[344.0,1023.0],[162.0,1860.0]],[[343.0,1202.0],[162.0,1423.0],[173.0,279.0],[299.0,185.0]],[[1256.0,1451.0],[1261.0,371.0],[1927.0,1464.0],[1338.0,700.0]],[[1454.0,1023.0],[1340.0,953.0],[1017.0,891.0],[1272.0,1253.0]],[[1322.0,1236.0],[19.0,1970.0],[1035.0,942.0],[604.0,989.0]],[[660.0,346.0],[1063.0,1633.0],[829.0,564.0],[675.0,303.0]],[[1295.0,1581.0],[864.0,648.0],[158.0,1825.0],[884.0,1641.0]],[[461.0,1273.0],[900.0,1186.0],[1826.0,1378.0],[341.0,280.0]],[[288.0,945.0],[490.0,1898.0],[1877.0,40.0],[686.0,1876.0]],[[1772.0,449.0],[787.0,63.0],[996.0,1260.0],[877.0,1204.0]],[[1261.0,1081.0],[1431.0,1088.0],[1177.0,194.0],[119.0,43.0]],[[1807.0,173.0],[844.0,315.0],[1292.0,1852.0],[1246.0,468.0]],[[1010.0,454.0],[790.0,123.0],[797.0,555.0],[105.0,1803.0]],[[117.0,931.0],[1946.0,708.0],[36.0,917.0],[566.0,256.0]],[[65.0,561.0],[1312.0,346.0],[1068.0,798.0],[1631.0,32.0]],[[1145.0,1441.0],[1060.0,1578.0],[1654.0,1906.0],[1142.0,362.0]],[[737.0,1963.0],[1613.0,545.0],[853.0,105.0],[211.0,1299.0]],[[592.0,896.0],[1305.0,1625.0],[167.0,1672.0],[1944.0,265.0]],[[140.0,537.0],[1682.0,1595.0],[1112.0,181.0],[891.0,795.0]],[[1246.0,1557.0],[1227.0,93.0],[1092.0,781.0],[665.0,941.0]],[[360.0,863.0],[1967.0,674.0],[215.0,1648.0],[1158.0,60.0]],[[618.0,405.0],[162.0,1761.0],[1945.0,717.0],[893.0,1919.0]],[[441.0,1658.0],[917.0,259.0],[520.0,1384.0],[1944.0,2021.0]],[[1505.0,1772.0],[1016.0,1814.0],[1064.0,1655.0],[1457.0,1582.0]],[[937.0,1545.0],[435.0,740.0],[1411.0,310.0],[105.0,1718.0]],[[2023.0,249.0],[1885.0,451.0],[959.0,1862.0],[1438.0,374.0]],[[1372.0,151.0],[1133.0,1372.0],[531.0,684.0],[1760.0,1276.0]],[[1813.0,996.0],[2004.0,1571.0],[113.0,1043.0],[493.0,1174.0]],[[1063.0,101.0],[345.0,1329.0],[741.0,896.0],[1202.0,331.0]],[[698.0,1865.0],[1523.0,1633.0],[1854.0,1933.0],[420.0,2001.0]],[[341.0,139.0],[242.0,76.0],[1141.0,149.0],[1100.0,1273.0]],[[722.0,1955.0],[1381.0,69.0],[1862.0,1400.0],[972.0,927.0]],[[1416.0,237.0],[93.0,1804.0],[811.0,1612.0],[627.0,734.0]],[[950.0,333.0],[1617.0,167.0],[713.0,1311.0],[19.0,1860.0]],[[665.0,156.0],[1730.0,909.0],[1053.0,1793.0],[773.0,166.0]],[[1546.0,1681.0],[1632.0,1745.0],[1113.0,1813.0],[1380.0,97.0]],[[320.0,1935.0],[1717.0,663.0],[1763.0,656.0],[704.0,1094.0]],[[1691.0,1971.0],[1169.0,1422.0],[1870.0,1628.0],[1542.0,1172.0]],[[983.0,1469.0],[923.0,1084.0],[82.0,296.0],[1078.0,1596.0]],[[657.0,1081.0],[1033.0,2009.0],[64.0,652.0],[1980.0,452.0]],[[899.0,622.0],[462.0,1574.0],[232.0,706.0],[279.0,388.0]],[[1918.0,1918.0],[102.0,237.0],[1111.0,210.0],[1934.0,851.0]],[[1457.0,1793.0],[452.0,1387.0],[1304.0,1565.0],[1593.0,1188.0]],[[338.0,938.0],[1807.0,1431.0],[1750.0,1766.0],[1785.0,1091.0]],[[764.0,617.0],[216.0,1353.0],[1440.0,1542.0],[275.0,1302.0]],[[725.0,595.0],[469.0,836.0],[1954.0,954.0],[1468.0,661.0]],[[832.0,1224.0],[703.0,566.0],[1638.0,1743.0],[2003.0,1437.0]],[[139.0,308.0],[99.0,1507.0],[1019.0,637.0],[874.0,1622.0]],[[1817.0,1117.0],[1745.0,1384.0],[1974.0,1395.0],[332.0,224.0]],[[570.0,1924.0],[721.0,372.0],[33.0,266.0],[98.0,751.0]],[[1141.0,795.0],[1886.0,1647.0],[1111.0,1081.0],[1574.0,431.0]],[[1619.0,1897.0],[988.0,291.0],[1280.0,550.0],[108.0,1550.0]],[[230.0,1189.0],[1413.0,69.0],[1798.0,1299.0],[41.0,1293.0]],[[1605.0,209.0],[1829.0,398.0],[1734.0,1663.0],[504.0,71.0]],[[47.0,1673.0],[1426.0,719.0],[1656.0,166.0],[586.0,1169.0]],[[1683.0,680.0],[1921.0,1202.0],[1049.0,143.0],[1600.0,1687.0]],[[599.0,1327.0],[697.0,1856.0],[1610.0,514.0],[323.0,1609.0]],[[1066.0,1604.0],[2003.0,137.0],[1190.0,653.0],[1101.0,1590.0]],[[1122.0,511.0],[1046.0,36.0],[489.0,437.0],[1916.0,619.0]],[[1908.0,986.0],[973.0,170.0],[920.0,327.0],[443.0,395.0]],[[153.0,467.0],[179.0,1033.0],[1699.0,600.0],[1420.0,467.0]],[[204.0,1595.0],[915.0,652.0],[2004.0,702.0],[1442.0,1630.0]],[[701.0,1335.0],[288.0,203.0],[62.0,1220.0],[407.0,1845.0]],[[356.0,2.0],[194.0,1151.0],[1249.0,1042.0],[1878.0,1569.0]],[[480.0,915.0],[1253.0,514.0],[98.0,1499.0],[1828.0,386.0]],[[1765.0,636.0],[1125.0,466.0],[1528.0,1033.0],[864.0,1345.0]],[[577.0,913.0],[30.0,942.0],[1976.0,1469.0],[521.0,1672.0]],[[1404.0,1750.0],[1802.0,458.0],[1025.0,217.0],[1209.0,1305.0]],[[815.0,852.0],[939.0,991.0],[1540.0,1421.0],[1050.0,6.0]],[[2015.0,575.0],[1751.0,1981.0],[370.0,1130.0],[409.0,898.0]],[[444.0,1745.0],[1659.0,582.0],[469.0,1800.0],[886.0,660.0]],[[882.0,1116.0],[1497.0,1337.0],[1422.0,1031.0],[611.0,127.0]],[[906.0,1053.0],[1974.0,65.0],[1400.0,68.0],[714.0,822.0]],[[1063.0,942.0],[299.0,1745.0],[1511.0,1516.0],[776.0,432.0]],[[18.0,1606.0],[1388.0,1350.0],[1680.0,1405.0],[1054.0,1648.0]],[[1129.0,1446.0],[307.0,1791.0],[913.0,1933.0],[1417.0,1158.0]],[[119.0,434.0],[220.0,700.0],[922.0,1799.0],[1203.0,1733.0]],[[1632.0,18.0],[278.0,1625.0],[625.0,850.0],[1942.0,1612.0]],[[2022.0,404.0],[1679.0,675.0],[2018.0,880.0],[1264.0,148.0]],[[1223.0,1200.0],[568.0,1028.0],[1244.0,1949.0],[546.0,1787.0]],[[1365.0,1315.0],[863.0,1138.0],[162.0,1272.0],[1206.0,2036.0]],[[1224.0,1082.0],[654.0,1186.0],[1077.0,1368.0],[610.0,1060.0]],[[1586.0,1810.0],[2027.0,690.0],[1571.0,162.0],[379.0,842.0]],[[1298.0,209.0],[1251.0,164.0],[1701.0,445.0],[1326.0,529.0]],[[42.0,1410.0],[988.0,1451.0],[1779.0,986.0],[342.0,133.0]],[[1371.0,77.0],[1816.0,106.0],[690.0,1151.0],[857.0,1756.0]],[[1184.0,675.0],[179.0,159.0],[2036.0,1598.0],[456.0,1556.0]],[[1179.0,1786.0],[204.0,938.0],[1366.0,1717.0],[1994.0,832.0]],[[364.0,1378.0],[1657.0,734.0],[964.0,1987.0],[295.0,1716.0]],[[1618.0,893.0],[1047.0,6.0],[1154.0,133.0],[1065.0,349.0]],[[736.0,1034.0],[1838.0,1780.0],[1251.0,411.0],[1217.0,220.0]],[[1954.0,719.0],[1042.0,855.0],[516.0,172.0],[1635.0,40.0]],[[1216.0,11.0],[1563.0,1392.0],[396.0,1051.0],[663.0,818.0]],[[297.0,716.0],[1544.0,95.0],[902.0,1663.0],[73.0,17.0]],[[1702.0,719.0],[218.0,1621.0],[1697.0,781.0],[651.0,909.0]],[[375.0,1851.0],[1369.0,1024.0],[785.0,1047.0],[1591.0,1013.0]],[[1197.0,1055.0],[602.0,1089.0],[1481.0,1128.0],[896.0,775.0]],[[89.0,431.0],[895.0,1129.0],[691.0,1319.0],[899.0,666.0]],[[134.0,897.0],[1588.0,1072.0],[1054.0,869.0],[1070.0,1538.0]],[[171.0,135.0],[630.0,2035.0],[1788.0,1234.0],[1501.0,1661.0]],[[1458.0,810.0],[1173.0,1147.0],[1082.0,1979.0],[625.0,1460.0]],[[579.0,1596.0],[250.0,295.0],[1065.0,308.0],[2021.0,852.0]],[[1858.0,1259.0],[164.0,1101.0],[1380.0,17.0],[2029.0,1767.0]],[[1766.0,1735.0],[1501.0,1990.0],[792.0,1771.0],[1603.0,1184.0]],[[393.0,331.0],[659.0,1381.0],[1496.0,1758.0],[1564.0,504.0]],[[1541.0,212.0],[1776.0,823.0],[461.0,938.0],[1956.0,1571.0]],[[708.0,545.0],[901.0,392.0],[1420.0,1323.0],[1800.0,682.0]],[[1549.0,1983.0],[754.0,153.0],[812.0,1023.0],[537.0,489.0]],[[1121.0,53.0],[20.0,1523.0],[1169.0,879.0],[222.0,1277.0]],[[606.0,521.0],[275.0,640.0],[1712.0,1099.0],[535.0,298.0]],[[791.0,658.0],[1707.0,887.0],[1608.0,2007.0],[709.0,263.0]],[[2041.0,994.0],[835.0,298.0],[621.0,1001.0],[775.0,603.0]],[[1063.0,267.0],[1524.0,323.0],[1456.0,1141.0],[734.0,1923.0]],[[1775.0,904.0],[516.0,481.0],[1783.0,1755.0],[1506.0,917.0]],[[1817.0,1604.0],[1362.0,751.0],[214.0,199.0],[1504.0,1897.0]],[[661.0,1911.0],[1528.0,1442.0],[639.0,1873.0],[823.0,1954.0]],[[1155.0,852.0],[520.0,902.0],[1157.0,433.0],[360.0,929.0]],[[1738.0,877.0],[1231.0,2016.0],[252.0,1538.0],[835.0,218.0]],[[1265.0,1226.0],[863.0,1755.0],[51.0,1870.0],[1333.0,1719.0]],[[999.0,431.0],[690.0,208.0],[1565.0,667.0],[70.0,2031.0]],[[1987.0,1510.0],[1747.0,117.0],[1785.0,1594.0],[972.0,33.0]],[[176.0,818.0],[1292.0,146.0],[552.0,1796.0],[731.0,1851.0]],[[599.0,588.0],[1030.0,1564.0],[380.0,505.0],[290.0,1570.0]],[[1982.0,1501.0],[862.0,154.0],[1676.0,903.0],[1970.0,809.0]],[[691.0,969.0],[807.0,1386.0],[1223.0,1955.0],[963.0,872.0]],[[1153.0,504.0],[41.0,150.0],[1291.0,364.0],[731.0,1868.0]],[[329.0,1678.0],[574.0,177.0],[574.0,1309.0],[1469.0,1851.0]],[[780.0,1639.0],[1898.0,351.0],[1615.0,1498.0],[40.0,1167.0]],[[866.0,1458.0],[1533.0,30.0],[388.0,1824.0],[1660.0,1256.0]],[[709.0,1225.0],[898.0,1351.0],[1361.0,867.0],[167.0,208.0]],[[76.0,745.0],[1894.0,1328.0],[150.0,1089.0],[1112.0,269.0]],[[1023.0,48.0],[532.0,1692.0],[1423.0,1105.0],[2041.0,159.0]],[[1580.0,453.0],[1250.0,1717.0],[1016.0,939.0],[1785.0,1081.0]],[[42.0,23.0],[620.0,1945.0],[610.0,1433.0],[317.0,1013.0]],[[632.0,543.0],[1642.0,568.0],[1352.0,795.0],[530.0,560.0]],[[477.0,521.0],[136.0,1139.0],[1118.0,1443.0],[30.0,595.0]],[[35.0,261.0],[1868.0,1772.0],[1628.0,1267.0],[547.0,1604.0]],[[1745.0,1474.0],[1834.0,1432.0],[1197.0,1946.0],[760.0,1101.0]],[[32.0,1275.0],[941.0,217.0],[2045.0,244.0],[30.0,324.0]],[[1897.0,10.0],[1005.0,542.0],[1605.0,1591.0],[911.0,1133.0]],[[750.0,893.0],[661.0,371.0],[1353.0,1420.0],[352.0,499.0]],[[945.0,838.0],[1345.0,1834.0],[339.0,1766.0],[1459.0,676.0]],[[741.0,416.0],[1451.0,756.0],[2020.0,324.0],[1868.0,1766.0]],[[895.0,259.0],[277.0,1030.0],[1344.0,1605.0],[1508.0,1336.0]],[[1762.0,289.0],[779.0,1686.0],[1423.0,2036.0],[1419.0,488.0]],[[1832.0,1348.0],[35.0,922.0],[1245.0,1682.0],[573.0,784.0]],[[1139.0,189.0],[664.0,1269.0],[233.0,455.0],[1088.0,457.0]],[[736.0,1852.0],[1015.0,1919.0],[1765.0,223.0],[577.0,2018.0]],[[1473.0,1195.0],[1537.0,364.0],[1790.0,531.0],[955.0,1753.0]],[[1993.0,256.0],[1481.0,758.0],[253.0,835.0],[776.0,76.0]],[[1421.0,973.0],[978.0,1682.0],[1699.0,676.0],[961.0,3.0]],[[899.0,232.0],[636.0,369.0],[101.0,582.0],[1091.0,940.0]],[[1477.0,1362.0],[564.0,384.0],[1047.0,1690.0],[1456.0,173.0]],[[254.0,1877.0],[154.0,1288.0],[1275.0,1229.0],[1596.0,1256.0]],[[1576.0,1976.0],[1206.0,491.0],[46.0,433.0],[1736.0,301.0]],[[854.0,504.0],[38.0,1006.0],[1921.0,290.0],[871.0,1396.0]],[[879.0,1212.0],[1170.0,1905.0],[1905.0,861.0],[1895.0,1542.0]],[[342.0,126.0],[302.0,1232.0],[1840.0,839.0],[1209.0,1697.0]],[[757.0,1616.0],[1536.0,1896.0],[906.0,1010.0],[2022.0,57.0]],[[1198.0,1099.0],[1942.0,2021.0],[1441.0,448.0],[491.0,876.0]],[[1828.0,1589.0],[880.0,1724.0],[252.0,720.0],[1583.0,1741.0]],[[1530.0,580.0],[278.0,654.0],[184.0,868.0],[1905.0,1269.0]],[[1232.0,1947.0],[551.0,86.0],[1848.0,1776.0],[1413.0,1784.0]],[[1488.0,892.0],[1106.0,832.0],[1888.0,1940.0],[1111.0,1701.0]],[[1165.0,1134.0],[1817.0,269.0],[455.0,1332.0],[1833.0,1176.0]],[[929.0,1311.0],[1016.0,635.0],[643.0,1041.0],[1016.0,1686.0]],[[123.0,1758.0],[1630.0,923.0],[557.0,294.0],[347.0,676.0]],[[1919.0,1554.0],[900.0,1196.0],[1602.0,1099.0],[32.0,1162.0]],[[613.0,492.0],[1765.0,1153.0],[1232.0,1714.0],[250.0,609.0]],[[398.0,678.0],[1996.0,1773.0],[454.0,235.0],[1469.0,1303.0]],[[1258.0,147.0],[1254.0,1848.0],[128.0,1409.0],[1165.0,870.0]],[[1079.0,1121.0],[691.0,1175.0],[1385.0,367.0],[145.0,527.0]],[[538.0,1571.0],[1323.0,1388.0],[1929.0,685.0],[1199.0,111.0]],[[1086.0,72.0],[94.0,1721.0],[1900.0,99.0],[1593.0,435.0]],[[509.0,67.0],[1571.0,366.0],[2045.0,879.0],[1449.0,133.0]],[[1678.0,1933.0],[1307.0,775.0],[34.0,520.0],[1932.0,1928.0]],[[1026.0,1770.0],[412.0,1704.0],[1853.0,1208.0],[381.0,213.0]],[[1735.0,630.0],[1437.0,811.0],[339.0,1869.0],[1481.0,453.0]],[[1356.0,412.0],[833.0,1301.0],[649.0,657.0],[1353.0,334.0]],[[854.0,1201.0],[269.0,2009.0],[1889.0,2048.0],[1820.0,1581.0]],[[1491.0,1945.0],[714.0,583.0],[1.0,717.0],[1263.0,725.0]],[[614.0,849.0],[550.0,998.0],[1873.0,565.0],[347.0,1984.0]],[[1595.0,1615.0],[1737.0,1786.0],[1927.0,1147.0],[1955.0,513.0]],[[810.0,1548.0],[144.0,1123.0],[575.0,1802.0],[891.0,635.0]],[[1598.0,1811.0],[253.0,1423.0],[925.0,639.0],[1170.0,2005.0]],[[1354.0,627.0],[264.0,1611.0],[299.0,303.0],[0.0,123.0]],[[307.0,357.0],[536.0,1030.0],[251.0,853.0],[1764.0,1383.0]],[[1140.0,1455.0],[820.0,649.0],[1678.0,328.0],[1451.0,472.0]],[[1731.0,1846.0],[1366.0,416.0],[42.0,229.0],[607.0,1670.0]],[[864.0,826.0],[279.0,656.0],[1865.0,97.0],[1339.0,1206.0]],[[1271.0,628.0],[1852.0,214.0],[179.0,1180.0],[652.0,99.0]],[[1293.0,97.0],[605.0,1032.0],[436.0,956.0],[1050.0,2026.0]],[[2044.0,785.0],[316.0,536.0],[1169.0,123.0],[966.0,645.0]],[[716.0,997.0],[1884.0,440.0],[14.0,801.0],[1497.0,698.0]],[[1106.0,388.0],[330.0,1230.0],[950.0,1543.0],[1219.0,555.0]],[[1234.0,570.0],[1219.0,493.0],[1226.0,411.0],[854.0,1802.0]],[[1636.0,400.0],[124.0,1619.0],[1952.0,31.0],[1203.0,1922.0]],[[1920.0,1511.0],[737.0,857.0],[1954.0,817.0],[927.0,564.0]],[[1772.0,813.0],[1493.0,2012.0],[933.0,199.0],[1006.0,470.0]],[[1487.0,273.0],[174.0,870.0],[1769.0,1356.0],[1667.0,1840.0]],[[1809.0,1885.0],[1839.0,1520.0],[160.0,833.0],[1063.0,533.0]],[[443.0,1700.0],[819.0,1341.0],[422.0,21.0],[914.0,812.0]],[[1573.0,798.0],[1241.0,1265.0],[1533.0,953.0],[115.0,1022.0]],[[1136.0,1249.0],[742.0,468.0],[60.0,1425.0],[632.0,1595.0]],[[2011.0,1864.0],[460.0,925.0],[1438.0,252.0],[336.0,988.0]],[[703.0,808.0],[1751.0,575.0],[1550.0,1642.0],[1442.0,336.0]],[[152.0,1865.0],[1448.0,1179.0],[1524.0,1347.0],[1532.0,45.0]],[[468.0,1584.0],[1235.0,1119.0],[239.0,1965.0],[1132.0,213.0]],[[2013.0,1301.0],[1754.0,1866.0],[901.0,698.0],[168.0,1642.0]],[[1050.0,785.0],[1289.0,824.0],[457.0,685.0],[1722.0,1727.0]],[[1035.0,528.0],[380.0,1056.0],[981.0,1144.0],[753.0,1856.0]],[[1743.0,69.0],[592.0,1250.0],[567.0,581.0],[1685.0,150.0]],[[1913.0,2029.0],[183.0,1584.0],[434.0,1204.0],[1693.0,1897.0]],[[440.0,1750.0],[1681.0,109.0],[1075.0,253.0],[1193.0,1062.0]],[[1332.0,117.0],[573.0,225.0],[894.0,1294.0],[397.0,671.0]],[[1236.0,1691.0],[587.0,324.0],[2030.0,258.0],[1744.0,1497.0]],[[612.0,1886.0],[1663.0,1342.0],[1155.0,2042.0],[318.0,553.0]],[[73.0,360.0],[840.0,1489.0],[1965.0,607.0],[715.0,543.0]],[[1739.0,186.0],[305.0,1458.0],[1277.0,1028.0],[1476.0,1515.0]],[[1270.0,1665.0],[1632.0,1949.0],[1795.0,1508.0],[1335.0,1690.0]],[[620.0,543.0],[1957.0,1025.0],[1035.0,1749.0],[1931.0,198.0]],[[1204.0,2020.0],[1411.0,2027.0],[538.0,1830.0],[593.0,1942.0]],[[619.0,953.0],[1364.0,287.0],[1495.0,696.0],[1720.0,1678.0]],[[1246.0,1105.0],[904.0,41.0],[1965.0,1464.0],[331.0,1076.0]],[[1990.0,1609.0],[1881.0,186.0],[1749.0,1036.0],[1996.0,612.0]],[[1318.0,607.0],[843.0,1561.0],[498.0,454.0],[1316.0,588.0]],[[1921.0,1839.0],[632.0,2023.0],[638.0,249.0],[775.0,1632.0]],[[1369.0,1059.0],[1999.0,1185.0],[151.0,1785.0],[329.0,878.0]],[[109.0,1310.0],[1657.0,1194.0],[1008.0,1229.0],[1768.0,1433.0]],[[1809.0,1328.0],[1137.0,493.0],[1522.0,139.0],[1182.0,832.0]],[[445.0,1058.0],[69.0,1056.0],[1368.0,452.0],[1632.0,1887.0]],[[1207.0,1145.0],[1526.0,591.0],[2016.0,236.0],[427.0,1551.0]],[[1820.0,1282.0],[28.0,1911.0],[963.0,558.0],[1284.0,614.0]],[[835.0,1987.0],[703.0,1152.0],[1411.0,898.0],[849.0,250.0]],[[1861.0,1129.0],[1898.0,1888.0],[1924.0,1495.0],[1749.0,1732.0]],[[279.0,921.0],[1411.0,227.0],[1331.0,425.0],[1571.0,2047.0]],[[1355.0,583.0],[831.0,280.0],[1098.0,2035.0],[1992.0,1919.0]],[[1305.0,1906.0],[328.0,2017.0],[1147.0,464.0],[539.0,1706.0]],[[381.0,592.0],[1565.0,394.0],[1735.0,893.0],[600.0,15.0]],[[460.0,415.0],[335.0,1353.0],[509.0,1533.0],[1707.0,1616.0]],[[305.0,1695.0],[1847.0,1229.0],[1785.0,1804.0],[1629.0,546.0]],[[1872.0,1958.0],[1585.0,434.0],[1360.0,1136.0],[578.0,1084.0]],[[178.0,387.0],[681.0,145.0],[18.0,1339.0],[1384.0,168.0]],[[662.0,1727.0],[1798.0,70.0],[1766.0,1645.0],[500.0,1618.0]],[[232.0,112.0],[558.0,983.0],[1990.0,1599.0],[1285.0,525.0]],[[1181.0,570.0],[573.0,578.0],[597.0,970.0],[812.0,125.0]],[[870.0,2005.0],[1875.0,1490.0],[1923.0,1753.0],[2.0,1720.0]],[[977.0,1552.0],[1092.0,109.0],[1326.0,445.0],[1005.0,1755.0]],[[1052.0,529.0],[1916.0,1504.0],[1031.0,496.0],[373.0,1433.0]],[[1658.0,1810.0],[1493.0,1727.0],[1798.0,2046.0],[1542.0,115.0]],[[196.0,1998.0],[1321.0,946.0],[422.0,80.0],[1433.0,315.0]],[[735.0,1946.0],[502.0,946.0],[592.0,1882.0],[309.0,686.0]],[[1143.0,1939.0],[1494.0,765.0],[954.0,178.0],[1197.0,1816.0]],[[1856.0,1154.0],[1006.0,45.0],[1245.0,1925.0],[609.0,812.0]],[[806.0,743.0],[1254.0,295.0],[1051.0,690.0],[1604.0,1238.0]],[[740.0,1861.0],[1630.0,383.0],[1463.0,1461.0],[944.0,11.0]],[[673.0,1862.0],[515.0,1156.0],[1583.0,608.0],[1379.0,1404.0]],[[1026.0,13.0],[587.0,770.0],[1053.0,872.0],[25.0,237.0]],[[148.0,1881.0],[1165.0,911.0],[449.0,319.0],[612.0,831.0]],[[729.0,127.0],[1784.0,642.0],[703.0,1802.0],[1313.0,212.0]],[[1829.0,1464.0],[1175.0,522.0],[215.0,996.0],[465.0,1852.0]],[[2013.0,941.0],[1296.0,457.0],[1253.0,618.0],[1091.0,1719.0]],[[1085.0,470.0],[74.0,17.0],[1518.0,753.0],[232.0,1340.0]],[[651.0,173.0],[141.0,120.0],[1070.0,1014.0],[125.0,1193.0]],[[1975.0,2045.0],[1383.0,366.0],[817.0,717.0],[1438.0,365.0]],[[1515.0,591.0],[1474.0,794.0],[1891.0,1551.0],[1835.0,1420.0]],[[320.0,1010.0],[955.0,389.0],[966.0,361.0],[1278.0,1514.0]],[[332.0,499.0],[1476.0,1021.0],[1161.0,1268.0],[510.0,685.0]],[[1665.0,867.0],[1900.0,559.0],[806.0,325.0],[1777.0,297.0]],[[1561.0,630.0],[999.0,1234.0],[1049.0,1961.0],[1582.0,480.0]],[[444.0,1472.0],[1860.0,1974.0],[1616.0,869.0],[1365.0,615.0]],[[1099.0,1331.0],[802.0,184.0],[1648.0,1088.0],[1318.0,440.0]],[[543.0,835.0],[1529.0,1926.0],[1329.0,176.0],[225.0,1877.0]],[[549.0,1860.0],[2043.0,873.0],[1139.0,1054.0],[639.0,1163.0]],[[486.0,1301.0],[915.0,1399.0],[1280.0,804.0],[497.0,1702.0]],[[864.0,1722.0],[544.0,363.0],[1591.0,119.0],[1580.0,570.0]],[[1613.0,1416.0],[1624.0,599.0],[381.0,945.0],[817.0,1992.0]],[[1937.0,1551.0],[1301.0,1034.0],[36.0,1067.0],[99.0,1561.0]],[[1610.0,592.0],[698.0,1063.0],[406.0,1666.0],[467.0,1956.0]],[[1654.0,219.0],[1998.0,334.0],[325.0,911.0],[1381.0,1580.0]],[[1406.0,1456.0],[1027.0,989.0],[1678.0,562.0],[906.0,1642.0]],[[190.0,1008.0],[769.0,604.0],[1388.0,767.0],[445.0,853.0]],[[1722.0,215.0],[1361.0,1480.0],[1430.0,1788.0],[933.0,1435.0]],[[1559.0,292.0],[921.0,1916.0],[525.0,1461.0],[1510.0,378.0]],[[1896.0,1712.0],[1546.0,1076.0],[300.0,1875.0],[1912.0,610.0]],[[1079.0,58.0],[1484.0,1735.0],[968.0,1438.0],[1907.0,1357.0]],[[1805.0,47.0],[592.0,984.0],[405.0,922.0],[1116.0,1495.0]],[[917.0,755.0],[1821.0,1465.0],[1506.0,159.0],[747.0,1592.0]],[[1447.0,1423.0],[1674.0,1237.0],[1066.0,1877.0],[336.0,218.0]],[[424.0,1103.0],[1268.0,870.0],[1749.0,819.0],[1006.0,1142.0]],[[376.0,1708.0],[1606.0,1178.0],[1197.0,1989.0],[378.0,1691.0]],[[919.0,818.0],[1972.0,497.0],[1470.0,341.0],[128.0,334.0]],[[1323.0,1000.0],[1812.0,371.0],[789.0,135.0],[1807.0,543.0]],[[350.0,1928.0],[264.0,204.0],[590.0,2024.0],[513.0,2024.0]],[[1786.0,1963.0],[1205.0,46.0],[1024.0,487.0],[373.0,1496.0]],[[137.0,955.0],[620.0,89.0],[1560.0,171.0],[542.0,1365.0]],[[1569.0,297.0],[1844.0,1261.0],[1342.0,847.0],[1748.0,1982.0]],[[262.0,1559.0],[1032.0,18.0],[431.0,1237.0],[901.0,1548.0]],[[53.0,1603.0],[309.0,368.0],[997.0,256.0],[1716.0,1830.0]],[[1274.0,133.0],[588.0,2023.0],[1987.0,1505.0],[614.0,477.0]],[[845.0,1096.0],[57.0,2035.0],[1854.0,589.0],[604.0,1295.0]],[[1639.0,1808.0],[1116.0,1878.0],[1516.0,1625.0],[343.0,89.0]],[[883.0,912.0],[1009.0,1423.0],[1774.0,393.0],[339.0,119.0]],[[956.0,1357.0],[983.0,822.0],[670.0,344.0],[661.0,251.0]],[[1230.0,1026.0],[1367.0,1425.0],[1735.0,1522.0],[843.0,6.0]],[[2044.0,536.0],[731.0,1561.0],[8.0,746.0],[68.0,1085.0]],[[1498.0,894.0],[1666.0,775.0],[997.0,1712.0],[831.0,1701.0]],[[1554.0,176.0],[700.0,5.0],[851.0,410.0],[235.0,1192.0]],[[603.0,1609.0],[1475.0,753.0],[690.0,669.0],[602.0,2047.0]],[[362.0,1832.0],[748.0,1179.0],[1094.0,1432.0],[1812.0,992.0]],[[178.0,937.0],[891.0,1101.0],[980.0,1762.0],[1146.0,963.0]],[[1473.0,2007.0],[1683.0,827.0],[1878.0,1292.0],[190.0,952.0]],[[911.0,635.0],[1734.0,504.0],[300.0,1706.0],[1744.0,1560.0]],[[1876.0,387.0],[829.0,241.0],[1600.0,854.0],[864.0,1770.0]],[[1931.0,1532.0],[430.0,1541.0],[1204.0,1505.0],[1281.0,720.0]],[[1727.0,1009.0],[779.0,307.0],[929.0,350.0],[1042.0,1720.0]],[[913.0,2016.0],[1048.0,137.0],[1613.0,1411.0],[1644.0,1901.0]],[[1707.0,836.0],[223.0,1169.0],[951.0,618.0],[585.0,1379.0]],[[1215.0,1848.0],[1743.0,1234.0],[1532.0,1282.0],[1062.0,931.0]],[[1857.0,1615.0],[1350.0,156.0],[862.0,390.0],[558.0,1012.0]],[[1440.0,589.0],[1830.0,1634.0],[1026.0,51.0],[1706.0,1293.0]],[[586.0,1304.0],[283.0,847.0],[1582.0,861.0],[1638.0,369.0]],[[1917.0,865.0],[461.0,567.0],[1556.0,457.0],[1581.0,1003.0]],[[1912.0,1978.0],[335.0,662.0],[23.0,1445.0],[230.0,1882.0]],[[559.0,2047.0],[1571.0,826.0],[773.0,251.0],[1393.0,805.0]],[[1960.0,1148.0],[731.0,2037.0],[1709.0,196.0],[635.0,787.0]],[[41.0,1259.0],[1715.0,292.0],[755.0,98.0],[1542.0,1185.0]],[[607.0,1168.0],[564.0,699.0],[1222.0,957.0],[1263.0,1837.0]],[[866.0,796.0],[213.0,843.0],[1541.0,1342.0],[1459.0,1569.0]],[[180.0,1619.0],[361.0,644.0],[2021.0,630.0],[1443.0,1266.0]],[[740.0,164.0],[1974.0,1888.0],[1459.0,1412.0],[1422.0,891.0]],[[547.0,988.0],[1697.0,258.0],[982.0,1053.0],[1226.0,1899.0]],[[1369.0,1813.0],[66.0,2014.0],[1998.0,543.0],[108.0,1741.0]],[[1586.0,766.0],[1170.0,1547.0],[780.0,1635.0],[105.0,996.0]],[[1983.0,1392.0],[1484.0,1823.0],[1267.0,322.0],[237.0,1291.0]],[[644.0,557.0],[216.0,1481.0],[1935.0,990.0],[174.0,142.0]],[[59.0,1955.0],[1878.0,1912.0],[1758.0,994.0],[1662.0,720.0]],[[424.0,994.0],[1166.0,1246.0],[942.0,102.0],[432.0,841.0]],[[1759.0,1169.0],[2030.0,1148.0],[1255.0,449.0],[1910.0,568.0]],[[1151.0,1281.0],[1275.0,1391.0],[145.0,1216.0],[805.0,1045.0]],[[1902.0,912.0],[13.0,1282.0],[1870.0,454.0],[264.0,1746.0]],[[1446.0,1033.0],[172.0,573.0],[1250.0,1534.0],[1406.0,1635.0]],[[733.0,214.0],[1917.0,1336.0],[669.0,939.0],[1966.0,667.0]],[[1747.0,1630.0],[448.0,1279.0],[374.0,1880.0],[665.0,1782.0]],[[2009.0,574.0],[258.0,127.0],[1963.0,542.0],[978.0,182.0]],[[1235.0,1695.0],[1897.0,1053.0],[1428.0,1364.0],[1496.0,138.0]],[[737.0,1749.0],[911.0,2034.0],[1521.0,1036.0],[995.0,270.0]],[[1063.0,1198.0],[138.0,1202.0],[1958.0,1973.0],[670.0,378.0]],[[815.0,205.0],[1390.0,1171.0],[270.0,925.0],[694.0,595.0]],[[1774.0,1285.0],[818.0,1904.0],[758.0,3.0],[828.0,207.0]],[[71.0,313.0],[1584.0,1480.0],[1790.0,768.0],[660.0,20.0]],[[1744.0,129.0],[1007.0,254.0],[1609.0,461.0],[1513.0,1533.0]],[[547.0,1559.0],[384.0,1303.0],[2006.0,15.0],[1915.0,962.0]],[[1653.0,327.0],[1773.0,1540.0],[78.0,1409.0],[1201.0,949.0]],[[1631.0,2033.0],[1655.0,1512.0],[204.0,252.0],[1669.0,1754.0]],[[643.0,594.0],[1354.0,780.0],[577.0,2014.0],[1692.0,1284.0]],[[24.0,1497.0],[1526.0,1484.0],[328.0,1571.0],[539.0,148.0]],[[579.0,202.0],[1264.0,1083.0],[1363.0,166.0],[324.0,522.0]],[[562.0,982.0],[1300.0,863.0],[644.0,1818.0],[815.0,1673.0]],[[1525.0,539.0],[1274.0,751.0],[1884.0,101.0],[730.0,499.0]],[[129.0,577.0],[1696.0,1195.0],[870.0,233.0],[290.0,1737.0]],[[1099.0,1925.0],[1806.0,1906.0],[333.0,1405.0],[435.0,1228.0]],[[938.0,182.0],[973.0,475.0],[842.0,733.0],[1609.0,1659.0]],[[527.0,946.0],[846.0,1998.0],[628.0,477.0],[1569.0,1822.0]],[[1470.0,85.0],[1971.0,1998.0],[240.0,1020.0],[1162.0,710.0]],[[1920.0,279.0],[1302.0,354.0],[1069.0,1236.0],[531.0,243.0]],[[1291.0,324.0],[603.0,2048.0],[533.0,707.0],[100.0,2.0]],[[251.0,283.0],[1478.0,1954.0],[196.0,317.0],[1882.0,1861.0]],[[72.0,1128.0],[1457.0,1837.0],[329.0,1421.0],[263.0,716.0]],[[725.0,17.0],[1616.0,793.0],[917.0,633.0],[1992.0,502.0]],[[1424.0,2010.0],[421.0,724.0],[2048.0,1265.0],[398.0,1228.0]],[[361.0,477.0],[1319.0,1807.0],[1181.0,1801.0],[1182.0,1798.0]],[[1890.0,612.0],[1244.0,1104.0],[317.0,1171.0],[138.0,1623.0]],[[532.0,2005.0],[1324.0,1074.0],[497.0,1185.0],[1784.0,908.0]],[[999.0,1599.0],[298.0,1647.0],[517.0,1039.0],[172.0,1038.0]],[[963.0,1388.0],[330.0,1058.0],[1562.0,427.0],[538.0,990.0]],[[1991.0,1327.0],[1893.0,1666.0],[332.0,1918.0],[147.0,1779.0]],[[813.0,1614.0],[1066.0,524.0],[545.0,1546.0],[226.0,73.0]],[[219.0,1805.0],[15.0,1417.0],[1824.0,1337.0],[760.0,856.0]],[[1805.0,877.0],[819.0,1594.0],[1359.0,1813.0],[1142.0,1123.0]],[[661.0,1229.0],[357.0,288.0],[1964.0,998.0],[391.0,2046.0]],[[491.0,1842.0],[683.0,462.0],[1330.0,1545.0],[918.0,392.0]],[[1846.0,936.0],[458.0,357.0],[1950.0,1031.0],[1238.0,81.0]],[[1366.0,1574.0],[999.0,1766.0],[625.0,1838.0],[278.0,1948.0]],[[1050.0,1677.0],[278.0,500.0],[1573.0,485.0],[1095.0,1549.0]],[[131.0,376.0],[1409.0,305.0],[1605.0,1924.0],[1963.0,643.0]],[[1638.0,173.0],[1070.0,1631.0],[1605.0,1578.0],[1853.0,63.0]],[[994.0,535.0],[300.0,2043.0],[1655.0,858.0],[439.0,1891.0]],[[804.0,1655.0],[1663.0,1780.0],[105.0,1149.0],[89.0,178.0]],[[1992.0,1713.0],[535.0,721.0],[774.0,1541.0],[1162.0,324.0]],[[173.0,1692.0],[598.0,1912.0],[651.0,1216.0],[162.0,1231.0]],[[1198.0,128.0],[1341.0,1203.0],[130.0,1997.0],[355.0,669.0]],[[1569.0,2019.0],[1080.0,1839.0],[92.0,1720.0],[143.0,1208.0]],[[201.0,1421.0],[817.0,1402.0],[740.0,1002.0],[566.0,372.0]],[[166.0,386.0],[632.0,1258.0],[1294.0,2019.0],[1941.0,87.0]],[[1577.0,1553.0],[960.0,582.0],[428.0,1708.0],[1580.0,916.0]],[[34.0,1295.0],[1679.0,1591.0],[894.0,543.0],[1790.0,723.0]],[[448.0,461.0],[1220.0,719.0],[1440.0,1935.0],[2038.0,657.0]],[[1094.0,982.0],[1081.0,288.0],[1332.0,1002.0],[899.0,1076.0]],[[661.0,536.0],[232.0,1895.0],[1460.0,528.0],[1017.0,1247.0]],[[169.0,1738.0],[1829.0,2018.0],[217.0,710.0],[1549.0,2041.0]],[[1280.0,1256.0],[1139.0,648.0],[1465.0,1509.0],[379.0,1758.0]],[[992.0,1488.0],[386.0,1443.0],[994.0,270.0],[1501.0,1272.0]],[[176.0,1450.0],[51.0,1577.0],[393.0,9.0],[9.0,733.0]],[[1892.0,446.0],[886.0,1528.0],[272.0,565.0],[1641.0,754.0]],[[1793.0,388.0],[1115.0,1962.0],[746.0,1533.0],[618.0,495.0]],[[546.0,318.0],[1622.0,660.0],[747.0,919.0],[1176.0,438.0]],[[201.0,891.0],[25.0,881.0],[51.0,1811.0],[785.0,1540.0]],[[1216.0,611.0],[1389.0,1523.0],[1551.0,443.0],[795.0,1389.0]],[[33.0,1730.0],[1828.0,791.0],[677.0,90.0],[1078.0,1918.0]],[[953.0,337.0],[266.0,880.0],[574.0,1018.0],[981.0,1478.0]],[[76.0,810.0],[1842.0,131.0],[404.0,713.0],[1683.0,526.0]],[[1989.0,940.0],[982.0,230.0],[1521.0,692.0],[668.0,1767.0]],[[1007.0,1101.0],[1418.0,831.0],[1209.0,969.0],[419.0,168.0]],[[1350.0,1252.0],[731.0,515.0],[1692.0,1301.0],[1164.0,95.0]],[[1014.0,117.0],[1302.0,1954.0],[207.0,838.0],[1635.0,405.0]],[[1802.0,1658.0],[2023.0,829.0],[1833.0,438.0],[788.0,718.0]],[[1055.0,1075.0],[30.0,275.0],[1582.0,75.0],[783.0,1363.0]],[[1122.0,840.0],[1957.0,606.0],[1852.0,169.0],[1557.0,1617.0]],[[1646.0,226.0],[247.0,1184.0],[1448.0,959.0],[804.0,1882.0]],[[1925.0,1922.0],[154.0,782.0],[482.0,1316.0],[1226.0,1753.0]],[[1019.0,643.0],[1135.0,1091.0],[1534.0,438.0],[1472.0,1740.0]],[[1736.0,1848.0],[1962.0,915.0],[402.0,724.0],[1848.0,1913.0]],[[233.0,419.0],[345.0,1642.0],[1633.0,1089.0],[783.0,2015.0]],[[1464.0,1539.0],[462.0,50.0],[972.0,2001.0],[1578.0,1077.0]],[[1092.0,349.0],[664.0,1613.0],[401.0,210.0],[868.0,1412.0]],[[737.0,712.0],[1190.0,472.0],[959.0,60.0],[1713.0,1180.0]],[[642.0,597.0],[546.0,1342.0],[779.0,503.0],[1369.0,2021.0]],[[827.0,1279.0],[160.0,781.0],[722.0,1352.0],[780.0,787.0]],[[1735.0,453.0],[1336.0,1103.0],[731.0,10.0],[1242.0,1567.0]],[[1580.0,1655.0],[260.0,1298.0],[1376.0,552.0],[1061.0,1096.0]],[[1807.0,654.0],[1888.0,784.0],[1571.0,1922.0],[382.0,1811.0]],[[498.0,765.0],[1052.0,1267.0],[1680.0,1205.0],[1223.0,816.0]],[[1462.0,533.0],[880.0,426.0],[1765.0,887.0],[1073.0,969.0]],[[540.0,278.0],[1381.0,213.0],[1826.0,1026.0],[239.0,235.0]],[[1006.0,150.0],[1450.0,380.0],[692.0,739.0],[784.0,768.0]],[[177.0,47.0],[1673.0,2023.0],[245.0,982.0],[984.0,442.0]],[[1331.0,1746.0],[723.0,131.0],[1582.0,1248.0],[1449.0,126.0]],[[1882.0,1398.0],[1581.0,1793.0],[2043.0,1939.0],[1455.0,670.0]],[[1790.0,249.0],[1346.0,1061.0],[196.0,127.0],[1573.0,630.0]],[[1945.0,804.0],[1597.0,1914.0],[731.0,927.0],[244.0,673.0]],[[1684.0,1856.0],[4.0,811.0],[190.0,1624.0],[301.0,1647.0]],[[23.0,579.0],[921.0,1636.0],[1389.0,852.0],[419.0,1593.0]],[[1297.0,134.0],[313.0,827.0],[1434.0,1441.0],[174.0,1750.0]],[[1252.0,1783.0],[1201.0,658.0],[691.0,549.0],[51.0,2.0]],[[1784.0,881.0],[909.0,1798.0],[393.0,30.0],[1787.0,652.0]],[[1179.0,1892.0],[761.0,1600.0],[786.0,1188.0],[1297.0,470.0]],[[484.0,485.0],[1981.0,210.0],[1573.0,1456.0],[226.0,432.0]],[[1900.0,1094.0],[238.0,1342.0],[1792.0,512.0],[1272.0,1876.0]],[[195.0,519.0],[1180.0,464.0],[500.0,333.0],[1754.0,1763.0]],[[351.0,1732.0],[1457.0,689.0],[2017.0,2045.0],[1698.0,1202.0]],[[1892.0,1913.0],[991.0,855.0],[788.0,540.0],[254.0,1134.0]],[[56.0,1809.0],[1837.0,718.0],[853.0,1184.0],[1239.0,595.0]],[[348.0,755.0],[369.0,682.0],[698.0,1668.0],[689.0,873.0]],[[1727.0,1035.0],[1389.0,628.0],[950.0,1698.0],[1344.0,46.0]],[[945.0,699.0],[1197.0,232.0],[458.0,924.0],[124.0,1746.0]],[[18.0,138.0],[713.0,77.0],[1800.0,1734.0],[600.0,1491.0]],[[1642.0,923.0],[2028.0,1144.0],[499.0,1180.0],[96.0,1201.0]],[[253.0,1172.0],[225.0,377.0],[1516.0,1458.0],[469.0,1844.0]],[[1124.0,140.0],[227.0,1118.0],[1387.0,1428.0],[1004.0,1149.0]],[[2007.0,1082.0],[276.0,939.0],[1672.0,1559.0],[1924.0,664.0]],[[1691.0,1877.0],[1779.0,907.0],[1870.0,335.0],[1616.0,1556.0]],[[772.0,822.0],[545.0,153.0],[585.0,1871.0],[1438.0,1443.0]],[[384.0,1038.0],[987.0,1309.0],[1268.0,72.0],[1045.0,1780.0]],[[1863.0,1087.0],[1395.0,340.0],[50.0,1100.0],[1743.0,633.0]],[[946.0,1521.0],[1577.0,20.0],[967.0,717.0],[909.0,490.0]],[[786.0,385.0],[790.0,945.0],[173.0,1695.0],[1400.0,590.0]],[[51.0,1909.0],[886.0,248.0],[140.0,409.0],[147.0,768.0]],[[1447.0,257.0],[1542.0,888.0],[1304.0,1602.0],[1192.0,702.0]],[[1196.0,1264.0],[1143.0,1484.0],[935.0,901.0],[489.0,1547.0]],[[582.0,1474.0],[1163.0,1440.0],[1459.0,215.0],[232.0,370.0]],[[1778.0,1388.0],[1460.0,986.0],[1249.0,1169.0],[1582.0,1321.0]],[[683.0,609.0],[410.0,621.0],[911.0,1239.0],[1780.0,1728.0]],[[1079.0,1498.0],[1265.0,1812.0],[1832.0,231.0],[1863.0,1680.0]],[[1.0,506.0],[1220.0,742.0],[298.0,461.0],[979.0,1486.0]],[[1835.0,1501.0],[1185.0,615.0],[1136.0,419.0],[528.0,2002.0]],[[1357.0,950.0],[1443.0,154.0],[228.0,481.0],[752.0,2035.0]],[[1863.0,382.0],[1663.0,250.0],[614.0,296.0],[1244.0,45.0]],[[1879.0,993.0],[945.0,884.0],[534.0,1662.0],[541.0,610.0]],[[641.0,1449.0],[229.0,1523.0],[120.0,2032.0],[1851.0,377.0]],[[143.0,1835.0],[562.0,1566.0],[1088.0,247.0],[155.0,155.0]],[[754.0,910.0],[1155.0,486.0],[1248.0,756.0],[146.0,438.0]],[[1959.0,608.0],[1041.0,472.0],[344.0,1347.0],[543.0,944.0]],[[931.0,1377.0],[1803.0,1427.0],[46.0,269.0],[1118.0,757.0]],[[59.0,1514.0],[1205.0,697.0],[46.0,2009.0],[686.0,1485.0]],[[1496.0,1758.0],[2046.0,1933.0],[1411.0,1672.0],[400.0,309.0]],[[404.0,937.0],[1330.0,845.0],[154.0,244.0],[1442.0,906.0]],[[1708.0,1543.0],[211.0,209.0],[1771.0,1137.0],[1535.0,299.0]],[[423.0,1345.0],[735.0,1425.0],[1590.0,1912.0],[650.0,717.0]],[[1717.0,1933.0],[774.0,108.0],[652.0,811.0],[751.0,331.0]],[[107.0,366.0],[781.0,1854.0],[1054.0,249.0],[1632.0,1104.0]],[[1727.0,970.0],[1851.0,508.0],[284.0,868.0],[851.0,891.0]],[[125.0,717.0],[1686.0,2002.0],[1800.0,1356.0],[728.0,784.0]],[[1722.0,380.0],[1561.0,1490.0],[1482.0,353.0],[1883.0,30.0]],[[802.0,1142.0],[1461.0,1471.0],[114.0,768.0],[1007.0,1741.0]],[[1329.0,1511.0],[1804.0,1895.0],[452.0,145.0],[857.0,1402.0]],[[316.0,1766.0],[1034.0,997.0],[237.0,1274.0],[385.0,1274.0]],[[604.0,1762.0],[1479.0,340.0],[1254.0,295.0],[1812.0,1958.0]],[[671.0,980.0],[4.0,121.0],[813.0,863.0],[1343.0,375.0]],[[1596.0,1680.0],[1549.0,1401.0],[1551.0,1793.0],[1153.0,1460.0]],[[779.0,573.0],[1220.0,388.0],[1996.0,1434.0],[1624.0,756.0]],[[135.0,347.0],[2016.0,245.0],[1608.0,633.0],[561.0,751.0]],[[282.0,1611.0],[791.0,1606.0],[1454.0,1696.0],[713.0,1666.0]],[[1124.0,956.0],[1535.0,33.0],[1199.0,1178.0],[1096.0,597.0]],[[843.0,1907.0],[159.0,1109.0],[470.0,359.0],[210.0,272.0]],[[2039.0,554.0],[1993.0,1892.0],[1595.0,925.0],[217.0,1700.0]],[[694.0,215.0],[1190.0,1860.0],[183.0,636.0],[781.0,852.0]],[[660.0,875.0],[517.0,77.0],[1539.0,70.0],[1659.0,1506.0]],[[1477.0,1366.0],[619.0,1319.0],[1321.0,1390.0],[240.0,1326.0]],[[1856.0,664.0],[380.0,61.0],[109.0,1996.0],[424.0,771.0]],[[1596.0,1686.0],[449.0,1074.0],[1787.0,179.0],[1880.0,886.0]],[[178.0,11.0],[1201.0,1722.0],[260.0,1371.0],[1414.0,1644.0]],[[252.0,1102.0],[539.0,838.0],[53.0,657.0],[1828.0,217.0]],[[1685.0,447.0],[133.0,689.0],[1887.0,266.0],[47.0,35.0]],[[577.0,924.0],[11.0,128.0],[962.0,1783.0],[441.0,1995.0]],[[1527.0,1367.0],[671.0,871.0],[1000.0,343.0],[891.0,676.0]],[[1233.0,379.0],[322.0,853.0],[529.0,308.0],[1842.0,1056.0]],[[1479.0,1012.0],[577.0,705.0],[979.0,1739.0],[305.0,1523.0]],[[711.0,246.0],[177.0,1143.0],[26.0,1955.0],[1704.0,786.0]],[[460.0,1444.0],[1372.0,1058.0],[674.0,1165.0],[1215.0,1996.0]],[[1327.0,1752.0],[455.0,196.0],[266.0,260.0],[1277.0,1724.0]],[[1582.0,1524.0],[1344.0,367.0],[601.0,1804.0],[1710.0,921.0]],[[1036.0,1697.0],[1377.0,1277.0],[708.0,171.0],[462.0,411.0]],[[1793.0,498.0],[1947.0,1429.0],[1128.0,489.0],[1287.0,1564.0]],[[498.0,673.0],[1836.0,363.0],[2040.0,1402.0],[508.0,1317.0]],[[400.0,404.0],[998.0,2028.0],[993.0,1990.0],[1380.0,181.0]],[[682.0,252.0],[63.0,1755.0],[1358.0,1248.0],[1007.0,1455.0]],[[598.0,289.0],[771.0,142.0],[721.0,1464.0],[1785.0,1079.0]],[[860.0,659.0],[858.0,1660.0],[758.0,716.0],[979.0,1903.0]],[[586.0,1154.0],[1327.0,659.0],[1308.0,1154.0],[986.0,799.0]],[[683.0,1154.0],[131.0,582.0],[533.0,105.0],[1787.0,213.0]],[[1434.0,1838.0],[593.0,1752.0],[884.0,642.0],[1467.0,713.0]],[[280.0,1073.0],[1521.0,1374.0],[198.0,1249.0],[637.0,1968.0]],[[212.0,1906.0],[1708.0,359.0],[74.0,33.0],[177.0,66.0]],[[118.0,881.0],[1512.0,834.0],[1845.0,181.0],[203.0,907.0]],[[1221.0,821.0],[732.0,790.0],[813.0,1521.0],[880.0,554.0]],[[409.0,1286.0],[656.0,1903.0],[2044.0,94.0],[1959.0,277.0]],[[53.0,1860.0],[1309.0,1470.0],[1416.0,1685.0],[586.0,508.0]],[[446.0,1895.0],[1332.0,681.0],[287.0,1577.0],[85.0,1818.0]],[[0.0,552.0],[1214.0,1151.0],[1244.0,244.0],[1949.0,1945.0]],[[251.0,611.0],[3.0,2036.0],[1686.0,151.0],[997.0,477.0]],[[1591.0,114.0],[1260.0,27.0],[92.0,987.0],[1577.0,1140.0]],[[1490.0,22.0],[873.0,1756.0],[874.0,1853.0],[202.0,529.0]],[[1107.0,139.0],[397.0,1623.0],[391.0,197.0],[2026.0,2006.0]],[[612.0,456.0],[2001.0,1026.0],[746.0,246.0],[443.0,1902.0]],[[293.0,750.0],[1381.0,1908.0],[643.0,1997.0],[1533.0,1053.0]],[[1218.0,1982.0],[705.0,1236.0],[119.0,722.0],[996.0,428.0]],[[1593.0,315.0],[496.0,1209.0],[404.0,1039.0],[904.0,710.0]],[[1480.0,438.0],[1841.0,407.0],[1322.0,271.0],[1828.0,1779.0]],[[357.0,458.0],[1916.0,1935.0],[1050.0,1561.0],[1905.0,1937.0]],[[1552.0,1571.0],[399.0,1540.0],[1367.0,42.0],[283.0,711.0]],[[2016.0,1763.0],[122.0,350.0],[1590.0,1352.0],[162.0,110.0]],[[3.0,1847.0],[717.0,1853.0],[1239.0,1664.0],[316.0,837.0]],[[1749.0,1303.0],[2015.0,1759.0],[1603.0,126.0],[418.0,700.0]],[[1659.0,634.0],[1043.0,881.0],[2026.0,563.0],[1407.0,422.0]],[[647.0,2018.0],[79.0,1274.0],[154.0,399.0],[1102.0,2018.0]],[[643.0,1683.0],[1029.0,1441.0],[1206.0,1326.0],[1037.0,760.0]],[[876.0,445.0],[640.0,1032.0],[495.0,828.0],[181.0,562.0]],[[1857.0,471.0],[1012.0,727.0],[1710.0,1727.0],[679.0,163.0]],[[1344.0,51.0],[1313.0,697.0],[604.0,1509.0],[1011.0,172.0]],[[1715.0,640.0],[1337.0,877.0],[997.0,1970.0],[1153.0,1105.0]],[[1975.0,916.0],[663.0,269.0],[1021.0,1862.0],[568.0,1540.0]],[[688.0,84.0],[385.0,233.0],[139.0,225.0],[2040.0,1901.0]],[[99.0,2016.0],[1074.0,1160.0],[1129.0,1561.0],[1960.0,487.0]],[[359.0,1272.0],[1545.0,1783.0],[806.0,963.0],[629.0,282.0]],[[1184.0,845.0],[414.0,1432.0],[1102.0,560.0],[905.0,1466.0]],[[1439.0,652.0],[424.0,429.0],[805.0,1243.0],[964.0,268.0]],[[168.0,1361.0],[1545.0,874.0],[1495.0,314.0],[1880.0,1915.0]],[[1359.0,1198.0],[1361.0,78.0],[352.0,527.0],[677.0,82.0]],[[108.0,1015.0],[836.0,1769.0],[1268.0,758.0],[437.0,1538.0]],[[36.0,807.0],[273.0,894.0],[654.0,1282.0],[834.0,1297.0]],[[938.0,1073.0],[1422.0,1605.0],[1300.0,200.0],[1864.0,819.0]],[[449.0,1889.0],[636.0,1596.0],[1544.0,849.0],[1285.0,1389.0]],[[975.0,2030.0],[1912.0,1633.0],[17.0,1908.0],[1440.0,1971.0]],[[1381.0,224.0],[1813.0,1607.0],[1948.0,1998.0],[1178.0,246.0]],[[1894.0,949.0],[383.0,1239.0],[667.0,1847.0],[864.0,1095.0]],[[666.0,1239.0],[1606.0,27.0],[771.0,1966.0],[56.0,1199.0]],[[1087.0,1063.0],[315.0,1598.0],[190.0,157.0],[803.0,1937.0]],[[885.0,1616.0],[1325.0,1224.0],[1994.0,1049.0],[1079.0,658.0]],[[1622.0,1655.0],[2047.0,924.0],[964.0,1665.0],[1830.0,307.0]],[[1586.0,230.0],[5.0,777.0],[1442.0,807.0],[432.0,154.0]],[[1932.0,782.0],[222.0,731.0],[1293.0,175.0],[1046.0,844.0]],[[782.0,1670.0],[265.0,735.0],[1047.0,184.0],[595.0,56.0]],[[242.0,883.0],[717.0,1342.0],[573.0,706.0],[1654.0,4.0]],[[11.0,1364.0],[109.0,881.0],[326.0,1974.0],[1900.0,303.0]],[[699.0,1105.0],[75.0,1695.0],[1193.0,820.0],[742.0,1309.0]],[[402.0,1192.0],[1242.0,820.0],[456.0,50.0],[1148.0,850.0]],[[886.0,963.0],[813.0,2041.0],[1300.0,1634.0],[1974.0,428.0]],[[1521.0,307.0],[1907.0,1033.0],[1948.0,244.0],[82.0,1361.0]],[[1959.0,43.0],[1009.0,514.0],[201.0,1616.0],[393.0,948.0]],[[216.0,1228.0],[1515.0,420.0],[394.0,1129.0],[1149.0,627.0]],[[964.0,639.0],[1955.0,228.0],[1686.0,1802.0],[123.0,50.0]],[[1356.0,1779.0],[1221.0,1998.0],[211.0,1807.0],[1303.0,1740.0]],[[104.0,690.0],[1150.0,1485.0],[985.0,277.0],[593.0,1308.0]],[[1618.0,1267.0],[1320.0,1503.0],[1998.0,577.0],[858.0,1704.0]],[[881.0,424.0],[332.0,703.0],[60.0,87.0],[339.0,1860.0]],[[300.0,760.0],[1470.0,709.0],[751.0,1706.0],[310.0,1892.0]],[[444.0,10.0],[1973.0,1494.0],[1653.0,589.0],[1490.0,569.0]],[[969.0,1595.0],[1337.0,773.0],[408.0,1264.0],[1803.0,846.0]],[[1859.0,622.0],[1049.0,219.0],[669.0,804.0],[2011.0,807.0]],[[174.0,1636.0],[1411.0,1956.0],[1701.0,906.0],[796.0,329.0]],[[63.0,637.0],[2027.0,883.0],[2035.0,1101.0],[1612.0,506.0]],[[286.0,401.0],[1420.0,690.0],[814.0,1751.0],[1268.0,1676.0]],[[1055.0,1004.0],[1544.0,1670.0],[139.0,163.0],[788.0,1524.0]],[[1661.0,1318.0],[1678.0,1132.0],[1851.0,1604.0],[719.0,527.0]],[[1762.0,1430.0],[1498.0,1528.0],[1781.0,140.0],[1507.0,506.0]],[[1368.0,219.0],[871.0,1467.0],[732.0,1173.0],[2044.0,712.0]],[[1732.0,1509.0],[1520.0,124.0],[682.0,749.0],[1470.0,1925.0]],[[1827.0,786.0],[501.0,1314.0],[67.0,1755.0],[911.0,1798.0]],[[1264.0,1721.0],[1129.0,325.0],[813.0,1854.0],[457.0,156.0]],[[19.0,918.0],[981.0,130.0],[2041.0,1358.0],[838.0,780.0]],[[455.0,116.0],[1226.0,1149.0],[387.0,546.0],[1518.0,1843.0]],[[1735.0,1348.0],[254.0,1244.0],[343.0,1899.0],[911.0,652.0]],[[859.0,1198.0],[1924.0,1174.0],[1148.0,405.0],[1039.0,660.0]],[[727.0,681.0],[1757.0,1236.0],[1626.0,1630.0],[949.0,686.0]],[[1687.0,702.0],[1352.0,999.0],[891.0,609.0],[1178.0,306.0]],[[308.0,980.0],[472.0,1248.0],[43.0,540.0],[1662.0,1620.0]],[[230.0,510.0],[215.0,539.0],[1906.0,1617.0],[1196.0,976.0]],[[651.0,1927.0],[958.0,922.0],[1029.0,1711.0],[1886.0,1152.0]],[[541.0,528.0],[132.0,535.0],[630.0,38.0],[1035.0,712.0]],[[140.0,1420.0],[1969.0,763.0],[949.0,1332.0],[755.0,864.0]],[[706.0,2019.0],[1013.0,513.0],[855.0,191.0],[1370.0,1010.0]],[[1656.0,1872.0],[1085.0,746.0],[479.0,180.0],[356.0,148.0]],[[1172.0,2040.0],[206.0,492.0],[1278.0,1519.0],[1416.0,979.0]],[[867.0,1050.0],[778.0,664.0],[1391.0,1142.0],[1323.0,1484.0]],[[151.0,319.0],[873.0,710.0],[1613.0,1875.0],[859.0,50.0]],[[1897.0,1624.0],[1548.0,1427.0],[1519.0,2017.0],[34.0,1033.0]],[[316.0,238.0],[1656.0,1666.0],[1530.0,1642.0],[757.0,1247.0]],[[800.0,367.0],[1244.0,121.0],[1739.0,158.0],[1875.0,23.0]],[[1653.0,831.0],[1949.0,1049.0],[97.0,857.0],[914.0,569.0]],[[1357.0,980.0],[1078.0,1356.0],[146.0,1577.0],[1187.0,71.0]],[[1916.0,105.0],[1741.0,64.0],[447.0,709.0],[1016.0,76.0]],[[1657.0,1822.0],[629.0,315.0],[879.0,782.0],[1707.0,1466.0]],[[1504.0,256.0],[902.0,804.0],[385.0,522.0],[1133.0,1420.0]],[[1341.0,1738.0],[1080.0,1689.0],[1455.0,933.0],[306.0,1861.0]],[[896.0,1132.0],[42.0,1304.0],[774.0,1471.0],[1246.0,1532.0]],[[807.0,1437.0],[1321.0,1097.0],[1666.0,367.0],[1544.0,780.0]],[[1838.0,806.0],[886.0,1333.0],[1962.0,1799.0],[20.0,197.0]],[[1227.0,517.0],[1594.0,290.0],[1202.0,525.0],[1321.0,1319.0]],[[1581.0,1948.0],[598.0,1052.0],[900.0,1009.0],[1544.0,1509.0]],[[204.0,1234.0],[1896.0,1409.0],[21.0,611.0],[1950.0,2040.0]],[[78.0,133.0],[1601.0,1784.0],[440.0,839.0],[1740.0,1523.0]],[[1764.0,1845.0],[1574.0,1740.0],[257.0,2044.0],[747.0,876.0]],[[761.0,408.0],[1739.0,1479.0],[900.0,736.0],[1577.0,1455.0]],[[1515.0,578.0],[652.0,956.0],[1051.0,1013.0],[292.0,324.0]],[[829.0,1789.0],[2015.0,156.0],[1316.0,901.0],[307.0,1759.0]],[[345.0,1307.0],[746.0,1956.0],[965.0,1449.0],[815.0,1160.0]],[[685.0,1855.0],[460.0,115.0],[418.0,1039.0],[1250.0,423.0]],[[1163.0,829.0],[1895.0,920.0],[116.0,1701.0],[303.0,1392.0]],[[1906.0,1850.0],[1850.0,915.0],[1771.0,1131.0],[1554.0,356.0]],[[1635.0,1624.0],[409.0,427.0],[1493.0,1446.0],[1438.0,1622.0]],[[1952.0,1994.0],[843.0,882.0],[577.0,847.0],[474.0,56.0]],[[754.0,1994.0],[1407.0,1031.0],[1273.0,366.0],[860.0,577.0]],[[1035.0,976.0],[392.0,1224.0],[1705.0,1318.0],[1460.0,635.0]],[[1880.0,932.0],[1281.0,849.0],[1346.0,525.0],[563.0,1618.0]],[[1154.0,151.0],[120.0,140.0],[1666.0,1503.0],[174.0,1889.0]],[[1866.0,1212.0],[1635.0,1655.0],[1353.0,1037.0],[1994.0,327.0]],[[82.0,612.0],[1294.0,264.0],[1474.0,223.0],[248.0,1570.0]],[[1318.0,884.0],[568.0,1755.0],[957.0,1160.0],[1395.0,19.0]],[[921.0,871.0],[1085.0,1656.0],[1231.0,1927.0],[1660.0,1997.0]],[[1909.0,1080.0],[69.0,1910.0],[1836.0,1863.0],[1744.0,892.0]],[[1499.0,1791.0],[696.0,714.0],[1872.0,1449.0],[94.0,881.0]],[[454.0,1530.0],[164.0,1837.0],[266.0,1332.0],[397.0,372.0]],[[1496.0,936.0],[371.0,1362.0],[528.0,996.0],[1439.0,960.0]],[[1095.0,1004.0],[1600.0,149.0],[59.0,1065.0],[1147.0,2041.0]],[[476.0,1992.0],[1687.0,1146.0],[396.0,252.0],[1408.0,1998.0]],[[1504.0,1082.0],[821.0,1755.0],[1567.0,695.0],[1510.0,286.0]],[[1823.0,1154.0],[1924.0,1508.0],[827.0,1351.0],[1575.0,1511.0]],[[697.0,1823.0],[1483.0,1026.0],[523.0,906.0],[653.0,1361.0]],[[9.0,508.0],[568.0,823.0],[538.0,204.0],[1564.0,575.0]],[[530.0,1391.0],[1935.0,1903.0],[393.0,64.0],[1592.0,599.0]],[[1552.0,353.0],[546.0,349.0],[1065.0,1214.0],[619.0,1367.0]],[[411.0,1814.0],[350.0,50.0],[791.0,1473.0],[1799.0,468.0]],[[773.0,70.0],[100.0,427.0],[1248.0,87.0],[1707.0,706.0]],[[1071.0,720.0],[191.0,94.0],[774.0,770.0],[708.0,495.0]],[[1472.0,197.0],[1264.0,452.0],[685.0,886.0],[0.0,206.0]],[[956.0,702.0],[1727.0,958.0],[578.0,20.0],[1913.0,2014.0]],[[129.0,604.0],[2041.0,1044.0],[1902.0,1457.0],[1385.0,1897.0]],[[1705.0,967.0],[1528.0,1908.0],[1963.0,2024.0],[26.0,768.0]],[[1361.0,784.0],[409.0,1371.0],[1909.0,184.0],[764.0,1070.0]],[[995.0,1834.0],[1771.0,524.0],[704.0,162.0],[1281.0,1979.0]],[[1220.0,1043.0],[1136.0,1543.0],[1002.0,917.0],[1406.0,1263.0]],[[1132.0,1305.0],[1559.0,1070.0],[995.0,340.0],[2031.0,678.0]],[[1526.0,652.0],[334.0,1809.0],[1953.0,1491.0],[1301.0,306.0]],[[885.0,909.0],[599.0,1454.0],[1404.0,702.0],[679.0,784.0]],[[837.0,845.0],[129.0,1698.0],[770.0,1882.0],[1680.0,1355.0]],[[118.0,1293.0],[733.0,516.0],[947.0,1713.0],[1994.0,709.0]],[[484.0,510.0],[401.0,65.0],[1908.0,730.0],[342.0,361.0]],[[572.0,52.0],[1671.0,1138.0],[780.0,1414.0],[1796.0,2002.0]],[[1898.0,2022.0],[1915.0,1071.0],[418.0,1378.0],[1394.0,260.0]],[[1870.0,1588.0],[1148.0,1615.0],[1358.0,278.0],[1238.0,560.0]],[[1063.0,81.0],[601.0,738.0],[767.0,1566.0],[511.0,1013.0]],[[1653.0,699.0],[1195.0,1417.0],[525.0,1630.0],[471.0,1557.0]],[[1484.0,935.0],[53.0,417.0],[870.0,1562.0],[320.0,119.0]],[[1503.0,1451.0],[1582.0,476.0],[567.0,678.0],[888.0,859.0]],[[1907.0,901.0],[742.0,1889.0],[1054.0,1982.0],[920.0,1603.0]],[[77.0,50.0],[507.0,711.0],[206.0,958.0],[1304.0,1292.0]],[[437.0,1710.0],[1935.0,568.0],[162.0,1116.0],[1463.0,859.0]],[[1404.0,2031.0],[560.0,1158.0],[1190.0,91.0],[1488.0,2027.0]]]cu2qu-1.6.7/tests/data/quadratic/000077500000000000000000000000001361726233700166265ustar00rootroot00000000000000cu2qu-1.6.7/tests/data/quadratic/A_.glif000066400000000000000000000054561361726233700200220ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/quadratic/E_acute.glif000066400000000000000000000046011361726233700210370ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/quadratic/a.glif000066400000000000000000000061761361726233700177230ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/quadratic/acute.glif000077500000000000000000000005161361726233700205770ustar00rootroot00000000000000 cu2qu-1.6.7/tests/data/quadratic/contents.plist000066400000000000000000000005651361726233700215460ustar00rootroot00000000000000 A A_.glif Eacute E_acute.glif a a.glif acute acute.glif cu2qu-1.6.7/tests/pens_test.py000066400000000000000000000313431361726233700163220ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import unittest from cu2qu.pens import Cu2QuPen, Cu2QuPointPen from . import CUBIC_GLYPHS, QUAD_GLYPHS from .utils import DummyGlyph, DummyPointGlyph from .utils import DummyPen, DummyPointPen from fontTools.misc.loggingTools import CapturingLogHandler from textwrap import dedent import logging MAX_ERR = 1.0 class _TestPenMixin(object): """Collection of tests that are shared by both the SegmentPen and the PointPen test cases, plus some helper methods. """ maxDiff = None def diff(self, expected, actual): import difflib expected = str(self.Glyph(expected)).splitlines(True) actual = str(self.Glyph(actual)).splitlines(True) diff = difflib.unified_diff( expected, actual, fromfile='expected', tofile='actual') return "".join(diff) def convert_glyph(self, glyph, **kwargs): # draw source glyph onto a new glyph using a Cu2Qu pen and return it converted = self.Glyph() pen = getattr(converted, self.pen_getter_name)() quadpen = self.Cu2QuPen(pen, MAX_ERR, **kwargs) getattr(glyph, self.draw_method_name)(quadpen) return converted def expect_glyph(self, source, expected): converted = self.convert_glyph(source) self.assertNotEqual(converted, source) if not converted.approx(expected): print(self.diff(expected, converted)) self.fail("converted glyph is different from expected") def test_convert_simple_glyph(self): self.expect_glyph(CUBIC_GLYPHS['a'], QUAD_GLYPHS['a']) self.expect_glyph(CUBIC_GLYPHS['A'], QUAD_GLYPHS['A']) def test_convert_composite_glyph(self): source = CUBIC_GLYPHS['Aacute'] converted = self.convert_glyph(source) # components don't change after quadratic conversion self.assertEqual(converted, source) def test_convert_mixed_glyph(self): # this contains a mix of contours and components self.expect_glyph(CUBIC_GLYPHS['Eacute'], QUAD_GLYPHS['Eacute']) def test_reverse_direction(self): for name in ('a', 'A', 'Eacute'): source = CUBIC_GLYPHS[name] normal_glyph = self.convert_glyph(source) reversed_glyph = self.convert_glyph(source, reverse_direction=True) # the number of commands is the same, just their order is iverted self.assertTrue( len(normal_glyph.outline), len(reversed_glyph.outline)) self.assertNotEqual(normal_glyph, reversed_glyph) def test_stats(self): stats = {} for name in CUBIC_GLYPHS.keys(): source = CUBIC_GLYPHS[name] self.convert_glyph(source, stats=stats) self.assertTrue(stats) self.assertTrue('1' in stats) self.assertEqual(type(stats['1']), int) def test_addComponent(self): pen = self.Pen() quadpen = self.Cu2QuPen(pen, MAX_ERR) quadpen.addComponent("a", (1, 2, 3, 4, 5.0, 6.0)) # components are passed through without changes self.assertEqual(str(pen).splitlines(), [ "pen.addComponent('a', (1, 2, 3, 4, 5.0, 6.0))", ]) class TestCu2QuPen(unittest.TestCase, _TestPenMixin): def __init__(self, *args, **kwargs): super(TestCu2QuPen, self).__init__(*args, **kwargs) self.Glyph = DummyGlyph self.Pen = DummyPen self.Cu2QuPen = Cu2QuPen self.pen_getter_name = 'getPen' self.draw_method_name = 'draw' def test__check_contour_is_open(self): msg = "moveTo is required" quadpen = Cu2QuPen(DummyPen(), MAX_ERR) with self.assertRaisesRegex(AssertionError, msg): quadpen.lineTo((0, 0)) with self.assertRaisesRegex(AssertionError, msg): quadpen.qCurveTo((0, 0), (1, 1)) with self.assertRaisesRegex(AssertionError, msg): quadpen.curveTo((0, 0), (1, 1), (2, 2)) with self.assertRaisesRegex(AssertionError, msg): quadpen.closePath() with self.assertRaisesRegex(AssertionError, msg): quadpen.endPath() quadpen.moveTo((0, 0)) # now it works quadpen.lineTo((1, 1)) quadpen.qCurveTo((2, 2), (3, 3)) quadpen.curveTo((4, 4), (5, 5), (6, 6)) quadpen.closePath() def test__check_contour_closed(self): msg = "closePath or endPath is required" quadpen = Cu2QuPen(DummyPen(), MAX_ERR) quadpen.moveTo((0, 0)) with self.assertRaisesRegex(AssertionError, msg): quadpen.moveTo((1, 1)) with self.assertRaisesRegex(AssertionError, msg): quadpen.addComponent("a", (1, 0, 0, 1, 0, 0)) # it works if contour is closed quadpen.closePath() quadpen.moveTo((1, 1)) quadpen.endPath() quadpen.addComponent("a", (1, 0, 0, 1, 0, 0)) def test_qCurveTo_no_points(self): quadpen = Cu2QuPen(DummyPen(), MAX_ERR) quadpen.moveTo((0, 0)) with self.assertRaisesRegex( AssertionError, "illegal qcurve segment point count: 0"): quadpen.qCurveTo() def test_qCurveTo_1_point(self): pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.moveTo((0, 0)) quadpen.qCurveTo((1, 1)) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.lineTo((1, 1))", ]) def test_qCurveTo_more_than_1_point(self): pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.moveTo((0, 0)) quadpen.qCurveTo((1, 1), (2, 2)) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.qCurveTo((1, 1), (2, 2))", ]) def test_curveTo_no_points(self): quadpen = Cu2QuPen(DummyPen(), MAX_ERR) quadpen.moveTo((0, 0)) with self.assertRaisesRegex( AssertionError, "illegal curve segment point count: 0"): quadpen.curveTo() def test_curveTo_1_point(self): pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.moveTo((0, 0)) quadpen.curveTo((1, 1)) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.lineTo((1, 1))", ]) def test_curveTo_2_points(self): pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.moveTo((0, 0)) quadpen.curveTo((1, 1), (2, 2)) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.qCurveTo((1, 1), (2, 2))", ]) def test_curveTo_3_points(self): pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.moveTo((0, 0)) quadpen.curveTo((1, 1), (2, 2), (3, 3)) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.qCurveTo((0.75, 0.75), (2.25, 2.25), (3, 3))", ]) def test_curveTo_more_than_3_points(self): # a 'SuperBezier' as described in fontTools.basePen.AbstractPen pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.moveTo((0, 0)) quadpen.curveTo((1, 1), (2, 2), (3, 3), (4, 4)) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.qCurveTo((0.75, 0.75), (1.625, 1.625), (2, 2))", "pen.qCurveTo((2.375, 2.375), (3.25, 3.25), (4, 4))", ]) def test_addComponent(self): pen = DummyPen() quadpen = Cu2QuPen(pen, MAX_ERR) quadpen.addComponent("a", (1, 2, 3, 4, 5.0, 6.0)) # components are passed through without changes self.assertEqual(str(pen).splitlines(), [ "pen.addComponent('a', (1, 2, 3, 4, 5.0, 6.0))", ]) def test_ignore_single_points(self): pen = DummyPen() try: logging.captureWarnings(True) with CapturingLogHandler("py.warnings", level="WARNING") as log: quadpen = Cu2QuPen(pen, MAX_ERR, ignore_single_points=True) finally: logging.captureWarnings(False) quadpen.moveTo((0, 0)) quadpen.endPath() quadpen.moveTo((1, 1)) quadpen.closePath() self.assertGreaterEqual(len(log.records), 1) self.assertIn("ignore_single_points is deprecated", log.records[0].args[0]) # single-point contours were ignored, so the pen commands are empty self.assertFalse(pen.commands) # redraw without ignoring single points quadpen.ignore_single_points = False quadpen.moveTo((0, 0)) quadpen.endPath() quadpen.moveTo((1, 1)) quadpen.closePath() self.assertTrue(pen.commands) self.assertEqual(str(pen).splitlines(), [ "pen.moveTo((0, 0))", "pen.endPath()", "pen.moveTo((1, 1))", "pen.closePath()" ]) class TestCu2QuPointPen(unittest.TestCase, _TestPenMixin): def __init__(self, *args, **kwargs): super(TestCu2QuPointPen, self).__init__(*args, **kwargs) self.Glyph = DummyPointGlyph self.Pen = DummyPointPen self.Cu2QuPen = Cu2QuPointPen self.pen_getter_name = 'getPointPen' self.draw_method_name = 'drawPoints' def test_super_bezier_curve(self): pen = DummyPointPen() quadpen = Cu2QuPointPen(pen, MAX_ERR) quadpen.beginPath() quadpen.addPoint((0, 0), segmentType="move") quadpen.addPoint((1, 1)) quadpen.addPoint((2, 2)) quadpen.addPoint((3, 3)) quadpen.addPoint( (4, 4), segmentType="curve", smooth=False, name="up", selected=1) quadpen.endPath() self.assertEqual(str(pen).splitlines(), """\ pen.beginPath() pen.addPoint((0, 0), name=None, segmentType='move', smooth=False) pen.addPoint((0.75, 0.75), name=None, segmentType=None, smooth=False) pen.addPoint((1.625, 1.625), name=None, segmentType=None, smooth=False) pen.addPoint((2, 2), name=None, segmentType='qcurve', smooth=True) pen.addPoint((2.375, 2.375), name=None, segmentType=None, smooth=False) pen.addPoint((3.25, 3.25), name=None, segmentType=None, smooth=False) pen.addPoint((4, 4), name='up', segmentType='qcurve', selected=1, smooth=False) pen.endPath()""".splitlines()) def test__flushContour_restore_starting_point(self): pen = DummyPointPen() quadpen = Cu2QuPointPen(pen, MAX_ERR) # collect the output of _flushContour before it's sent to _drawPoints new_segments = [] def _drawPoints(segments): new_segments.extend(segments) Cu2QuPointPen._drawPoints(quadpen, segments) quadpen._drawPoints = _drawPoints # a closed path (ie. no "move" segmentType) quadpen._flushContour([ ("curve", [ ((2, 2), False, None, {}), ((1, 1), False, None, {}), ((0, 0), False, None, {}), ]), ("curve", [ ((1, 1), False, None, {}), ((2, 2), False, None, {}), ((3, 3), False, None, {}), ]), ]) # the original starting point is restored: the last segment has become # the first self.assertEqual(new_segments[0][1][-1][0], (3, 3)) self.assertEqual(new_segments[-1][1][-1][0], (0, 0)) new_segments = [] # an open path (ie. starting with "move") quadpen._flushContour([ ("move", [ ((0, 0), False, None, {}), ]), ("curve", [ ((1, 1), False, None, {}), ((2, 2), False, None, {}), ((3, 3), False, None, {}), ]), ]) # the segment order stays the same before and after _flushContour self.assertEqual(new_segments[0][1][-1][0], (0, 0)) self.assertEqual(new_segments[-1][1][-1][0], (3, 3)) def test_quad_no_oncurve(self): """When passed a contour which has no on-curve points, the Cu2QuPointPen will treat it as a special quadratic contour whose first point has 'None' coordinates. """ self.maxDiff = None pen = DummyPointPen() quadpen = Cu2QuPointPen(pen, MAX_ERR) quadpen.beginPath() quadpen.addPoint((1, 1)) quadpen.addPoint((2, 2)) quadpen.addPoint((3, 3)) quadpen.endPath() self.assertEqual( str(pen), dedent( """\ pen.beginPath() pen.addPoint((1, 1), name=None, segmentType=None, smooth=False) pen.addPoint((2, 2), name=None, segmentType=None, smooth=False) pen.addPoint((3, 3), name=None, segmentType=None, smooth=False) pen.endPath()""" ) ) if __name__ == "__main__": unittest.main() cu2qu-1.6.7/tests/ufo_test.py000066400000000000000000000222531361726233700161460ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import os from fontTools.misc.loggingTools import CapturingLogHandler from defcon import Font, Glyph from cu2qu.ufo import ( fonts_to_quadratic, font_to_quadratic, glyphs_to_quadratic, glyph_to_quadratic, logger, CURVE_TYPE_LIB_KEY, ) from cu2qu.errors import ( IncompatibleSegmentNumberError, IncompatibleSegmentTypesError, IncompatibleFontsError, ) from . import DATADIR import pytest TEST_UFOS = [ os.path.join(DATADIR, "RobotoSubset-Regular.ufo"), os.path.join(DATADIR, "RobotoSubset-Bold.ufo"), ] @pytest.fixture def fonts(): return [Font(ufo) for ufo in TEST_UFOS] class FontsToQuadraticTest(object): def test_modified(self, fonts): modified = fonts_to_quadratic(fonts) assert modified def test_stats(self, fonts): stats = {} fonts_to_quadratic(fonts, stats=stats) assert stats == {'1': 1, '2': 79, '3': 130, '4': 2} def test_dump_stats(self, fonts): with CapturingLogHandler(logger, "INFO") as captor: fonts_to_quadratic(fonts, dump_stats=True) assert captor.assertRegex("New spline lengths:") def test_remember_curve_type(self, fonts): fonts_to_quadratic(fonts, remember_curve_type=True) assert fonts[0].lib[CURVE_TYPE_LIB_KEY] == "quadratic" with CapturingLogHandler(logger, "INFO") as captor: fonts_to_quadratic(fonts, remember_curve_type=True) assert captor.assertRegex("already converted") def test_no_remember_curve_type(self, fonts): assert CURVE_TYPE_LIB_KEY not in fonts[0].lib fonts_to_quadratic(fonts, remember_curve_type=False) assert CURVE_TYPE_LIB_KEY not in fonts[0].lib def test_different_glyphsets(self, fonts): del fonts[0]['a'] assert 'a' not in fonts[0] assert 'a' in fonts[1] assert fonts_to_quadratic(fonts) def test_max_err_em_float(self, fonts): stats = {} fonts_to_quadratic(fonts, max_err_em=0.002, stats=stats) assert stats == {'1': 5, '2': 193, '3': 14} def test_max_err_em_list(self, fonts): stats = {} fonts_to_quadratic(fonts, max_err_em=[0.002, 0.002], stats=stats) assert stats == {'1': 5, '2': 193, '3': 14} def test_max_err_float(self, fonts): stats = {} fonts_to_quadratic(fonts, max_err=4.096, stats=stats) assert stats == {'1': 5, '2': 193, '3': 14} def test_max_err_list(self, fonts): stats = {} fonts_to_quadratic(fonts, max_err=[4.096, 4.096], stats=stats) assert stats == {'1': 5, '2': 193, '3': 14} def test_both_max_err_and_max_err_em(self, fonts): with pytest.raises(TypeError, match="Only one .* can be specified"): fonts_to_quadratic(fonts, max_err=1.000, max_err_em=0.001) def test_single_font(self, fonts): assert font_to_quadratic(fonts[0], max_err_em=0.002, reverse_direction=True) class GlyphsToQuadraticTest(object): @pytest.mark.parametrize( ["glyph", "expected"], [('A', False), # contains no curves, it is not modified ('a', True)], ids=['lines-only', 'has-curves'] ) def test_modified(self, fonts, glyph, expected): glyphs = [f[glyph] for f in fonts] assert glyphs_to_quadratic(glyphs) == expected def test_stats(self, fonts): stats = {} glyphs_to_quadratic([f['a'] for f in fonts], stats=stats) assert stats == {'2': 1, '3': 7, '4': 3, '5': 1} def test_max_err_float(self, fonts): glyphs = [f['a'] for f in fonts] stats = {} glyphs_to_quadratic(glyphs, max_err=4.096, stats=stats) assert stats == {'2': 11, '3': 1} def test_max_err_list(self, fonts): glyphs = [f['a'] for f in fonts] stats = {} glyphs_to_quadratic(glyphs, max_err=[4.096, 4.096], stats=stats) assert stats == {'2': 11, '3': 1} def test_reverse_direction(self, fonts): glyphs = [f['A'] for f in fonts] assert glyphs_to_quadratic(glyphs, reverse_direction=True) def test_single_glyph(self, fonts): assert glyph_to_quadratic(fonts[0]['a'], max_err=4.096, reverse_direction=True) @pytest.mark.parametrize( ["outlines", "exception", "message"], [ [ [ [ ('moveTo', ((0, 0),)), ('curveTo', ((1, 1), (2, 2), (3, 3))), ('curveTo', ((4, 4), (5, 5), (6, 6))), ('closePath', ()), ], [ ('moveTo', ((7, 7),)), ('curveTo', ((8, 8), (9, 9), (10, 10))), ('closePath', ()), ] ], IncompatibleSegmentNumberError, "have different number of segments", ], [ [ [ ('moveTo', ((0, 0),)), ('curveTo', ((1, 1), (2, 2), (3, 3))), ('closePath', ()), ], [ ('moveTo', ((4, 4),)), ('lineTo', ((5, 5),)), ('closePath', ()), ], ], IncompatibleSegmentTypesError, "have incompatible segment types", ], ], ids=[ "unequal-length", "different-segment-types", ] ) def test_incompatible_glyphs(self, outlines, exception, message): glyphs = [] for i, outline in enumerate(outlines): glyph = Glyph() glyph.name = "glyph%d" % i pen = glyph.getPen() for operator, args in outline: getattr(pen, operator)(*args) glyphs.append(glyph) with pytest.raises(exception) as excinfo: glyphs_to_quadratic(glyphs) assert excinfo.match(message) def test_incompatible_fonts(self): font1 = Font() font1.info.unitsPerEm = 1000 glyph1 = font1.newGlyph("a") pen1 = glyph1.getPen() for operator, args in [("moveTo", ((0, 0),)), ("lineTo", ((1, 1),)), ("endPath", ())]: getattr(pen1, operator)(*args) font2 = Font() font2.info.unitsPerEm = 1000 glyph2 = font2.newGlyph("a") pen2 = glyph2.getPen() for operator, args in [("moveTo", ((0, 0),)), ("curveTo", ((1, 1), (2, 2), (3, 3))), ("endPath", ())]: getattr(pen2, operator)(*args) with pytest.raises(IncompatibleFontsError) as excinfo: fonts_to_quadratic([font1, font2]) assert excinfo.match("fonts contains incompatible glyphs: 'a'") assert hasattr(excinfo.value, "glyph_errors") error = excinfo.value.glyph_errors['a'] assert isinstance(error, IncompatibleSegmentTypesError) assert error.segments == {1: ["line", "curve"]} def test_already_quadratic(self): glyph = Glyph() pen = glyph.getPen() pen.moveTo((0, 0)) pen.qCurveTo((1, 1), (2, 2)) pen.closePath() assert not glyph_to_quadratic(glyph) def test_open_paths(self): glyph = Glyph() pen = glyph.getPen() pen.moveTo((0, 0)) pen.lineTo((1, 1)) pen.curveTo((2, 2), (3, 3), (4, 4)) pen.endPath() assert glyph_to_quadratic(glyph) # open contour is still open assert glyph[-1][0].segmentType == "move" def test_ignore_components(self): glyph = Glyph() pen = glyph.getPen() pen.addComponent('a', (1, 0, 0, 1, 0, 0)) pen.moveTo((0, 0)) pen.curveTo((1, 1), (2, 2), (3, 3)) pen.closePath() assert glyph_to_quadratic(glyph) assert len(glyph.components) == 1 def test_overlapping_start_end_points(self): # https://github.com/googlefonts/fontmake/issues/572 glyph1 = Glyph() pen = glyph1.getPointPen() pen.beginPath() pen.addPoint((0, 651), segmentType="line") pen.addPoint((0, 101), segmentType="line") pen.addPoint((0, 101), segmentType="line") pen.addPoint((0, 651), segmentType="line") pen.endPath() glyph2 = Glyph() pen = glyph2.getPointPen() pen.beginPath() pen.addPoint((1, 651), segmentType="line") pen.addPoint((2, 101), segmentType="line") pen.addPoint((3, 101), segmentType="line") pen.addPoint((4, 651), segmentType="line") pen.endPath() glyphs = [glyph1, glyph2] assert glyphs_to_quadratic(glyphs, reverse_direction=True) assert [[(p.x, p.y) for p in glyph[0]] for glyph in glyphs] == [ [ (0, 651), (0, 651), (0, 101), (0, 101), ], [ (1, 651), (4, 651), (3, 101), (2, 101) ], ] cu2qu-1.6.7/tests/utils.py000066400000000000000000000215371361726233700154620ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import from . import CUBIC_GLYPHS from fontTools.pens.pointPen import PointToSegmentPen, SegmentToPointPen from fontTools.misc.py23 import isclose import unittest class BaseDummyPen(object): """Base class for pens that record the commands they are called with.""" def __init__(self, *args, **kwargs): self.commands = [] def __str__(self): """Return the pen commands as a string of python code.""" return _repr_pen_commands(self.commands) def addComponent(self, glyphName, transformation, **kwargs): self.commands.append(('addComponent', (glyphName, transformation), kwargs)) class DummyPen(BaseDummyPen): """A SegmentPen that records the commands it's called with.""" def moveTo(self, pt): self.commands.append(('moveTo', (pt,), {})) def lineTo(self, pt): self.commands.append(('lineTo', (pt,), {})) def curveTo(self, *points): self.commands.append(('curveTo', points, {})) def qCurveTo(self, *points): self.commands.append(('qCurveTo', points, {})) def closePath(self): self.commands.append(('closePath', tuple(), {})) def endPath(self): self.commands.append(('endPath', tuple(), {})) class DummyPointPen(BaseDummyPen): """A PointPen that records the commands it's called with.""" def beginPath(self, **kwargs): self.commands.append(('beginPath', tuple(), kwargs)) def endPath(self): self.commands.append(('endPath', tuple(), {})) def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs): kwargs['segmentType'] = str(segmentType) if segmentType else None kwargs['smooth'] = smooth kwargs['name'] = name self.commands.append(('addPoint', (pt,), kwargs)) class DummyGlyph(object): """Provides a minimal interface for storing a glyph's outline data in a SegmentPen-oriented way. The glyph's outline consists in the list of SegmentPen commands required to draw it. """ # the SegmentPen class used to draw on this glyph type DrawingPen = DummyPen def __init__(self, glyph=None): """If another glyph (i.e. any object having a 'draw' method) is given, its outline data is copied to self. """ self._pen = self.DrawingPen() self.outline = self._pen.commands if glyph: self.appendGlyph(glyph) def appendGlyph(self, glyph): """Copy another glyph's outline onto self.""" glyph.draw(self._pen) def getPen(self): """Return the SegmentPen that can 'draw' on this glyph.""" return self._pen def getPointPen(self): """Return a PointPen adapter that can 'draw' on this glyph.""" return PointToSegmentPen(self._pen) def draw(self, pen): """Use another SegmentPen to replay the glyph's outline commands.""" if self.outline: for cmd, args, kwargs in self.outline: getattr(pen, cmd)(*args, **kwargs) def drawPoints(self, pointPen): """Use another PointPen to replay the glyph's outline commands, indirectly through an adapter. """ pen = SegmentToPointPen(pointPen) self.draw(pen) def __eq__(self, other): """Return True if 'other' glyph's outline is the same as self.""" if hasattr(other, 'outline'): return self.outline == other.outline elif hasattr(other, 'draw'): return self.outline == self.__class__(other).outline return NotImplemented def __ne__(self, other): """Return True if 'other' glyph's outline is different from self.""" return not (self == other) def approx(self, other, rel_tol=1e-12): if hasattr(other, 'outline'): outline2 == other.outline elif hasattr(other, 'draw'): outline2 = self.__class__(other).outline else: raise TypeError(type(other).__name__) outline1 = self.outline if len(outline1) != len(outline2): return False for (cmd1, arg1, kwd1), (cmd2, arg2, kwd2) in zip(outline1, outline2): if cmd1 != cmd2: return False if kwd1 != kwd2: return False if arg1: if isinstance(arg1[0], tuple): if not arg2 or not isinstance(arg2[0], tuple): return False for (x1, y1), (x2, y2) in zip(arg1, arg2): if ( not isclose(x1, x2, rel_tol=rel_tol) or not isclose(y1, y2, rel_tol=rel_tol) ): return False elif arg1 != arg2: return False elif arg2: return False return True def __str__(self): """Return commands making up the glyph's outline as a string.""" return str(self._pen) class DummyPointGlyph(DummyGlyph): """Provides a minimal interface for storing a glyph's outline data in a PointPen-oriented way. The glyph's outline consists in the list of PointPen commands required to draw it. """ # the PointPen class used to draw on this glyph type DrawingPen = DummyPointPen def appendGlyph(self, glyph): """Copy another glyph's outline onto self.""" glyph.drawPoints(self._pen) def getPen(self): """Return a SegmentPen adapter that can 'draw' on this glyph.""" return SegmentToPointPen(self._pen) def getPointPen(self): """Return the PointPen that can 'draw' on this glyph.""" return self._pen def draw(self, pen): """Use another SegmentPen to replay the glyph's outline commands, indirectly through an adapter. """ pointPen = PointToSegmentPen(pen) self.drawPoints(pointPen) def drawPoints(self, pointPen): """Use another PointPen to replay the glyph's outline commands.""" if self.outline: for cmd, args, kwargs in self.outline: getattr(pointPen, cmd)(*args, **kwargs) def _repr_pen_commands(commands): """ >>> print(_repr_pen_commands([ ... ('moveTo', tuple(), {}), ... ('lineTo', ((1.0, 0.1),), {}), ... ('curveTo', ((1.0, 0.1), (2.0, 0.2), (3.0, 0.3)), {}) ... ])) pen.moveTo() pen.lineTo((1, 0.1)) pen.curveTo((1, 0.1), (2, 0.2), (3, 0.3)) >>> print(_repr_pen_commands([ ... ('beginPath', tuple(), {}), ... ('addPoint', ((1.0, 0.1),), ... {"segmentType":"line", "smooth":True, "name":"test", "z":1}), ... ])) pen.beginPath() pen.addPoint((1, 0.1), name='test', segmentType='line', smooth=True, z=1) >>> print(_repr_pen_commands([ ... ('addComponent', ('A', (1, 0, 0, 1, 0, 0)), {}) ... ])) pen.addComponent('A', (1, 0, 0, 1, 0, 0)) """ s = [] for cmd, args, kwargs in commands: if args: if isinstance(args[0], tuple): # cast float to int if there're no digits after decimal point, # and round floats to 12 decimal digits (more than enough) args = [ tuple((int(v) if int(v) == v else round(v, 12)) for v in pt) for pt in args ] args = ", ".join(repr(a) for a in args) if kwargs: kwargs = ", ".join("%s=%r" % (k, v) for k, v in sorted(kwargs.items())) if args and kwargs: s.append("pen.%s(%s, %s)" % (cmd, args, kwargs)) elif args: s.append("pen.%s(%s)" % (cmd, args)) elif kwargs: s.append("pen.%s(%s)" % (cmd, kwargs)) else: s.append("pen.%s()" % cmd) return "\n".join(s) class TestDummyGlyph(unittest.TestCase): def test_equal(self): # verify that the copy and the copy of the copy are equal to # the source glyph's outline, as well as to each other source = CUBIC_GLYPHS['a'] copy = DummyGlyph(source) copy2 = DummyGlyph(copy) self.assertEqual(source, copy) self.assertEqual(source, copy2) self.assertEqual(copy, copy2) # assert equality doesn't hold any more after modification copy.outline.pop() self.assertNotEqual(source, copy) self.assertNotEqual(copy, copy2) class TestDummyPointGlyph(unittest.TestCase): def test_equal(self): # same as above but using the PointPen protocol source = CUBIC_GLYPHS['a'] copy = DummyPointGlyph(source) copy2 = DummyPointGlyph(copy) self.assertEqual(source, copy) self.assertEqual(source, copy2) self.assertEqual(copy, copy2) copy.outline.pop() self.assertNotEqual(source, copy) self.assertNotEqual(copy, copy2) if __name__ == "__main__": unittest.main() cu2qu-1.6.7/tools/000077500000000000000000000000001361726233700137365ustar00rootroot00000000000000cu2qu-1.6.7/tools/benchmark.py000066400000000000000000000040541361726233700162450ustar00rootroot00000000000000# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function, division, absolute_import import random import timeit MAX_ERR = 5 SETUP_CODE = ''' from %(module)s import %(function)s from %(benchmark_module)s import %(setup_function)s args = %(setup_function)s() ''' def generate_curve(): return [ tuple(float(random.randint(0, 2048)) for coord in range(2)) for point in range(4)] def setup_curve_to_quadratic(): return generate_curve(), MAX_ERR def setup_curves_to_quadratic(): num_curves = 3 return ( [generate_curve() for curve in range(num_curves)], [MAX_ERR] * num_curves) def run_benchmark( benchmark_module, module, function, setup_suffix='', repeat=1000): setup_func = 'setup_' + function if setup_suffix: print('%s with %s:' % (function, setup_suffix), end='') setup_func += '_' + setup_suffix else: print('%s:' % function, end='') results = timeit.repeat( '%s(*args)' % function, setup=(SETUP_CODE % { 'benchmark_module': benchmark_module, 'setup_function': setup_func, 'module': module, 'function': function}), repeat=repeat, number=1) print('\tavg=%dus' % (sum(results) / len(results) * 1000000.), '\tmin=%dus' % (min(results) * 1000000.)) def main(): run_benchmark('benchmark', 'cu2qu', 'curve_to_quadratic') run_benchmark('benchmark', 'cu2qu', 'curves_to_quadratic') if __name__ == '__main__': random.seed(1) main() cu2qu-1.6.7/tools/ufo_benchmark.py000066400000000000000000000022471361726233700171200ustar00rootroot00000000000000# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function, division, absolute_import import os import random from benchmark import run_benchmark MAX_ERR_EM = 0.002 DATADIR = os.path.join( os.path.dirname(__file__), os.path.pardir, 'tests', 'data') def setup_fonts_to_quadratic_defcon(): from defcon import Font return [[Font(os.path.join(DATADIR, 'RobotoSubset-Regular.ufo'))], MAX_ERR_EM] def main(): run_benchmark( 'ufo_benchmark', 'cu2qu.ufo', 'fonts_to_quadratic', setup_suffix='defcon', repeat=10) if __name__ == '__main__': random.seed(1) main() cu2qu-1.6.7/tools/update_cython_shadow.py000066400000000000000000000013401361726233700205210ustar00rootroot00000000000000""" Update the embedded Lib/cu2qu/cython.py module with the contents of the latest cython repository. Usage: $ python tools/update_cython_shadow.py 0.28.5 """ import requests import sys header = b'''\ """ This module is copied verbatim from the "Cython.Shadow" module: https://github.com/cython/cython/blob/master/Cython/Shadow.py Cython is licensed under the Apache 2.0 Software License. """ ''' try: version = sys.argv[1] except IndexError: version = "master" CYTHON_SHADOW_URL = ( "https://raw.githubusercontent.com/cython/cython/%s/Cython/Shadow.py" ) % version r = requests.get(CYTHON_SHADOW_URL, allow_redirects=True) with open("Lib/cu2qu/cython.py", "wb") as f: f.write(header) f.write(r.content) cu2qu-1.6.7/tox.ini000066400000000000000000000047321361726233700141170ustar00rootroot00000000000000[tox] envlist = py{27,37}-{cy,nocy}, htmlcov package_name = cu2qu ; we skip tox's own sdist generation as we need to pass different environment ; variables for testing buiding with and without cython skipsdist = true [testenv] setenv = nocy: CU2QU_WITH_CYTHON=0 cy: CU2QU_WITH_CYTHON=1 cy: CYTHON_TRACE=1 cy: CYTHON_ANNOTATE=1 ; download the latest pip, setuptools and wheel when creating the venv download = true deps = -rtest-requirements.txt -rrequirements.txt cy: cython changedir = {toxinidir} commands = # create source distribution in a temp dir python setup.py --quiet sdist --dist-dir {envtmpdir} # install from sdist python -m pip install --no-build-isolation --ignore-installed --pre --no-deps --no-cache-dir --find-links {envtmpdir} {[tox]package_name} # ensure we are running the requested cu2qu version (compiled vs interpreted) nocy: python -c "import sys, cu2qu.cu2qu; cu2qu.cu2qu.COMPILED and sys.exit(1)" cy: python -c "import sys, cu2qu.cu2qu; cu2qu.cu2qu.COMPILED or sys.exit(1)" # run tests with code coverage enabled coverage run --parallel-mode -m pytest {posargs} [testenv:htmlcov] deps = coverage changedir = {toxinidir} commands = coverage combine coverage report coverage html [testenv:codecov] passenv = * deps = coverage codecov ignore_outcome = true changedir = {toxinidir} commands = coverage combine codecov --env TRAVIS_PYTHON_VERSION [testenv:update-cython] deps = requests changedir = {toxinidir} commands = python tools/update_cython_shadow.py {posargs} [testenv:sdist] deps = setuptools cython changedir = {toxinidir} commands = python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)' python setup.py --with-cython sdist --dist-dir dist [testenv:pure-wheel] deps = {[testenv:sdist]deps} pip wheel setenv = CU2QU_WITH_CYTHON=0 changedir = {toxinidir} commands = {[testenv:sdist]commands} pip wheel --pre --no-deps --no-cache-dir --wheel-dir dist --find-links dist \ --no-binary {[tox]package_name} {[tox]package_name} [testenv:native-wheel] deps = {[testenv:pure-wheel]deps} setenv = CU2QU_WITH_CYTHON=1 changedir = {toxinidir} commands = {[testenv:pure-wheel]commands} ; we only upload the source distribution to PyPI (for now) [testenv:pypi] deps = {[testenv:sdist]deps} twine passenv = TWINE_USERNAME TWINE_PASSWORD changedir = {toxinidir} commands = {[testenv:sdist]commands} twine upload dist/*.zip