Bug 160620 - Browser widget accessibility font options
Summary: Browser widget accessibility font options
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2.1   Edit
Hardware: All All
: P3 enhancement with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 177365 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-12 02:08 EDT by Andy Cheadle CLA
Modified: 2015-10-21 22:20 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Cheadle CLA 2006-10-12 02:08:48 EDT
Hi,

Firstly, big thanks to all you guys out there that make eclipse and SWT tick!

I'm developing an RCP application based on a web browser based prototype.
The RCP environment is a much better hosting environment for the application. However, although the browser widget has rather limited functionality, the only
thing that really seems to be missing is the ability to control font sizes for accessibility options. This is somemthing that is impractical to be controlled from style sheets.

Is there any plan to add control over font /  font style / font size to the widget? If not, this is an enhancement request for such a feature.

Many thanks!

Andy
Comment 1 Grant Gayed CLA 2006-10-12 09:35:16 EDT
I'm not sure if this would become Browser api, but it should become doable once the eclipse 3.3 plan item in bug 154124 is addressed.

Note to self: nsIDOMWindow->SetTextZoom .
Comment 2 Grant Gayed CLA 2007-03-14 15:01:44 EDT
*** Bug 177365 has been marked as a duplicate of this bug. ***
Comment 3 Grant Gayed CLA 2009-09-30 12:42:05 EDT
FYI here's how zooming is done with a SWT.MOZILLA style Browser (requires XULRunner >= 1.9):

public class Snippet329 {
	static int zoom = 10;
	static Browser browser;

public static void main(String [] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setLayout(new GridLayout(2, true));

	try {
		browser = new Browser(shell, SWT.MOZILLA);
	} catch (SWTError e) {
		System.out.println("Could not instantiate Browser: " + e.getMessage());
		display.dispose();
		return;
	}
	GridData data = new GridData();
	data.heightHint = data.widthHint = 400;
	data.horizontalSpan = 2;
	browser.setLayoutData(data);

	Button zoomIn = new Button(shell, SWT.PUSH);
	zoomIn.setText("Zoom In");
	zoomIn.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event event) {
			setZoom(++zoom);
		}
	});
	Button zoomOut = new Button(shell, SWT.PUSH);
	zoomOut.setText("Zoom Out");
	zoomOut.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event event) {
			if (zoom > 1) {
				setZoom(--zoom);
			}
		}
	});

	shell.pack();
	shell.open();
	browser.setUrl("http://www.eclipse.org");
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) display.sleep();
	}
	display.dispose();
}
static void setZoom(int zoom) {
	nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser();
	nsIInterfaceRequestor req = (nsIInterfaceRequestor)webBrowser.queryInterface(nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID);
	nsIDocShell docShell = (nsIDocShell)req.getInterface(nsIDocShell.NS_IDOCSHELL_IID);
	nsIContentViewer contentView = docShell.getContentViewer();
	nsIMarkupDocumentViewer docView = (nsIMarkupDocumentViewer)contentView.queryInterface(nsIMarkupDocumentViewer.NS_IMARKUPDOCUMENTVIEWER_IID);
	float value = zoom / 10f;
	System.out.println("zoom: " + value);
	docView.setFullZoom(value);
}
}
Comment 4 Carolyn MacLeod CLA 2011-12-16 11:58:59 EST
Not sure if this is helpful for zooming programmatically in IE.
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/e542c4e6-acb6-44d4-b742-beab5528ac74