Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » CSS font(Get different string extent running the same application.CSS, StringExtent, Widget...)
CSS font [message #531748] Thu, 06 May 2010 02:22 Go to next message
lsq  is currently offline lsq Friend
Messages: 40
Registered: July 2009
Member
I am implementing a widget whose size depends on the font it is using. I use themming from a CSS file where default font are defined. I suppose the widget I am working on will inherit the font type from css which is decided before widget is rendered. However when debuging the I find different values from Graphics.stringExtent(font, string) method, and I am sure that the samet font returned from Control.getFont method and used as the parameter. So I guess this is the problem of the implementation ofGraphics.stringExtent which returns different value when I simply refresh the web page.
Re: CSS font [message #531750 is a reply to message #531748] Thu, 06 May 2010 02:30 Go to previous messageGo to next message
lsq  is currently offline lsq Friend
Messages: 40
Registered: July 2009
Member
More information, I am using 1.3M6 as the platform and a different value returned when I try to refresh the page and all widgets are re-rendered.

Thanks in advance.
Re: CSS font [message #531817 is a reply to message #531748] Thu, 06 May 2010 08:44 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

maybe your observation is related to the way the text size determination
works in RAP. Before text sizes are measured on the client, it uses an
estimated value. This only affects the first session that renders the
string.

Ralf

lsq wrote:
> I am implementing a widget whose size depends on the font it is using. I
> use themming from a CSS file where default font are defined. I suppose
> the widget I am working on will inherit the font type from css which is
> decided before widget is rendered. However when debuging the I find
> different values from Graphics.stringExtent(font, string) method, and I
> am sure that the samet font returned from Control.getFont method and
> used as the parameter. So I guess this is the problem of the
> implementation ofGraphics.stringExtent which returns different value
> when I simply refresh the web page.
Previous Topic:Migrating the exsisting Application
Next Topic:NullPointerException and RuntimeException Occurs when refresh the page
Goto Forum:
  


Current Time: Fri Apr 26 10:01:21 GMT 2024

Powered by FUDForum. Page generated in 0.02860 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top