Class HiDPIProportionalFontSizePolicy

  • All Implemented Interfaces:
    IFontSizePolicy

    public class HiDPIProportionalFontSizePolicy
    extends Object
    implements IFontSizePolicy
    This is the greatest IFontSizePolicy since it scale base font with current pixel scale. This is mainly useful to keep the same text size visually when a chart is moved from a HiDPI screen to a non HiDPI screen. The base font is based on IAxisLayout#getFont().
    Author:
    Martin Pernollet
    • Field Detail

      • view

        protected View view
      • baseFont

        protected Font baseFont
      • apply_WindowsHiDPI_Workaround

        protected boolean apply_WindowsHiDPI_Workaround
    • Constructor Detail

      • HiDPIProportionalFontSizePolicy

        public HiDPIProportionalFontSizePolicy​(View view)
    • Method Detail

      • apply

        public Font apply​(AxisLayout layout)
        Modifies the IAxisLayout font according to the pixel scale returned by the View and the font that was returned by IAxisLayout at the first call to this method.
        Specified by:
        apply in interface IFontSizePolicy