|SWT Font management in Graphiti [message #1693755]
||Tue, 28 April 2015 07:34
| Jerome S.
Registered: March 2015
I am trying to stress-test programmatically my Graphiti application and I have found something that does not seem optimal in the SWT Font management. Indeed if you create a huge number of Text(s) with the exact same Font properties, it creates one instance of "org.eclipse.swt.graphics.Font" for every instance of Text, even if two Text(s) use the exact same SWT Font! [See PictogramElementDelegate#refreshFont(AbstractText text, Figure label)]
This might be a problem because concretely I need to create at least 5 Text shapes for every "object" I draw in my Graphiti editor and I can't have more than 15xx objects on the screen due to Windows "GDI Objects" limit of 10 000 per process. If I try to create 15xx * 5 Text shapes I reach the "no more handles" limit in SWT.
I think a solution would be to store the SWT Fonts in a FontRegistry instead of creating one Font per Text.
[Updated on: Tue, 28 April 2015 07:36]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02029 seconds