Package org.eclipse.swt.internal
Class SWTFontProvider
java.lang.Object
org.eclipse.swt.internal.SWTFontProvider
This internal class is used to provide and cache fonts scaled for different zoom levels in the win32
 implementation. Depending on the configuration of the SWT application, either a default behavior or
 the scaling behavior is used. The default behavior mimics the existing behavior that fonts are scaled
 to the zoom of the primary monitor and are not updated on runtime. The scaling behavior will always
 take the provided values for the zoom into consideration and return scaled variant of a font if necessary.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voiddisposeFontRegistry(Device device) Disposes the font registry for the given device, if one exists.static FontReturns the font with the given fontHandle for the given device at the specified zoom.static FontReturns the font with the given font data for the given device at the specified zoom.static longgetFontHandle(Device device, FontData fontData, int zoom) static longgetFontHandle(Font font, int zoom) static FontgetSystemFont(Device device, int zoom) Returns the system font for the given device at the specified zoom.static longgetSystemFontHandle(Device device, int zoom) 
- 
Constructor Details- 
SWTFontProviderpublic SWTFontProvider()
 
- 
- 
Method Details- 
getSystemFontReturns the system font for the given device at the specified zoom. Note: This operation is not thread-safe. It must thus always be called from the same thread for the same device, such as the display's UI thread.- Parameters:
- device- the device to retrieve the font for, must not be- null
- zoom- the zoom for which the font shall be scaled
 
- 
getSystemFontHandle
- 
getFontReturns the font with the given font data for the given device at the specified zoom. Note: This operation is not thread-safe. It must thus always be called from the same thread for the same device, such as the display's UI thread.- Parameters:
- device- the device to retrieve the font for, must not be- null
- fontData- the data for the font to retrieve, must not be- null
- zoom- the zoom for which the font shall be scaled
 
- 
getFontHandle
- 
getFontHandle
- 
getFontReturns the font with the given fontHandle for the given device at the specified zoom. Note: This operation is not thread-safe. It must thus always be called from the same thread for the same device, such as the display's UI thread.- Parameters:
- device- the device to retrieve the font for, must not be- null
- fontHandle- the handle to an existing font
- zoom- the zoom for which the font shall be scaled
 
- 
disposeFontRegistryDisposes the font registry for the given device, if one exists.- Parameters:
- device- the device to dispose the font registry for, must not be- null
 
 
-