diff --git a/Doc/source/index.rst b/Doc/source/index.rst index 94aae7c85..e9b1dd8ec 100644 --- a/Doc/source/index.rst +++ b/Doc/source/index.rst @@ -56,7 +56,7 @@ This last utility takes a subcommand, which could be one of: - ``varLib.models``: Normalize locations on a given designspace - ``varLib.mutator``: Instantiate a variation font - ``varLib.varStore``: Optimize a font's GDEF variation store -- ``volto``: Convert MS VOLT to AFDKO feature files. +- ``voltLib.voltToFea``: Convert MS VOLT to AFDKO feature files. Libraries --------- @@ -88,7 +88,6 @@ libraries in the fontTools suite: - :py:mod:`fontTools.unicodedata`: Convert between Unicode and OpenType script information - :py:mod:`fontTools.varLib`: Module for dealing with 'gvar'-style font variations - :py:mod:`fontTools.voltLib`: Module for dealing with Visual OpenType Layout Tool (VOLT) files -- :py:mod:`fontTools.volto`: Convert MS VOLT to AFDKO feature files. A selection of sample Python programs using these libaries can be found in the `Snippets directory `_ of the fontTools repository. @@ -143,8 +142,7 @@ Table of Contents unicode unicodedata/index varLib/index - voltLib - volto + voltLib/index .. |Travis Build Status| image:: https://travis-ci.org/fonttools/fonttools.svg diff --git a/Doc/source/voltLib.rst b/Doc/source/voltLib/index.rst similarity index 67% rename from Doc/source/voltLib.rst rename to Doc/source/voltLib/index.rst index be9e80242..00d067a29 100644 --- a/Doc/source/voltLib.rst +++ b/Doc/source/voltLib/index.rst @@ -1,6 +1,11 @@ -####### -voltLib -####### +#################################### +voltLib: Read/write MS VOLT projects +#################################### + +.. toctree:: + :maxdepth: 2 + + voltToFea .. automodule:: fontTools.voltLib diff --git a/Doc/source/voltLib/voltToFea.rst b/Doc/source/voltLib/voltToFea.rst new file mode 100644 index 000000000..178dd68d5 --- /dev/null +++ b/Doc/source/voltLib/voltToFea.rst @@ -0,0 +1,8 @@ +################################################# +voltToFea: Convert MS VOLT to AFDKO feature files +################################################# + +.. automodule:: fontTools.voltLib.voltToFea + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/volto.rst b/Doc/source/volto.rst deleted file mode 100644 index 19698c1ac..000000000 --- a/Doc/source/volto.rst +++ /dev/null @@ -1,8 +0,0 @@ -############################################# -volto: Convert MS VOLT to AFDKO feature files -############################################# - -.. automodule:: fontTools.volto - :inherited-members: - :members: - :undoc-members: diff --git a/Lib/fontTools/volto.py b/Lib/fontTools/voltLib/voltToFea.py similarity index 99% rename from Lib/fontTools/volto.py rename to Lib/fontTools/voltLib/voltToFea.py index 43b9ed214..2265d5029 100644 --- a/Lib/fontTools/volto.py +++ b/Lib/fontTools/voltLib/voltToFea.py @@ -7,13 +7,13 @@ Usage To convert a VTP project file: - $ fonttools volto input.vtp output.fea + $ fonttools voltLib.voltToFea input.vtp output.fea It is also possible convert font files with `TSIV` table (as saved from Volt), in this case the glyph names used in the Volt project will be mapped to the actual glyph names in the font files when written to the feature file: - $ fonttools volto input.ttf output.fea + $ fonttools voltLib.voltToFea input.ttf output.fea The ``--quiet`` option can be used to suppress warnings. @@ -48,7 +48,7 @@ from fontTools.ttLib import TTFont, TTLibError from fontTools.voltLib import ast as VAst from fontTools.voltLib.parser import Parser as VoltParser -log = logging.getLogger("fontTools.volto") +log = logging.getLogger("fontTools.voltLib.voltToFea") TABLES = ["GDEF", "GSUB", "GPOS"] @@ -662,7 +662,9 @@ def main(args=None): from fontTools import configLogger - parser = argparse.ArgumentParser("fonttools volto", description=main.__doc__) + parser = argparse.ArgumentParser( + "fonttools voltLib.voltToFea", description=main.__doc__ + ) parser.add_argument( "input", metavar="INPUT", type=Path, help="input font/VTP file to process" ) diff --git a/Tests/volto/data/Empty.ttf b/Tests/voltLib/data/Empty.ttf similarity index 100% rename from Tests/volto/data/Empty.ttf rename to Tests/voltLib/data/Empty.ttf diff --git a/Tests/volto/data/NamdhinggoSIL1006.fea b/Tests/voltLib/data/NamdhinggoSIL1006.fea similarity index 100% rename from Tests/volto/data/NamdhinggoSIL1006.fea rename to Tests/voltLib/data/NamdhinggoSIL1006.fea diff --git a/Tests/volto/data/NamdhinggoSIL1006.vtp b/Tests/voltLib/data/NamdhinggoSIL1006.vtp similarity index 100% rename from Tests/volto/data/NamdhinggoSIL1006.vtp rename to Tests/voltLib/data/NamdhinggoSIL1006.vtp diff --git a/Tests/volto/data/Nutso.fea b/Tests/voltLib/data/Nutso.fea similarity index 100% rename from Tests/volto/data/Nutso.fea rename to Tests/voltLib/data/Nutso.fea diff --git a/Tests/volto/data/Nutso.ttf b/Tests/voltLib/data/Nutso.ttf similarity index 100% rename from Tests/volto/data/Nutso.ttf rename to Tests/voltLib/data/Nutso.ttf diff --git a/Tests/volto/data/Nutso.vtp b/Tests/voltLib/data/Nutso.vtp similarity index 100% rename from Tests/volto/data/Nutso.vtp rename to Tests/voltLib/data/Nutso.vtp diff --git a/Tests/volto/volto_test.py b/Tests/voltLib/volttofea_test.py similarity index 98% rename from Tests/volto/volto_test.py rename to Tests/voltLib/volttofea_test.py index 255da21ad..0d8d8d289 100644 --- a/Tests/volto/volto_test.py +++ b/Tests/voltLib/volttofea_test.py @@ -4,7 +4,7 @@ import tempfile import unittest from io import StringIO -from fontTools.volto import VoltToFea +from fontTools.voltLib.voltToFea import VoltToFea DATADIR = pathlib.Path(__file__).parent / "data" @@ -1168,7 +1168,9 @@ class ToFeaTest(unittest.TestCase): self.assertEqual(fea, "") self.assertEqual( logs.output, - ["WARNING:fontTools.volto:Unsupported setting ignored: CMAP_FORMAT"], + [ + "WARNING:fontTools.voltLib.voltToFea:Unsupported setting ignored: CMAP_FORMAT" + ], ) def test_sanitize_lookup_name(self): @@ -1211,30 +1213,30 @@ class ToFeaTest(unittest.TestCase): def test_cli_vtp(self): vtp = DATADIR / "Nutso.vtp" fea = DATADIR / "Nutso.fea" - self.volto(vtp, fea) + self.cli(vtp, fea) def test_group_order(self): vtp = DATADIR / "NamdhinggoSIL1006.vtp" fea = DATADIR / "NamdhinggoSIL1006.fea" - self.volto(vtp, fea) + self.cli(vtp, fea) def test_cli_ttf(self): ttf = DATADIR / "Nutso.ttf" fea = DATADIR / "Nutso.fea" - self.volto(ttf, fea) + self.cli(ttf, fea) def test_cli_ttf_no_TSIV(self): - from fontTools.volto import main as volto + from fontTools.voltLib.voltToFea import main as cli ttf = DATADIR / "Empty.ttf" temp = self.temp_path() - self.assertEqual(1, volto([str(ttf), str(temp)])) + self.assertEqual(1, cli([str(ttf), str(temp)])) - def volto(self, source, fea): - from fontTools.volto import main as volto + def cli(self, source, fea): + from fontTools.voltLib.voltToFea import main as cli temp = self.temp_path() - volto([str(source), str(temp)]) + cli([str(source), str(temp)]) with temp.open() as f: res = f.read() with fea.open() as f: