AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with Font.createGlyphVector(frc, String)

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Orna Vel via JavaKB.com
Guest





PostPosted: Wed Apr 27, 2005 7:28 pm    Post subject: Problem with Font.createGlyphVector(frc, String) Reply with quote



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





PostPosted: Thu Apr 28, 2005 10:24 pm    Post subject: Re: Problem with Font.createGlyphVector(frc, String) Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.