class FluidbookFontToWoff
{
+ /*
+ *
+ * Code à réutiliser dans le fichier Compiler.php
+ * Nom de la fonction : addFont()
+ *
+ */
public static function fontforge($dest, $filepath) {
if (!file_exists($dest) || filemtime($dest) < filemtime($filepath)) {
$script = resource_path('tools/fonts/convertrn.pe');
if (isset($fontCapHeight) && isset($fontHeight) && is_numeric($fontCapHeight) && is_numeric($fontHeight)) {
$capHeight = $fontCapHeight / $fontHeight;
}
- return ['family' => $hash, 'capHeight' => $capHeight, 'ascender' => $fontHeight > 0 ? $ascender / $fontHeight : 1, 'descender' => $fontHeight > 0 ? $descender / $fontHeight : 1];
+ return ['family' => $hash, 'capHeight' => $capHeight, 'ascender' => isset($fontHeight) && $fontHeight > 0 ? $ascender / $fontHeight : 1, 'descender' => isset($fontHeight) && $fontHeight > 0 ? $descender / $fontHeight : 1];
}
}