This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| class TestStringMethods(unittest.TestCase): | |
| def test_upper(self): | |
| self.assertEqual('foo'.upper(), 'FOO') | |
| def test_isupper(self): | |
| self.assertTrue('FOO'.isupper()) | |
| self.assertFalse('Foo'.isupper()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f = CurrentFont() | |
| sidebearing = 50 | |
| l = [] | |
| for i in f: | |
| if i.leftMargin != sidebearing: | |
| l.append(i.name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f = CurrentFont() | |
| g = f.selection[0] | |
| for i in f: | |
| for j in i.components: | |
| if j.baseGlyph == g: | |
| i.mark = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| '''Transfer the first loaded fonts names to the second loaded font''' | |
| f = AllFonts() | |
| good_names = {} | |
| for i in f[0]: | |
| good_names[i.index] = i.name | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f = CurrentFont() | |
| unis = ['00A2','00A3','00A5','00A6','00A9','00AB','00AC','00AF','00B0','00B1','00B2','00B3','00B4','03BC','00B6','00B7','00B8','00B9','00BA','00BB','00BC','00BD','00BE','2011','2012','201A','201B','201E','201F','2020','2021','2022','2026','2038','2039','203A','2070','2074','2075','2076','2077','2078','2079','207A','207B','207C','207D','207E','207F','2080','2081','2082','2083','2084','2085','2086','2087','2088','2089','208A','208B','208C','208D','208E','20A1','2117','2120','2122','03A9','212E','2153','2154','215B','215C','215D','215E','2194','2195','21A8','21D0','21D2','21D4','220B','2212','2215','2218','2219','2221','2243','2259','2272','2273'] | |
| g_unis = [] | |
| for i in f: | |
| if i.unicode: | |
| cp = hex(i.unicode)[2:].zfill(4).upper() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f = CurrentFont() | |
| anc_name = '_htop' | |
| amount = 10 | |
| for i in f.selection: | |
| for j in f[i].anchors: | |
| if anc_name in j.name: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f = CurrentFont() | |
| top = 880 | |
| bottom = -120 | |
| for i in f.selection: | |
| glyf_h = f[i].box[3]- f[i].box[1] | |
| t_s = top - f[i].box[3] #distance from top of bbox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f=CurrentFont() | |
| for i in f: | |
| g = i.width | |
| h = f.insertGlyph(i).getPen() | |
| h.moveTo((0,0)) | |
| h.lineTo((g,0)) | |
| h.lineTo((g, 750)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from robofab.world import * | |
| f = CurrentFont() | |
| for i in f.selection: | |
| w = 1000 - f[i].width | |
| f[i].leftMargin += w/2 | |
| f[i].rightMargin += w/2 | |
| f.update() |
NewerOlder