Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360814 - Add GC.textExtent(String string, int flags)
Summary: Add GC.textExtent(String string, int flags)
Status: ASSIGNED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-13 09:06 EDT by Tobias Liefke CLA
Modified: 2011-10-14 06:03 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Liefke CLA 2011-10-13 09:06:15 EDT
The SWT version of GC defines two methods for computing the "extent" of a string:
1. textExtent(String string)
2. textExtent(String string, int flags)
RAP only offers the first one. As text measurement in RAP is not as accurate anyway, I would suggest to implement the second method, too, just for single sourcing. We can ignore the flags for now and just return the same result as the first method (maybe add a "TODO" for inspecting the flags later).
Comment 1 Ralf Sternberg CLA 2011-10-14 06:03:05 EDT
I agree that we can implement this method.

> As text measurement in RAP is not as accurate ...
The text size measurement *is* accurate in RAP. The exact sizes are measured on the client and reported back to the server.

> We can ignore the flags for now and just return the same result as the
> first method (maybe add a "TODO" for inspecting the flags later).
I don't think that we have to ignore the flags. We should be able to support them by applying the requested changes to the text (such as replacement of mnemonics) before measuring.