Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25767

Re: filling glyphs

From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: filling glyphs
Date 2011-02-03 16:12 -0500
Organization The Wasteland
Message-ID <nospam-A30C38.16124403022011@news.aioe.org> (permalink)
References <4d4a80b0$0$2443$65785112@news.neostrada.pl>

Show all headers | View raw


In article <4d4a80b0$0$2443$65785112@news.neostrada.pl>,
 emilio <ew@gryftechnologia.com> wrote:

> Hi everyone, do you know what is the best algorithm to fill object 
> which contour consists of lines and bezier curves. I use the flood 
> fill algorithm based on Smith, but it does not work with small 
> letters because in places where there is a narrow passage it stop.Of 
> course, I tried to start filling in a few places but still remain 
> unfilled place. Maybe you know some other algorithms that work with 
> these types of objects. How it is done eg in Corel?

Have you looked into GlyphVector [1]. The getOutline() method returns a 
Shape suitable for Graphics2D's fill() method. For smaller sizes, I 
usually rely on TextLayout [2], as the associated FontRenderContext can 
handle (possibly platform-dependent) anti-aliasing and fractional 
metrics. 

[1]<http://download.oracle.com/javase/6/docs/api/java/awt/font/GlyphVector.html>
[2]<http://download.oracle.com/javase/6/docs/api/java/awt/font/TextLayout.html>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: filling glyphs "John B. Matthews" <nospam@nospam.invalid> - 2011-02-03 16:12 -0500
  Re: filling glyphs emilio <ew@gryftechnologia.com> - 2011-02-04 10:09 +0100

csiph-web