Interface FontMetricsProvider

All Known Implementing Classes:
BoldPaintInstruction, ItalicPaintInstruction, ResetFontPaintInstruction, ResetSpanStylePaintInstruction, SpanStylePaintInstruction

public interface FontMetricsProvider
Implementations of this interface typically perform modifications to a Font and therefore need to be able to supply the FontMetrics of the font after the modifications are done.
  • Method Summary

    Modifier and Type Method Description
    org.eclipse.swt.graphics.FontMetrics getFontMetrics​(org.eclipse.swt.graphics.GC gc)
    Calculates the FontMetrics based on the font information of this FontMetricsProvider in conjunction with the current set font information set to the given GC.
  • Method Details

    • getFontMetrics

      org.eclipse.swt.graphics.FontMetrics getFontMetrics​(org.eclipse.swt.graphics.GC gc)
      Calculates the FontMetrics based on the font information of this FontMetricsProvider in conjunction with the current set font information set to the given GC.

      Note: To retrieve the FontMetrics it is necessary to set the Font based on the local font information and the current applied font. You should not reset the Font on the GC in this method again, because the font information might be used by other FontMetricsProvider.

      Parameters:
      gc - The GC that should be used to retrieve the FontMetrics
      Returns:
      The FontMetrics based on the font information of this FontMetricsProvider in conjunction with the current set font information set to the given GC.