From 1cae48549f0dfd0b859d02e981501e24cc83c1bb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 19 Apr 2023 15:18:41 +0200 Subject: [PATCH] wait #5871 @0.25 --- app/Jobs/FluidbookCompiler.php | 11 ++++++ resources/tools/fonts/convert.pe | 56 ++++++++++++++++++++++++++++ resources/tools/fonts/descriptors.pe | 49 ++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 resources/tools/fonts/convert.pe create mode 100644 resources/tools/fonts/descriptors.pe diff --git a/app/Jobs/FluidbookCompiler.php b/app/Jobs/FluidbookCompiler.php index f43b1498f..046001503 100644 --- a/app/Jobs/FluidbookCompiler.php +++ b/app/Jobs/FluidbookCompiler.php @@ -2413,12 +2413,15 @@ height="0" width="0" style="display:none;visibility:hidden"> continue; } + + $linksToAdd = [$link]; if ($link->overlapDoublePage() && !$this->isOnePage()) { $linksToAdd[] = $link->getRightClone(); } + foreach ($linksToAdd as $lta) { try { /** @var $lta Link */ @@ -4085,4 +4088,12 @@ height="0" width="0" style="display:none;visibility:hidden"> { return $this->getFluidbook()->getPDFSplitSource($page); } + + public function getWidthForLinks() { + return $this->getWidth() / $this->getLinkScale(); + } + + public function getHeightForLinks() { + return $this->getHeight() / $this->getLinkScale(); + } } diff --git a/resources/tools/fonts/convert.pe b/resources/tools/fonts/convert.pe new file mode 100644 index 000000000..e8e24895f --- /dev/null +++ b/resources/tools/fonts/convert.pe @@ -0,0 +1,56 @@ +#!/usr/bin/fontforge -script +Open($1) +Print("Open font ",$1) +Print("Em size : ",$em); +i=2 +while ( i<=$argc-3 ) + Print ("Merge with font ",$argv[i]) + MergeFonts($argv[i]) + ++i +endloop + +if($argv[i]!="-") + if($iscid==1) + Print("It's a CID Font") + Print("Flatten CID") + CIDFlatten() + endif + + Print("Rewrite font with CMAP ",$argv[i]); + cmap=LoadStringFromFile($argv[i]) + glyphs=StrSplit(cmap,"\\n"); + j=0 + while(j