Interface ScalerDebugger


  • public interface ScalerDebugger
    Receives events during the process of hinting and rasterizing glyphs. This interface is intended for development purposes only. During the development of Scalers, it is useful to have access to internal data structures. In a typical C/C++ environment, this is achieved with debugging code bracketed by #IFDEF statements. This technique is no available in Java; here is the pattern we follow instead: - this interface is meant to be called by the scalers, so that they can communicate interesting events and values to outside. - scalers have a Scaler.setDebugger(ScalerDebugger) method which can be called by the development environment to provide an implementation of this interface, and therefore receive events. This method typically stores the ScalerDebugger instance in a field, e.g. debugger. - inside a scaler, the typical pattern is at an instrumentation point is: if (ScalerDebugger.debugOn && debugger != null) { this.debugger.foo (...); } Note that all the code related to debugging is protected the static final boolean debugOn. If that constant is false (the normal value for checked-in code and therefore for shipped code), then much of the code related to debugging is eliminated by the compiler, and we are left with a small overhead (a trivial setDebugger method in the scalers, a field, and the class for this interface). During development, one can set this constant to true to get fully functional debugging.
    • Field Detail

      • debugOn

        static final boolean debugOn
        Enable or disable debugging support.
        See Also:
        Constant Field Values
    • Method Detail

      • ttInterpLog

        void ttInterpLog​(java.lang.String s)
      • cscanCross

        void cscanCross​(double x,
                        double y)
      • unhintedTTOutline

        void unhintedTTOutline​(TTOutline outline)
      • hintedTTOutline

        void hintedTTOutline​(TTOutline outline)
      • ttScanScanType

        void ttScanScanType​(int scanType)
      • ttScanLog

        void ttScanLog​(java.lang.String s)
      • ttScanLine

        void ttScanLine​(int x1,
                        int y1,
                        int x2,
                        int y2)
      • ttScanQuadCurve

        void ttScanQuadCurve​(int x1,
                             int y1,
                             int x2,
                             int y2,
                             int x3,
                             int y3)
      • ttScanHCross

        void ttScanHCross​(int coordOnScanLine,
                          int scanLineCoordI,
                          boolean on)
      • ttScanVCross

        void ttScanVCross​(int coordOnScanLine,
                          int scanLineCoordI,
                          boolean on)