protected function registerCalculator()
    {
        $this->app->singleton(TextSizeCalculatorInterface::class, function () {
            $path = __DIR__.'/../resources/fonts/DejaVuSans.ttf';

            return new GDTextSizeCalculator(realpath($path) ?: $path);
        });

        $this->app->singleton('badger.calculator', TextSizeCalculatorInterface::class);
    }
protected function registerCalculator()
    {
        $this->app->singleton(TextSizeCalculatorInterface::class, function () {
            $path = __DIR__.'/../resources/fonts/DejaVuSans.ttf';

            return new GDTextSizeCalculator(realpath($path) ?: $path);
        });

        $this->app->singleton('badger.calculator', TextSizeCalculatorInterface::class);
    }
protected function registerCalculator ( ) { $ this -> app -> singleton ( TextSizeCalculatorInterface :: class , function ( ) { $ path = __DIR__ . '/../resources/fonts/DejaVuSans.ttf' ; return new GDTextSizeCalculator ( realpath ( $ path ) ? : $ path ) ; } ) ; $ this -> app -> singleton ( 'badger.calculator' , TextSizeCalculatorInterface :: class ) ; }
Register the calculator class.

@return void
Register the calculator class .