vttcompilepy 0.0.1.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vttcompilepy might be problematic. Click here for more details.

Files changed (37) hide show
  1. vttcompilepy-0.0.1.11/PKG-INFO +62 -0
  2. vttcompilepy-0.0.1.11/README.md +75 -0
  3. vttcompilepy-0.0.1.11/pyproject.toml +16 -0
  4. vttcompilepy-0.0.1.11/setup.cfg +11 -0
  5. vttcompilepy-0.0.1.11/setup.py +92 -0
  6. vttcompilepy-0.0.1.11/src/CvtManager.cpp +1763 -0
  7. vttcompilepy-0.0.1.11/src/File.cpp +177 -0
  8. vttcompilepy-0.0.1.11/src/List.cpp +169 -0
  9. vttcompilepy-0.0.1.11/src/MathUtils.cpp +280 -0
  10. vttcompilepy-0.0.1.11/src/Memory.cpp +19 -0
  11. vttcompilepy-0.0.1.11/src/Platform.cpp +36 -0
  12. vttcompilepy-0.0.1.11/src/TMTParser.cpp +2321 -0
  13. vttcompilepy-0.0.1.11/src/TTAssembler.cpp +4280 -0
  14. vttcompilepy-0.0.1.11/src/TTEngine.cpp +1579 -0
  15. vttcompilepy-0.0.1.11/src/TTFont.cpp +5256 -0
  16. vttcompilepy-0.0.1.11/src/TTGenerator.cpp +2612 -0
  17. vttcompilepy-0.0.1.11/src/TextBuffer.cpp +369 -0
  18. vttcompilepy-0.0.1.11/src/Variation.cpp +187 -0
  19. vttcompilepy-0.0.1.11/src/VariationInstance.cpp +149 -0
  20. vttcompilepy-0.0.1.11/src/VariationModels.cpp +414 -0
  21. vttcompilepy-0.0.1.11/src/application.cpp +585 -0
  22. vttcompilepy-0.0.1.11/src/application.h +47 -0
  23. vttcompilepy-0.0.1.11/src/pch.h +68 -0
  24. vttcompilepy-0.0.1.11/src/ttiua.cpp +406 -0
  25. vttcompilepy-0.0.1.11/tests/test_vttcompile.py +163 -0
  26. vttcompilepy-0.0.1.11/vttcompilepy/__init__.py +6 -0
  27. vttcompilepy-0.0.1.11/vttcompilepy/__main__.py +71 -0
  28. vttcompilepy-0.0.1.11/vttcompilepy/_version.py +1 -0
  29. vttcompilepy-0.0.1.11/vttcompilepy/quit_to_glyphs.py +115 -0
  30. vttcompilepy-0.0.1.11/vttcompilepy/vttcompilepy.cpp +14442 -0
  31. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/PKG-INFO +62 -0
  32. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/SOURCES.txt +36 -0
  33. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/dependency_links.txt +1 -0
  34. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/entry_points.txt +3 -0
  35. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/not-zip-safe +1 -0
  36. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/requires.txt +1 -0
  37. vttcompilepy-0.0.1.11/vttcompilepy.egg-info/top_level.txt +1 -0
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.2
2
+ Name: vttcompilepy
3
+ Version: 0.0.1.11
4
+ Summary: Python extension for Visual TrueType font compile.
5
+ Home-page: https://github.com/microsoft/VisualTrueType
6
+ Author: Paul Linnerud
7
+ Author-email: paulli@microsoft.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Requires-Python: >=3.7
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: fonttools>=4.33.0
14
+ Dynamic: author
15
+ Dynamic: author-email
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: license
21
+ Dynamic: requires-dist
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # Project
26
+
27
+ VTTCompilePy is a Python extension built using Cython. It provides streamlined bindings for
28
+ various compilers from Visual TrueType.
29
+
30
+ VTTCompilePy was developed to support a Python based font development environment. In addition to the Python interface,
31
+ a command line interface is also installed. Usage is available with "vttcompilepy --help".
32
+
33
+ ### Example
34
+
35
+ ```python
36
+ import sys
37
+ from pathlib import Path
38
+ import vttcompilepy as vtt
39
+
40
+ TESTDATA = Path(__file__).parent / "data"
41
+ IN_PATH = TESTDATA / "selawik-variable.ttf"
42
+ OUT_PATH = TESTDATA / "out.ttf"
43
+
44
+ print(bytes(IN_PATH))
45
+
46
+ print('VTTCompilePy Test Client')
47
+
48
+ compiler = vtt.Compiler(IN_PATH)
49
+
50
+ compiler.compile_all()
51
+
52
+ compiler.save_font(OUT_PATH, vtt.StripLevel.STRIP_NOTHING)
53
+
54
+ ```
55
+
56
+ ## Trademarks
57
+
58
+ This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
59
+ trademarks or logos is subject to and must follow
60
+ [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
61
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
62
+ Any use of third-party trademarks or logos are subject to those third-party's policies.
@@ -0,0 +1,75 @@
1
+ # Project
2
+
3
+ Microsoft Visual TrueType(VTT) is a professional-level tool for graphically instructing TrueType and OpenType fonts.
4
+ For details on the tool visit https://docs.microsoft.com/en-us/typography/tools/vtt/.
5
+
6
+ Visual TrueType compiles binary from source formats included in the fonts that are instructed with Visual TrueType.
7
+
8
+ This repo contains the source for the compilers of Visual TrueType. The compilers can compile the high level VTT Talk source
9
+ to a lower level assembler source and then can assemble that source to corresponding binaries. Since VTT can also generate
10
+ variation 'cvar' data for variable fonts, the compilers can also produce 'cvar' data from a source format. File management
11
+ functions are included to prepare a font for production and to strip source formats for a final 'ship' font binary.
12
+
13
+ The source in this repo can be compiled and used in two different ways.
14
+
15
+ First is VTTCompile which is a standalone tool can VTTCompile that runs on the command line. The interface for VTTCompile is
16
+ similar to VTTShell which is included in Visual TrueType download package.
17
+
18
+ Second is VTTCompilePy which is Cython based Python extension that exports interfaces enabling a Python program to compile
19
+ and assemble TrueType data. This extension also provides a command line interface to the Python interface. VTTCompilePy is
20
+ available on PyPi, please visit https://pypi.org/project/vttcompilepy.
21
+
22
+ The source code in the repo is mostly a subset of the source code of Visual TrueType as needed to produce VTTCompile.
23
+ However not all of the source code included in the repo is necessary to produce VTTCompile but we optimized for including
24
+ as complete source files as possible to make future maintenance easier.
25
+
26
+ For documentation of the Visual TrueType source formats visit https://docs.microsoft.com/en-us/typography/tools/vtt/tsi-tables.
27
+
28
+ ## Building
29
+
30
+ In the "vttcompile" folder, there is a Visual Studio Solution for Microsoft Visual Studio users,
31
+ and an Xcode Project For Apple Xcode users.
32
+
33
+ For unix users (including Linux and Apple command-line), `cd src && make` should work. You
34
+ can also cross-compile for 32-bit windows with `cd src && make CXX=i686-w64-mingw32-c++`,
35
+ for 64-bit windows with `cd src && make CXX=x86_64-w64-mingw32-c++`; and use clang,
36
+ enabling all the recommended warnings with `cd src && make CXX=clang++ CXXFLAGS=-Wall`.
37
+ Build as 32-bit on 64-bit systems with `cd src && make CXXFLAGS=-m32`.
38
+ You may need to do `cd src && make CXXFLAGS="-std=c++14"` to explicitly request
39
+ support for the 2014 ISO C++ standard.
40
+
41
+ In the "vttcompilepy" folder is the Cython source for the Python extension but the build is
42
+ done through the setup.py file in the main folder.
43
+
44
+ Setup a Python environment including dependencies in requirements-dev.txt.
45
+
46
+ To build the extension on local machine use "Python setup.py build".
47
+ To install the built extension into current Python environment use "Python setup.py install".
48
+ To create a distribution package for current system use "Python setup.py bdist_wheel".
49
+
50
+ The workflow Python Extension uses ciBuildWheel to build the extension across multiple platforms
51
+ and optionally upload result to PyPi.
52
+
53
+ The minimum compiler requirement is support for the 2014 ISO C++ standard plus amendments.
54
+
55
+ ## Contributing
56
+
57
+ This project welcomes contributions and suggestions. Most contributions require you to agree to a
58
+ Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
59
+ the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
60
+
61
+ When you submit a pull request, a CLA bot will automatically determine whether you need to provide
62
+ a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
63
+ provided by the bot. You will only need to do this once across all repos using our CLA.
64
+
65
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
66
+ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
67
+ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
68
+
69
+ ## Trademarks
70
+
71
+ This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
72
+ trademarks or logos is subject to and must follow
73
+ [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
74
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
75
+ Any use of third-party trademarks or logos are subject to those third-party's policies.
@@ -0,0 +1,16 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools",
4
+ "wheel",
5
+ "cython",
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [tool.cibuildwheel]
10
+ skip = ["*-manylinux_i686", "pp*", "cp313-*"]
11
+
12
+ test-requires = ["pytest", "fonttools"]
13
+ test-command = "pytest {project}/tests"
14
+
15
+ [tool.cibuildwheel.macos]
16
+ archs = ["x86_64", "universal2", "arm64"]
@@ -0,0 +1,11 @@
1
+ [sdist]
2
+ formats = zip
3
+
4
+ [metadata]
5
+ license_files =
6
+ LICENSE.txt
7
+
8
+ [egg_info]
9
+ tag_build =
10
+ tag_date = 0
11
+
@@ -0,0 +1,92 @@
1
+ # -*- coding: utf-8 -*-
2
+ from io import open
3
+ import os
4
+ import sys
5
+ import platform
6
+ from setuptools import Extension, setup
7
+ from Cython.Build import cythonize
8
+
9
+ # from _version import __version__ as vttpy_version
10
+
11
+ here = os.path.abspath(os.path.dirname(__file__))
12
+
13
+ # Get the long description from the pypi.md file
14
+ with open(os.path.join(here, "pypi.md"), encoding="utf-8") as f:
15
+ long_description = f.read()
16
+
17
+ define_macros = [("UNICODE", 1), ("_UNICODE", 1)]
18
+ linetrace = False
19
+ if int(os.environ.get("CYTHON_LINETRACE", "0")):
20
+ linetrace = True
21
+ define_macros.append(("CYTHON_TRACE_NOGIL", "1"))
22
+
23
+ extra_compile_args = []
24
+
25
+ if platform.system() != "Windows":
26
+ extra_compile_args.append("-std=c++14")
27
+
28
+ if platform.system() == "Windows":
29
+ extra_compile_args.append("-sdl")
30
+
31
+ extension = Extension(
32
+ "vttcompilepy.vttcompilepy",
33
+ define_macros=define_macros,
34
+ include_dirs=[".", "src"],
35
+ sources=[
36
+ "vttcompilepy/vttcompilepy.pyx",
37
+ "src/application.cpp",
38
+ "src/CvtManager.cpp",
39
+ "src/File.cpp",
40
+ "src/List.cpp",
41
+ "src/MathUtils.cpp",
42
+ "src/Memory.cpp",
43
+ "src/Platform.cpp",
44
+ "src/TextBuffer.cpp",
45
+ "src/TMTParser.cpp",
46
+ "src/TTAssembler.cpp",
47
+ "src/TTEngine.cpp",
48
+ "src/TTFont.cpp",
49
+ "src/TTGenerator.cpp",
50
+ "src/Variation.cpp",
51
+ "src/VariationInstance.cpp",
52
+ "src/VariationModels.cpp",
53
+ "src/ttiua.cpp",
54
+ ],
55
+ language="c++",
56
+ extra_compile_args=extra_compile_args,
57
+ )
58
+
59
+ setup(
60
+ name="vttcompilepy",
61
+ # version= vttpy_version,
62
+ version="0.0.1.11",
63
+ description="Python extension for Visual TrueType font compile. ",
64
+ long_description=long_description,
65
+ long_description_content_type="text/markdown",
66
+ author="Paul Linnerud",
67
+ author_email="paulli@microsoft.com",
68
+ url="https://github.com/microsoft/VisualTrueType",
69
+ license="MIT",
70
+ classifiers=[
71
+ "Programming Language :: Python :: 3",
72
+ "License :: OSI Approved :: MIT License",
73
+ ],
74
+ package_dir={"": "."},
75
+ packages=["vttcompilepy"],
76
+ zip_safe=False,
77
+ install_requires=[
78
+ "fonttools>=4.33.0",
79
+ ],
80
+ python_requires=">=3.7",
81
+ ext_modules=cythonize(
82
+ extension,
83
+ annotate=bool(int(os.environ.get("CYTHON_ANNOTATE", "0"))),
84
+ compiler_directives={"linetrace": linetrace},
85
+ ),
86
+ entry_points={
87
+ "console_scripts": [
88
+ "vttcompilepy = vttcompilepy.__main__:main",
89
+ "quit_to_glyphs = vttcompilepy.quit_to_glyphs:main",
90
+ ]
91
+ },
92
+ )