예제 #1
0
 def test_rename_default_layer(self):
     # https://github.com/unified-font-object/ufoLib/issues/123
     path = getTestFontCopyPath()
     font = Font()
     font.save(path)
     font.layers.defaultLayer.name = "somethingElse"
     font.save()
     self.assertEqual(Font(path).layers.defaultLayer.name, "somethingElse")
예제 #2
0
 def test_rename_default_layer(self):
     # https://github.com/unified-font-object/ufoLib/issues/123
     path = getTestFontCopyPath()
     font = Font()
     font.save(path)
     font.layers.defaultLayer.name = "somethingElse"
     font.save()
     self.assertEqual(Font(path).layers.defaultLayer.name, "somethingElse")
예제 #3
0
 def test_save_as(self):
     path = getTestFontPath()
     font = Font(path)
     saveAsPath = getTestFontCopyPath(path)
     font.save(saveAsPath)
     fileNames = glob.glob(os.path.join(saveAsPath, 'glyphs', '*.glif'))
     fileNames = [os.path.basename(fileName) for fileName in fileNames]
     self.assertEqual(sorted(fileNames), ["A_.glif", "B_.glif", "C_.glif"])
     self.assertEqual(font.path, saveAsPath)
     tearDownTestFontCopy(saveAsPath)
예제 #4
0
 def test_save_as(self):
     path = getTestFontPath()
     font = Font(path)
     saveAsPath = getTestFontCopyPath(path)
     font.save(saveAsPath)
     fileNames = glob.glob(os.path.join(saveAsPath, 'glyphs', '*.glif'))
     fileNames = [os.path.basename(fileName) for fileName in fileNames]
     self.assertEqual(sorted(fileNames), ["A_.glif", "B_.glif", "C_.glif"])
     self.assertEqual(font.path, saveAsPath)
     tearDownTestFontCopy(saveAsPath)
예제 #5
0
 def test_save_as(self):
     path = getTestFontPath()
     font = Font(path)
     saveAsPath = getTestFontCopyPath(path)
     font.save(saveAsPath)
     imagesDirectory = os.path.join(saveAsPath, "images")
     self.assertTrue(os.path.exists(imagesDirectory))
     imagePath = os.path.join(imagesDirectory, "image 1.png")
     self.assertTrue(os.path.exists(imagePath))
     imagePath = os.path.join(imagesDirectory, "image 2.png")
     self.assertTrue(os.path.exists(imagePath))
     tearDownTestFontCopy(saveAsPath)
예제 #6
0
 def test_save_as(self):
     path = getTestFontPath()
     font = Font(path)
     saveAsPath = getTestFontCopyPath(path)
     font.save(saveAsPath)
     imagesDirectory = os.path.join(saveAsPath, "images")
     self.assertTrue(os.path.exists(imagesDirectory))
     imagePath = os.path.join(imagesDirectory, "image 1.png")
     self.assertTrue(os.path.exists(imagePath))
     imagePath = os.path.join(imagesDirectory, "image 2.png")
     self.assertTrue(os.path.exists(imagePath))
     tearDownTestFontCopy(saveAsPath)
예제 #7
0
 def test_save_as(self):
     for ufo in (u"TestFont.ufo", u"TestFont.ufoz"):
         path = getTestFontPath(ufo)
         font = Font(path)
         origFileStructure = font.ufoFileStructure
         saveAsPath = getTestFontCopyPath(path)
         self.assertFalse(os.path.exists(saveAsPath))
         font.save(saveAsPath)
         try:
             fileNames = sorted([
                 fs.path.basename(m.path)
                 for m in UFOReader(saveAsPath).fs.glob("glyphs/*.glif")
             ])
             self.assertEqual(fileNames, ["A_.glif", "B_.glif", "C_.glif"])
             self.assertEqual(font.path, saveAsPath)
             self.assertEqual(origFileStructure, font.ufoFileStructure)
         finally:
             tearDownTestFontCopy(saveAsPath)
예제 #8
0
 def test_save_as(self):
     path = getTestFontPath()
     font = Font(path)
     saveAsPath = getTestFontCopyPath(path)
     font.save(saveAsPath)
     dataDirectory = os.path.join(saveAsPath, "data")
     self.assertTrue(os.path.exists(dataDirectory))
     self.assertTrue(os.path.exists(os.path.join(
         dataDirectory,
         os.path.join("com.typesupply.defcon.test.directory",
                      "file 1.txt"))))
     self.assertTrue(os.path.exists(os.path.join(
         dataDirectory,
         os.path.join("com.typesupply.defcon.test.directory",
                      "sub directory", "file 2.txt"))))
     self.assertTrue(os.path.exists(os.path.join(
         dataDirectory,
         "com.typesupply.defcon.test.file")))
     tearDownTestFontCopy(saveAsPath)
예제 #9
0
 def test_save_as(self):
     for ufo in (u"TestFont.ufo", u"TestFont.ufoz"):
         path = getTestFontPath(ufo)
         font = Font(path)
         origFileStructure = font.ufoFileStructure
         saveAsPath = getTestFontCopyPath(path)
         self.assertFalse(os.path.exists(saveAsPath))
         font.save(saveAsPath)
         try:
             fileNames = sorted(
                 [
                     fs.path.basename(m.path)
                     for m in UFOReader(saveAsPath).fs.glob("glyphs/*.glif")
                 ]
             )
             self.assertEqual(fileNames, ["A_.glif", "B_.glif", "C_.glif"])
             self.assertEqual(font.path, saveAsPath)
             self.assertEqual(origFileStructure, font.ufoFileStructure)
         finally:
             tearDownTestFontCopy(saveAsPath)
예제 #10
0
 def test_save_as(self):
     path = getTestFontPath()
     font = Font(path)
     saveAsPath = getTestFontCopyPath(path)
     font.save(saveAsPath)
     dataDirectory = os.path.join(saveAsPath, "data")
     self.assertTrue(os.path.exists(dataDirectory))
     self.assertTrue(
         os.path.exists(
             os.path.join(
                 dataDirectory,
                 os.path.join("com.typesupply.defcon.test.directory",
                              "file 1.txt"))))
     self.assertTrue(
         os.path.exists(
             os.path.join(
                 dataDirectory,
                 os.path.join("com.typesupply.defcon.test.directory",
                              "sub directory", "file 2.txt"))))
     self.assertTrue(
         os.path.exists(
             os.path.join(dataDirectory,
                          "com.typesupply.defcon.test.file")))
     tearDownTestFontCopy(saveAsPath)
예제 #11
0
 def tearDown(self):
     if os.path.exists(getTestFontCopyPath()):
         tearDownTestFontCopy()
예제 #12
0
 def tearDown(self):
     if os.path.exists(getTestFontCopyPath()):
         tearDownTestFontCopy()
예제 #13
0
 def tearDown(self):
     path = getTestFontCopyPath()
     if os.path.exists(path):
         shutil.rmtree(path)
예제 #14
0
 def tearDown(self):
     path = getTestFontCopyPath()
     if os.path.exists(path):
         tearDownTestFontCopy()
예제 #15
0
 def tearDown(self):
     path = getTestFontCopyPath()
     if os.path.exists(path):
         shutil.rmtree(path)
예제 #16
0
 def tearDown(self):
     path = getTestFontCopyPath()
     if os.path.exists(path):
         tearDownTestFontCopy()