FontLab Forum
2012-02-08, 20:18:31 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the FontLab forum, read how to use it! Update: Archives from old MSN forums are now available on our forum.
 
   Home   Help Search Calendar Downloads Tags Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot

Pages: [1]
  Print  
Author Topic: Mark Overlapping Contours  (Read 2086 times)
malcolm
Hero Member
*****

Karma: +0/-0
Posts: 26


Email
« on: 2010-08-02, 05:29:52 »

Hi
I have been asked if I can provide a script that will mark glyphs that have overlapping contours.
I know there is a method in Glyphs to remove overlap but how can I just check if a glyph has overlapping contours?

thanks
Logged
Georg Seifert (FontLab)
Team: FontLab
Sr. Member
****

Karma: +0/-1
Posts: 13


Email
« Reply #1 on: 2010-08-02, 06:10:07 »

You can make a copy of the outlines and remove overlap. If the outline changes then there was a overlap.

Georg
Logged
malcolm
Hero Member
*****

Karma: +0/-0
Posts: 26


Email
« Reply #2 on: 2010-08-02, 08:51:44 »

Thanks George.

I made a duplicate and removed the overlap. Compared the number of contours in each glyph and if different marked the original. I then deleted the duplicate. It works nicely.

cheers
Malcolm
Logged
Eigi
Beta: FontLab Studio Mac
Hero Member
***

Karma: +7/-0
Germany Germany

Posts: 55



WWW
« Reply #3 on: 2010-08-02, 09:55:39 »

Hello,

as you can see, this works not in any case:


In both cases you have two contours!

Eigi
« Last Edit: 2010-08-02, 09:57:28 by Eigi » Logged
malcolm
Hero Member
*****

Karma: +0/-0
Posts: 26


Email
« Reply #4 on: 2010-08-02, 11:53:38 »

Thanks Eigi, quite right.

I now include a check on the number of nodes also. This seems to work ok.
Do you think there may be a case where number of contours and number of nodes are going to be the same after removing overlap?

Malcolm
Logged
Georg Seifert (FontLab)
Team: FontLab
Sr. Member
****

Karma: +0/-1
Posts: 13


Email
« Reply #5 on: 2010-08-03, 05:17:30 »

It is quite easy to even compare all nodes’ coordinates iv you want to be save.

I generate a "hash" from the outlines like this M12,34L34,50C34,70,50,80,70,80 ... (M = move point, L = line point, C = curve point, plus the coordinates) Then you compare the strings.

Logged
Tags:
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!