descenderHeight = f.info.descender bboxTop = f.info.openTypeHheaAscender bboxBottom = f.info.openTypeHheaDescender # Set Anchors Y values Y_top_LC = xHeight + ( ascenderHeight - xHeight ) / 2 Y_top_Cap = capHeight + ( bboxTop - capHeight ) / 2 Y_caronalt = Y_top_LC Y_aphostrophe = Y_top_LC Y_periodcentered = capHeight / 2 Y_bottom = descenderHeight / 2 Y_ogonek = xHeight / 10 # Create some Guidleines f.clearHGuides() f.appendHGuide(Y_top_LC) f.appendHGuide(Y_top_Cap) f.appendHGuide(Y_periodcentered) f.appendHGuide(Y_bottom) f.appendHGuide(Y_ogonek) f.appendHGuide(bboxTop) f.appendHGuide(bboxBottom) f.update() # Lets place the anchors on the Caps Base Glyphs f['A'].appendAnchor( 'topUC', ( f['A'].width / 2 , Y_top_Cap ) ) f['A'].appendAnchor( 'ogonek', ( ( f['A'].width / 6 ) * 5 , Y_ogonek ) ) f['A'].mark = 100 f['AE'].appendAnchor( 'topUC', ( f['AE'].width / 2 , Y_top_Cap ) )
descenderHeight = f.info.descender bboxTop = f.info.openTypeHheaAscender bboxBottom = f.info.openTypeHheaDescender # Set Anchors Y values Y_top_LC = xHeight + (ascenderHeight - xHeight) / 2 Y_top_Cap = capHeight + (bboxTop - capHeight) / 2 Y_caronalt = Y_top_LC Y_aphostrophe = Y_top_LC Y_periodcentered = capHeight / 2 Y_bottom = descenderHeight / 2 Y_ogonek = xHeight / 10 # Create some Guidleines f.clearHGuides() f.appendHGuide(Y_top_LC) f.appendHGuide(Y_top_Cap) f.appendHGuide(Y_periodcentered) f.appendHGuide(Y_bottom) f.appendHGuide(Y_ogonek) f.appendHGuide(bboxTop) f.appendHGuide(bboxBottom) f.update() # Lets place the anchors on the Caps Base Glyphs f['A'].appendAnchor('topUC', (f['A'].width / 2, Y_top_Cap)) f['A'].appendAnchor('ogonek', ((f['A'].width / 6) * 5, Y_ogonek)) f['A'].mark = 100 f['AE'].appendAnchor('topUC', (f['AE'].width / 2, Y_top_Cap)) f['AE'].mark = 100
#FLM: Lowercase Guides # Version 0.1 # Sample script, demostrating how to add and remove guidelines. Useful for only # looking at guidelines for the type of glyphs one is working on, and not the # other types. from robofab.world import CurrentFont def clearAllGuides(font): font.clearHGuides() font.clearVGuides() font = CurrentFont() clearAllGuides(font) font.appendHGuide(460) font.appendHGuide(407) font.appendHGuide(45) font.appendHGuide(36) font.appendHGuide(-11) font.update()