Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "18 Fonts"

(Class FontMetrics)
(Replaced content with "This page was obsolete and has been deleted. Please see the history if you need to access the content.")
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Comparison SWT / RWT|Back to RWTOverview]]
+
This page was obsolete and has been deleted. Please see the history if you need to access the content.
 
+
==Fonts==
+
 
+
We are facing similar problems with platform-independent font code as SWT does. It is even worse as we don't have access to the available fonts on the system that is displaying the application. Choose your fonts carefully.
+
 
+
===Class FontData===
+
Not yet implemented.
+
 
+
===Class Font===
+
The Font class is somewhat different from SWT. We share fonts application wide and therefore there is no constructor but a static <code>getFont(String,int,int)</code> method to create and/or obtain a font. However the three parameters should be familiar as they denote the name, size and style of the font.
+
 
+
===Drawing Text===
+
Drawing text is based on the Graphics Context, see [[16._Graphics_Fundamentals.]]
+
 
+
=== Class FontMetrics ===
+
 
+
The SWT class <code>FontMetrics</code> provides exact information on font dimensions like distace from baseline to leading etc.
+
Since we don't have access to the client fonts, we cannot provide these information.
+
 
+
==== Font Size Measurements ====
+
 
+
To be able to compute the size of controls, we have to guess the extent of any contained text.
+
For this task, an internal class (<code>FontSizeEstimation</code>) is used.
+
 
+
In the future, it is planned to reconcile the estimated extent with the real size of the rendered widget in a second server-side turnaround.
+
However, the exact machanism has still to be elaborated.
+
 
+
By now, there is no API functionality for font size measurement.
+

Latest revision as of 06:38, 7 January 2014

This page was obsolete and has been deleted. Please see the history if you need to access the content.

Back to the top