Area of paths and free space

Hi,

When creating a very bold font or bold master it would be great to have an option to measure the area of shapes and free space to easily balance the color.

This illustrator plugin does the work http://www.telegraphics.com.au/sw/product/patharea
but of course it is useless during the font development.

What I’d like to measure:

  1. area of a path
  2. space inside a glyph like H or O
  3. space outside the glyph from Cap Height (or Ascender Height) to baseline, and to sidebearing - just space from left or right side.

https://www.dropbox.com/s/p61ez8ojhh5hibk/Screen%20Shot%202014-03-24%20at%2010.12.13. png

Maybe a script would do the job? Maybe recently released SDK?

1 Like

This could be done with a script. I do not have put in much thought in this but you probably need to render the glyphs and count the pixels.

Yes, this is a very old thread, but I’ve just written a plugin which does this. Please see (and test) https://github.com/simoncozens/GlyphsPlugins

1 Like

There is a GSPath.area() method now.

So there is! Here’s the crash report I get when I try to use it: Glyphs_2015-09-24-175833_Simons-MacBook-Pro.crash.zip (21.4 KB)

At one time @SimonC had a plugin, Show Path Area, but it doesn’t work today.
@mekkablue had a script, Report Area in Square Units, which he deprecated about a year ago.

So is there anything now available for Glyphs 3 which will calculate the path area? Even some Macro code would help.

As @GeorgSeifert wrote above, there is an area method on paths. This macro writes the area of each path to the Macro console:

for l in Font.selectedLayers:
	for p in l.paths:
		print(p.area())
1 Like

Thanks Florian.