 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Orna Vel via JavaKB.com Guest
|
Posted: Wed Apr 27, 2005 7:28 pm Post subject: Problem with Font.createGlyphVector(frc, String) |
|
|
Hello, I have the following problem:
I create a GlyphVector, and drawing this GlyphVector later.
It works fine with regular string, but if string starts from blanks,
they are disappear. It means, that if I have
String s = new String(" tex t");
the drawing appears to be "tex t". Blanks inside the string or at the end
of the string do not cause any problem.
Any thoughts?
Thank you.
P.S. I have found a very similar question oin this forum without an answer.
|
|
| Back to top |
|
 |
Orna Vel via JavaKB.com Guest
|
Posted: Thu Apr 28, 2005 10:24 pm Post subject: Re: Problem with Font.createGlyphVector(frc, String) |
|
|
It means that nobody had this problem before?
It appears just sometime. As I found, if you call
code:
----------------------------------------------------------------------------
----
Graphics2D g2D;FontRenderContext frc = g2D.getFontRenderContext();String
string = new String (" test ");GlyphVector gV = Font.createGlyphVector
(frc, string); g2D.drawGlyphVector ( gV ,0 ,0 );
----------------------------------------------------------------------------
----
everything works fine, but
if you want to draw SHAPE here is the problem:
code:
----------------------------------------------------------------------------
----
Shape dispElement;Graphics2D g2D;FontRenderContext frc =
g2D.getFontRenderContext();String string = new String (" test ")
;GlyphVector gV = Font.createGlyphVector(frc, string); dispElement =
gV.getOutline();g2D.fill(dispElement);
----------------------------------------------------------------------------
----
the leading blanks are disappear. Too bad.
--
Message posted via http://www.javakb.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|