Created
          July 27, 2019 16:12 
        
      - 
      
- 
        Save mekkablue/922faca44fbb5f8a382b735579a5cfb7 to your computer and use it in GitHub Desktop. 
    Delete All Horizontal Hints in Font
  
        
  
    
      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
    
  
  
    
  | #MenuTitle: Delete All Horizontal Hints in Font | |
| # -*- coding: utf-8 -*- | |
| __doc__=""" | |
| Removes all horizontal hints in the font. | |
| """ | |
| thisFont = Glyphs.font # frontmost font | |
| thisFontMaster = thisFont.selectedFontMaster # active master | |
| def process( thisLayer ): | |
| numberOfHints = len(thisLayer.hints) | |
| for i in range(numberOfHints)[::-1]: | |
| thisHint = thisLayer.hints[i] | |
| if thisHint.horizontal: | |
| del thisLayer.hints[i] | |
| thisFont.disableUpdateInterface() # suppresses UI updates in Font View | |
| for thisGlyph in thisFont.glyphs: | |
| thisGlyph.beginUndo() # begin undo grouping | |
| for thisLayer in thisGlyph.layers: | |
| process( thisLayer ) | |
| thisGlyph.endUndo() # end undo grouping | |
| thisFont.enableUpdateInterface() # re-enables UI updates in Font View | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment