Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Rendering > Re: How to fill...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 124 of 184
Post > Topic >>

Re: How to fill Truetype glyph outlines into Black and white solid images?

by "Laptop2" <dyj755@[EMAIL PROTECTED] > Mar 5, 2005 at 11:02 AM

A vertex list obtained from a true type font's glyph is not guarenteed to
be 
counter-clockwise oriented. Sometimes, depending on the character the list

may be clockwise oriented. (Strange? yes, indeed). You need to design your

own algorithm to rearrange it. This is a bit tricky when holes are
involved. 
Basically you need to find the largest polygon, force it to be 
counter-clockwise and find the next largest polygon inside this one and
make 
it clockwise and so on. Do this recursively until all polygons are
examined. 
For polygons that do not contain any other polygons or polygons that are
not 
contained by another other polygons, force them to be counter-clockwise.

This is how "solid polygons" are created out of true type fonts in 
ActiveSolid.

Dan
J&L Associates, Developer of ActiveSolid
http://activesolid.ncf.ca/prod01.htm



"lucy" <losemind@[EMAIL PROTECTED]
> wrote in message 
news:d0bjbf$dri$1@[EMAIL PROTECTED]
> Hi all,
>
> I have successfully obtained the Truetype fonts glyph and rendered onto 
> screen as an outline bitmap... however I want to have these outlines of 
> fonts filled...
>
> I have tried flood fill, but it needs correctly setting up a seed, which

> is a pixel safely inside the font outline... but sometimes there are 
> contours inside contours, and lacking of seed information making my 
> flood-fill very ugly...
>
> I have also tried scanline fill, but at some low resolution there will
be 
> some degenerated outlines, for example, a single pixel-width vertical 
> line(which should be regarded as already filled by 1-width wide band), a

> multiple-pixel horizontal flat band, etc. My scanline filling program
does 
> not correctly recogonize these degerated cases and sometimes underfills 
> some regions and sometimes overfills some regions...
>
> I want to ask what is the correct way to fill the Truetype glyph? Does
the 
> truetype font file has information of where are the seeds neccessary for

> floodfill?
>
> Also, if I go deep into how the glyph outlines are drawn, I can see in 
> fact they are straightlines, if I record down all these straightlines' 
> starting and ending points(I am not sure they are in good order for 
> polygon fill, etc. It seems to me that they are not in counterclockwise,

> or anyother orders...) how do I fill the outlines using information of 
> these starting and ending points?
>
> thanks a lot
>
 




 2 Posts in Topic:
How to fill Truetype glyph outlines into Black and white solid i
"lucy" <lose  2005-03-04 22:24:46 
Re: How to fill Truetype glyph outlines into Black and white sol
"Laptop2" <d  2005-03-05 11:02:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 8:22:26 CST 2008.