Get font scheme from the specified slide.

@param integer $slideNumber The number of slide.
@param string $storageName The presentation storage name.

@return object
@throws Exception
518842
public function getFontScheme($slideNumber, $storageName = '')
    {


        //Build URI to get font scheme
        $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/fontScheme';
        if ($storageName != '') {
            $strURI .= '?storage=' . $storageName;
        }
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return $json->FontScheme;
    }
883855
private function getCharacterWidth($fontName, $fontSize, $char)
    {
        if (!isset($this->sizes[$fontName][$fontSize][$char])) {
            $this->sizes[$fontName][$fontSize][$char] =
                $this->calculateCharacterWith($fontName, $fontSize, $char);
        }

        return $this->sizes[$fontName][$fontSize][$char];
    }
1135014
public function getFormValue(string $name, $default = null, string $separator = null)
    {
        $value = parent::getFormValue($name, null, $separator);

        if ($name === 'avatar') {
            return $this->parseFileProperty($value);
        }

        if (null === $value) {
            if ($name === 'media_order') {
                return implode(',', $this->getMediaOrder());
            }
        }

        return $value ?? $default;
    }
837211
public function getFormatScheme($slideNumber, $storageName = '')
    {


        //Build URI to get format scheme
        $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/formatScheme';
        if ($storageName != '') {
            $strURI .= '?storage=' . $storageName;
        }
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return $json->FormatScheme;
    }
897295
public function getFormat($name, $verbosity = self::SHORT)
    {

        $key = $this->getFormatKey($name, $verbosity);

        if (!isset($this->formatCache[$key])) {
            $this->formatCache[$key] = $this->loadFormat($key);
        }

        return $this->formatCache[$key];

    }
40762
protected function getStoragePath(Storage $storage, FileKey $fileKey)
    {
        return ltrim($storage->getPathPrefix().'/'.$fileKey->getFilePath(), '/');
    }
1368175
public function getFormat(StorageSelection $selection)
    {
        $ext = pathinfo($selection->getId(), PATHINFO_EXTENSION);

        $type = $this->discoverFormat($ext, $selection->getId());

        return $type;
    }
598402
protected function getImagesizeUnknownType($filename)
	{
		// Grab the maximum amount of bytes we might need
		$data = $this->getImage($filename, 0, Type\TypeJpeg::JPEG_MAX_HEADER_SIZE, false);

		if ($data !== false)
		{
			$this->loadAllTypes();
			foreach ($this->type as $imageType)
			{
				$imageType->getSize($filename);

				if (sizeof($this->size) > 1)
				{
					break;
				}
			}
		}
	}
625432
private function getIconPath(FileStorage $entity, string $version) : string
    {
        $imgSizes = (array)Configure::read(sprintf('FileStorage.imageSizes.%s', $entity->get('model')));

        // no image sizes, return default
        if (empty($imgSizes)) {
            return Utility::getFileTypeIcon($entity->get('extension'));
        }

        // sort by size, biggest first and get current version position in the array
        $position = array_search($version, array_keys(Hash::sort($imgSizes, 'width')), true);

        // no position, return default
        if (false === $position) {
            return Utility::getFileTypeIcon($entity->get('extension'));
        }

        $iconSizes = [512, 48, 32, 16];
        // traversing recursively through the icon sizes until it finds the closest one by key position
        $funcGetIconSize = function (int $pos) use ($iconSizes, &$funcGetIconSize) {
            if (! array_key_exists($pos, $iconSizes)) {
                return $funcGetIconSize($pos - 1);
            }

            return $iconSizes[$pos];
        };

        $result = Utility::getFileTypeIcon($entity->get('extension'), sprintf('%dpx', $funcGetIconSize($position)));

        $result = $this->getUrlHelper()->image($result);

        return $result;
    }
962207
public function streamScreenshotAction($themeName, $screenshotNumber)
    {
        $screenshotPath = $this->getScreenshotPath($this->getTheme($themeName), $screenshotNumber);

        try {
            return new BinaryFileResponse($screenshotPath);
        } catch (FileNotFoundException $exception) {
            throw new NotFoundHttpException(sprintf('Screenshot "%s" does not exist', $screenshotPath), $exception);
        }
    }
868034
public function getImageCount($storageName = '', $folder = '')
    {


        $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/images';
        if ($folder != '') {
            $strURI .= '?folder=' . $folder;
        }
        if ($storageName != '') {
            $strURI .= '&storage=' . $storageName;
        }
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return count($json->Images->List);
    }
366626
public function getStoredData($source = null)
    {
        if (null === $source) {
            $result = $this->store;

        } else {
            if (false === isset($this->store[$source])) {
                throw new Doozr_Base_Presenter_Exception(
                    sprintf('No stored data for source (key) "%s"', $source)
                );
            }

            $result = $this->store[$source];
        }

        return $result;
    }
255938
public function getSymbol($name, $value=null, $verbosity = FormatterContract::SHORT)
    {
        $key = $this->getSymbolKey($name, $value, $verbosity);

        if (!isset($this->formatCache[$key])) {
            $this->formatCache[$key] = $this->loadFormat($key);
        }

        if ($name == self::WEEKDAY || $name == self::MONTH) {
            $this->dateFormatCache = [];
        }

        return $this->formatCache[$key];
    }
102290
public function getFormat(StorageSelection $selection)
    {
        $mimeType = $this->mimetypeDiscoverer->discoverMimeType($selection->getId());
        list($mimeType, $subInformation) = array_pad(explode(' ', $mimeType), 2, null);

        $type = $this->mimeTypeToFormat($mimeType, $selection->getId(), $subInformation);

        return $type;
    }
1200269
private function getBundleClassnameFromFolder($folderName)
    {
        if (substr($folderName, -6) == 'Bundle') {
            $folderName = substr($folderName, 0, -6);
        }

        return sprintf(self::BUNDLE_NAME_MASK, $folderName);
    }
115288
public function getStorage($storageName)
    {
        $this->initialize();

        return isset($this->storages[$storageName]) ? $this->storages[$storageName] : null;
    }
1314738
public function getStorage($typeName)
    {
        if (!isset($this->storageMap[$typeName])) {
            $this->storageMap[$typeName] = new NullStorage();
        } elseif (!$this->storageMap[$typeName] instanceof FieldStorage) {
            if (!is_callable($this->storageMap[$typeName])) {
                throw new \RuntimeException("FieldStorage '$typeName' is neither callable or instance");
            }

            $factory = $this->storageMap[$typeName];
            $this->storageMap[$typeName] = call_user_func($factory);
        }

        return $this->storageMap[$typeName];
    }