{
"info": {
"author": "drunsinn",
"author_email": "dr.unsinn@googlemail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3"
],
"description": "# type2nc - convert font outline to Klartext code\n\n\n\ntype2nc converts the outline of characters in a font file to Klartext\ncode. The resulting nc program can be used on TNC controls to engrave\ntext in the corresponding font. The nc program can be used similarly to\nthe engraving cycle 225 with QS-parameters.\n\n\n\n## Requirements\nTo use the resulting Klartext code on a control, it has to have the following\ncycles and functions:\n\n - cycle 7\n - cycle 10\n - cycle 26\n - INSTR\n - STRLEN\n - STRCOMP\n - FN 9\n - FN 10\n - FN 12\n\nTesting was done on a machine with TNC 620 with software version 817600-03. As\nlong as the requirements listed above are met, it should work fine.\nSupport for smaller controls like TNC 128 is untested but the output does not\ncontain any circular path's.\n\n## Installation\n\nTo be able to use type2nc, you need python 3 and the following library's\ninstalled on your system:\n\n - [numpy](https://www.numpy.org) \\>=1.6.2\n - [scipy](https://www.scipy.org) \\>=0.19.0\n - [freetype-py](https://github.com/rougier/freetype-py) \\>=1.1\n - argparse \\>=1.4.0\n\n### Install from Python Packaging Index\n\nTo install type2nc and its dependencies from the Python Packaging Index,\nfirst install python3. After a successful setup, type\n\n`pip install type2nc`\n\non the command line.\nTo get freetype up and running, you might have to install the binary's\nfor the library. On Linux and macOS, the library is probably already\ninstalled. For Windows, follow the instructions on [this github repo](https://github.com/ubawurinna/freetype-windows-binaries).\n\n## Program Usage\n\n - First, choose a font that has the necessary characters you\n need. Not every font comes with all characters defined by the\n Unicode standard. If a character is not available in your font,\n it will be replaced with a placeholder. Some sources for fonts:\n\n - \n - \n - \n - \n - \n\n - Make sure you have the necessary rights to use the font.\n\n - Open a command prompt and run python3 type2nc.py or double-click the\n `type2n.py` file\n\n - Select one or more font files\n\n - create and select an output folder for the results\n\n - enter a step size for the conversion. As the outline of a character\n consists of curves, these have to be broken down into smaller line\n segments. The smaller the selected step size, the smother the curves\n will be. A smaller step size can also increase the resulting file size\n (several hundred mb).\n\n - the program will read the font file and convert the outlines to\n Klartext code. This may take some time, depending on the step size\n selected earlier\n\n - When the program is finished, it will display some statistics about\n the generated code\n\n - After it is finished, you will find a nc program for every font file\n you selected earlier. There will also be a demo program called\n `type2nc_demo.H` with a usage example.\n\n## Command line interface\n\nThe program can also be used from the command line. To get information on the\navailable options, run `python3 type2nc.py -h`\nOutput:\n\n`usage: type2nc.py [-h] [-i font input file [font input file \u00e2\u20ac\u00a6]]\n [-o output folder] [-s step size] [-r]\n\n\nCreate Klartext NC code from font files\n\noptional arguments:\n -h, --help show this help message and exit\n -i font input file [font input file \u00e2\u20ac\u00a6], --input font input file [font input file \u00e2\u20ac\u00a6]\n path of one or more font files\n -o output folder, --out output folder\n path to the output folder. If not set, use current\n directory.\n -s step size, --step_size step size\n step size: between 0.001 (very fine) and 0.2 (very\n coarse)\n -r, --remove_empty if set, output dose not contain label for empty\n characters`\n\n\n\n## NC-Code Usage\n\nThe nc program uses these Q parameters:\n\n - **QS1**: Text to engrave\n - **Q1600**: Z-coordinate of surface\n - **Q1601**: milling depth\n - **Q1602**: safe distance for rapid feed between characters\n - **Q1603**: X-coordinate of the lower left corner of the text\n - **Q1604**: Y-coordinate of the lower left corner of the text\n - **Q1605**: milling feed\n - **Q1606**: approximate height of the engraved text\n - **Q1607**: angle of the text base line\n\nInternally the nc program uses the following parameters:\n\n - **QL10** to **QL25**: local Q-parameter for internal calculations\n - **QS2** and **QS3**: String-Parameter used as temporary storage\n\nAfter setting the Q parameters QS1 as well as Q1600 to Q1607, make a\nPGM CALL to the generated .H-file with the code for the selected font.\n\n## Known Issues / Problems\n### Missing Freetype library\nOn Windows, when you install freetype-py, the necessary dll files are not\ninstalled automatically. When trying to run type2nc, you get an error message\nending in `RuntimeError: Freetype library not found`. To fix this, follow\nthe instructions on [this github repo](https://github.com/ubawurinna/freetype-windows-binaries).\n\n### Characters are not included in nc code\nTo reduce the file size of the output file, it was chosen to limit the\nrange of characters to specific sections of the Unicode standard:\n\n* BASIC_LATIN: 0x0020 to 0x007E\n* C1_CTRL_AND_LATIN1_SUPPLEMENT: 0x0080 to 0x00FF\n* IPA_EEXTENTIONS: 0x0250 to 0x02AF\n* GREEK_AND_COPTIC_CHARS: 0x0370 to 0x03FF\n* CYRILLIC_CHARS: 0x0400 to 0x04FF\n* CYRILLIC_SUPPLEMENT_CHARS: 0x0500 to 0x052F\n* ARMENIAN_CHARS: 0x0530 to 0x058F\n* HEBREW_CHARS: 0x0590 to 0x05FF\n* ARABIC_CHARS: 0x0600 to 0x06FF\n* SYRIAC_CHARS: 0x0700 to 0x074F\n* ARABIC_SUPPLEMENT_CHARS: 0x0750 to 0x077F\n* GENERAL_PUNCTUATION: 0x2000 to 0x206F\n* ARROW_CHARS: 0x2190 to 0x21FF\n* MATHEMATICAL_CHARS: 0x2200 to 0x22FF\n* MISC_TECH_CHARS: 0x2300 to 0x23FF\n* MISC_SYMBOLS: 0x2600 to 0x26FF\n* DINGBATS: 0x2700 to 0x27BF\n* CJK_UNIFIED_IDEOGRAPHS_PART1: 0x4E00 to 0x9FFF\n\nThis results in a total of 23535 characters\n\nIf you need more or other characters, let me know and i will add them.\n\n### Windows Installer\nThere is no All-In-One installer available. If there is enough interest, i may\nlook into building an installer version.\n\n\n",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/drunsinn/type2nc",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "type2nc",
"package_url": "https://pypi.org/project/type2nc/",
"platform": "",
"project_url": "https://pypi.org/project/type2nc/",
"project_urls": {
"Homepage": "https://github.com/drunsinn/type2nc"
},
"release_url": "https://pypi.org/project/type2nc/0.4.1/",
"requires_dist": [
"numpy (>=1.6.2)",
"scipy (>=0.19.0)",
"freetype-py (>=1.1)",
"argparse (>=1.4.0)"
],
"requires_python": "",
"summary": "convert truetype fonts to klartext nc-code",
"version": "0.4.1"
},
"last_serial": 4234981,
"releases": {
"0.3.0": [
{
"comment_text": "",
"digests": {
"md5": "a49e701b1daad6826b6edc8950eaaa69",
"sha256": "9e31cbbb7d5317de6eb223a45cacbc4c009e522fec464ac33eb626f00d2fd68b"
},
"downloads": -1,
"filename": "type2nc-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a49e701b1daad6826b6edc8950eaaa69",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10255,
"upload_time": "2018-06-17T11:59:47",
"url": "https://files.pythonhosted.org/packages/87/90/cade11460a603611efc0a5c3e694053631c9f7963e56782f2a96dce2697d/type2nc-0.3.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "e760745f6c77a4376cb14e733248a2f0",
"sha256": "8f4fabc687f3ae9813896c922549333fb7a3ceb295020c10f980404837c27a42"
},
"downloads": -1,
"filename": "type2nc-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "e760745f6c77a4376cb14e733248a2f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8210,
"upload_time": "2018-06-17T11:59:49",
"url": "https://files.pythonhosted.org/packages/6f/34/f7b40ae93b6d7fa4a57a33fc6b950d0d212135cf6e35d9875ede2565495b/type2nc-0.3.0.tar.gz"
}
],
"0.3.1": [
{
"comment_text": "",
"digests": {
"md5": "03b7e4e4661e1af09a20007feba30531",
"sha256": "5fe2cb0ce586b7a51c875574f8e2ba266438eccf0fd63a723180086f20746988"
},
"downloads": -1,
"filename": "type2nc-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "03b7e4e4661e1af09a20007feba30531",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10568,
"upload_time": "2018-06-23T13:23:07",
"url": "https://files.pythonhosted.org/packages/88/6a/f0804061d99fb9749a95c6dfdb1bdbaae46ee40947f0c175c2881e08d66b/type2nc-0.3.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "6b799900b6729ca39101ae17661d7226",
"sha256": "77afabebf8961a5a3bb02b332a39ac433eb194de3016900b723ad26529b72ed1"
},
"downloads": -1,
"filename": "type2nc-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "6b799900b6729ca39101ae17661d7226",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8582,
"upload_time": "2018-06-23T13:23:08",
"url": "https://files.pythonhosted.org/packages/a4/d5/88c1c5f3e806e1f1af5e1f4ebe77a4dfe226118549727182006cc77499da/type2nc-0.3.1.tar.gz"
}
],
"0.3.3": [
{
"comment_text": "",
"digests": {
"md5": "4577a76084c3af1aec2567e8b6f9434d",
"sha256": "5de0de93656e1c967d4e7002fd010cffb2d093b11e3141752daf6519ca9d07b5"
},
"downloads": -1,
"filename": "type2nc-0.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4577a76084c3af1aec2567e8b6f9434d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11749,
"upload_time": "2018-06-24T11:32:37",
"url": "https://files.pythonhosted.org/packages/e9/fc/838adbf0c34f52711d580d32ddc8e4b5213a76579f06337a65b4dfc2fba2/type2nc-0.3.3-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "9695551a9123c57fcc11a12a23556450",
"sha256": "4d1bfcd16ca63298f3d6366d0877e3c9e352815f0a97a20c26c28c76032545ae"
},
"downloads": -1,
"filename": "type2nc-0.3.3.tar.gz",
"has_sig": false,
"md5_digest": "9695551a9123c57fcc11a12a23556450",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11033,
"upload_time": "2018-06-24T11:32:39",
"url": "https://files.pythonhosted.org/packages/e3/18/9d3f67fa5a558359dd2e54016ae4c55db72357d48a3077ca7ef63bf8f5cb/type2nc-0.3.3.tar.gz"
}
],
"0.4.1": [
{
"comment_text": "",
"digests": {
"md5": "7ede9c1f47677eb5016ba62bb307e743",
"sha256": "0241379d3d5dd816f0edb1241760012ad12162e44a200c1ae2d8dec76d8365f8"
},
"downloads": -1,
"filename": "type2nc-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ede9c1f47677eb5016ba62bb307e743",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 16898,
"upload_time": "2018-09-03T17:25:59",
"url": "https://files.pythonhosted.org/packages/a0/78/9a61ba48b4034fc7dcfd78bd600aad34cedcaa062a6cb353f2bba8b1c00f/type2nc-0.4.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "24f37265e078d4d6c17d82a42d67cefe",
"sha256": "061d2bbd9c6c389899b2f7d3f54a3aa88a2ac6473ecde89fd2340d0926fd07c0"
},
"downloads": -1,
"filename": "type2nc-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "24f37265e078d4d6c17d82a42d67cefe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14225,
"upload_time": "2018-09-03T17:26:01",
"url": "https://files.pythonhosted.org/packages/72/39/744bb9e57e37f06cec2c8d39e1bd4a802a8c171f67a217b38fbd30bccfc9/type2nc-0.4.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "7ede9c1f47677eb5016ba62bb307e743",
"sha256": "0241379d3d5dd816f0edb1241760012ad12162e44a200c1ae2d8dec76d8365f8"
},
"downloads": -1,
"filename": "type2nc-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ede9c1f47677eb5016ba62bb307e743",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 16898,
"upload_time": "2018-09-03T17:25:59",
"url": "https://files.pythonhosted.org/packages/a0/78/9a61ba48b4034fc7dcfd78bd600aad34cedcaa062a6cb353f2bba8b1c00f/type2nc-0.4.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "24f37265e078d4d6c17d82a42d67cefe",
"sha256": "061d2bbd9c6c389899b2f7d3f54a3aa88a2ac6473ecde89fd2340d0926fd07c0"
},
"downloads": -1,
"filename": "type2nc-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "24f37265e078d4d6c17d82a42d67cefe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14225,
"upload_time": "2018-09-03T17:26:01",
"url": "https://files.pythonhosted.org/packages/72/39/744bb9e57e37f06cec2c8d39e1bd4a802a8c171f67a217b38fbd30bccfc9/type2nc-0.4.1.tar.gz"
}
]
}