I've can reproduce the "glyph filled hole" error. It turns out it's due to
an unwarranted assumption in the ShapeReader, to do with the identification
of shells and holes in Java2D Paths.  This is going to be tricky to fix, so
might not get to it for a bit...

I haven't been able to reproduce the "fewer than 3 pts" error yet.

On Wed, May 27, 2015 at 9:37 AM, Johannes Kröger <
[email protected]> wrote:

> 1) Yeah, it worked here too, resulting in a sans-serif font. Magick!
> Probably some default fallback?
>
> 2&3) Minimal example with "DejaVu Sans" which should be freely
> available for any system. Uncomment the case you want to test.
>
> // START
> GeometryFactory gf = new GeometryFactory();
> Font font = new Font("DejaVu Sans", 0, 48);
>
> // "Ring has fewer than 3 points, so orientation
> // cannot be determined"
> //String text = "u";
>
> // a, g, o, p will have filled holes
> // d, e, p will be fine
> //String text = "adegopq";
>
> Geometry g = FontGlyphReader.read(text, font, gf);
> System.out.println(g);
> // END
>
> For me it's size independent. If I say filled holes I mean that
> visually, I have not further looked into the actual geometries so see
> what might happen. It's just a "drive-by" bug I found and as I use the
> font rendering just for some amusement of students it's not something I
> should sink much time into. ;)
>
> I am on 1.13.0 btw.
>
> Cheers, Hannes
>
>
> On Wed, 27 May 2015 08:53:51 -0700
> Martin Davis <[email protected]> wrote:
>
> > 1) Good catch.  I'll add a FONT_SANSSERIF constant, and fix the
> > constant values to be correct (although surprisingly the incorrect
> > value seems to work for me...)
> >
> > 2&3)  I can't reproduce this.  Perhaps it has something to do with the
> > pointsize? Can you provide a code sample showing the problem?
> >
> > On Wed, May 27, 2015 at 6:19 AM, Johannes Kröger <
> > [email protected]> wrote:
> >
> > > Hi everyone,
> > >
> > > as creating tickets requires a SourceForge account and I do not want
> > > one, here are some bugs with FontGlyphReader I bumped in recently.
> > >
> > > 1) FontGlyphReader.java: FONT_SANSERIF should be FONT_SANSSERIF.
> > > I guess it would break other peoples' code if changed now though.
> > >
> > > 2) The FontGlyphReader sometimes fails to create a geometry. This
> > > seems to depend on the font. For example on my system when using
> > > FONT_SANSERIF rendering the letter "u" leads to a
> > > "java.lang.IllegalArgumentException: Ring has fewer than 4 points,
> > > so orientation cannot be determined at
> > >
> com.vividsolutions.jts.algorithm.CGAlgorithms.isCCW(CGAlgorithms.java:214)
> > > at
> > > com.vividsolutions.jts.awt.ShapeReader.isHole(ShapeReader.java:133)"
> > > It works fine with FONT_SERIF. I am not sure which font it actually
> > > picks in the background. If you tell me how find out, I can try to
> > > nail down the problem.
> > >
> > > 3) The FontGlyphReader sometimes fails to create proper polygons
> > > with holes for letters that have holes in them. Instead the holes
> > > are filled. For example if I print a-z, aopöä will have their holes
> > > filled, while the others (eg deqg) are rendered correctly.
> > >
> > > All the best, Hannes
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------------
> > > _______________________________________________
> > > Jts-topo-suite-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
> > >
>
>
------------------------------------------------------------------------------
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to