[NTG-context] Metafun: Finding intersection between characters

Jeong Dal haksan at me.com
Wed Sep 26 01:48:06 CEST 2018


Dear Hans,

First, it is great to know a new method of drawing an outlined font!

 I have applied it to Korean fonts. As you know, every Korean character is composed with “consonant+vowel(+consonant)” type. If consonant and vowel are connected (for example, “호”), then it draws correctly, otherwise (for example, “하”)  it draws only consonant.
Is there a way to count all the paths in a character(even if it is not connected)?

Thank you.
Best regards,

Dalyoung


> 
> \starttext
> 
> \startMPdefinitions
> 
>     % will be added to metafun:
> 
>     def filloutlinetext(expr o) =
>         draw image (
>             save n, m ; numeric n, m ; n := m := 0 ;
>             for i within o :
>                 n := n + 1 ;
>             endfor ;
>             for i within o :
>                 m := m + 1 ;
>                 if n = m :
>                     eofill
>                 else :
>                     nofill
>                 fi pathpart i ;
>             endfor ;
>         )
>     enddef ;
> 



More information about the ntg-context mailing list