Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360814

Summary: Add GC.textExtent(String string, int flags)
Product: [RT] RAP Reporter: Tobias Liefke <eclipse>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: igor.novakovic
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.