-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
517 additions
and
585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ on: | |
secrets: | ||
ARTIFACTORY: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.config.build_machine }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,5 @@ versions: | |
folder: "all" | ||
"4.1.0": | ||
folder: "all" | ||
"4.1.0-pdf2htmlex-git": | ||
folder: "all" | ||
"4.1.1": | ||
folder: "all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
sources: | ||
"0.18.8.rc1-20240905-git": | ||
url: "https://github.com/ViliusSutkus89/pdf2htmlEX/archive/0bbd6686f7214c5ddb230fa3323b75e954f39418.zip" | ||
sha256: "394a5a5555005a18ada6f810ef7ab693f6d916cd9302d874483cbc4956caf557" | ||
"0.18.8.rc1-git-6f85c88": | ||
url: "https://github.com/opendocument-app/pdf2htmlEX/archive/refs/tags/v0.18.8.rc1-git-6f85c88.tar.gz" | ||
sha256: "b88c0897c26caaba62c84069a22043be703a495852af3d9af9d63e18fde2296e" | ||
patches: | ||
"0.18.8.rc1-git-6f85c88": | ||
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0001-Upgrade-Poppler-to-24.06.1.patch" | ||
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0002-Update-missing-font-workaround.patch" | ||
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0003-use-find_package.patch" | ||
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0004-build-and-install-library.patch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
recipes/pdf2htmlex/all/patches/0.18.8.rc1-git-6f85c88/0001-Upgrade-Poppler-to-24.06.1.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
From 5e5a947bd1320e19c1271f5dfaeef098baae4452 Mon Sep 17 00:00:00 2001 | ||
From: Vilius Sutkus '89 <[email protected]> | ||
Date: Thu, 13 Jun 2024 14:18:06 +0300 | ||
Subject: [PATCH 1/4] Upgrade Poppler to 24.06.1 | ||
|
||
Poppler-24.02.0 OutlineItem changed Title from Unicode pointer and length counter into Unicode vector. ( https://gitlab.freedesktop.org/poppler/poppler/-/commit/fc1c711cb5f769546c6b31cc688bf0ee7f0c1dbc ) | ||
|
||
Poppler-24.03.0 GooString.h exposes std::string::starts_with and ::ends_with which are CXX20. | ||
--- | ||
buildScripts/versionEnvs | 5 ++- | ||
pdf2htmlEX/CMakeLists.txt | 4 +- | ||
pdf2htmlEX/src/HTMLRenderer/outline.cc | 2 +- | ||
pdf2htmlEX/src/util/encoding.cc | 60 +++++++++++++++----------- | ||
pdf2htmlEX/src/util/encoding.h | 2 + | ||
5 files changed, 44 insertions(+), 29 deletions(-) | ||
|
||
diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs | ||
index 3ea6cba..9ef5f8b 100755 | ||
--- a/buildScripts/versionEnvs | ||
+++ b/buildScripts/versionEnvs | ||
@@ -4,11 +4,12 @@ | ||
# versions | ||
|
||
# see: https://poppler.freedesktop.org/releases.html | ||
-# current working: 24.01.0 | ||
+# current working: 24.06.1 | ||
|
||
export PDF2HTMLEX_VERSION=0.18.8.rc2 | ||
|
||
-export POPPLER_VERSION=poppler-24.01.0 | ||
+export POPPLER_VERSION=poppler-24.06.1 | ||
+#export POPPLER_VERSION=poppler-24.01.0 | ||
#export POPPLER_VERSION=poppler-23.12.0 | ||
#export POPPLER_VERSION=poppler-21.02.0 | ||
#export POPPLER_VERSION=poppler-0.89.0 | ||
diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt | ||
index 761bb21..84b4a98 100644 | ||
--- a/pdf2htmlEX/CMakeLists.txt | ||
+++ b/pdf2htmlEX/CMakeLists.txt | ||
@@ -125,8 +125,8 @@ set(CMAKE_THREAD_PREFER_PTHREAD ON) | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} Threads::Threads) | ||
-# Poppler-23.12.0 requires CXX17 | ||
-set(CMAKE_CXX_STANDARD 17) | ||
+# Poppler-24.03.0 requires CXX20 | ||
+set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
if(NOT CYGWIN) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
diff --git a/pdf2htmlEX/src/HTMLRenderer/outline.cc b/pdf2htmlEX/src/HTMLRenderer/outline.cc | ||
index 4fdc826..28415c8 100644 | ||
--- a/pdf2htmlEX/src/HTMLRenderer/outline.cc | ||
+++ b/pdf2htmlEX/src/HTMLRenderer/outline.cc | ||
@@ -42,7 +42,7 @@ void HTMLRenderer::process_outline_items(const std::vector<OutlineItem*> * items | ||
|
||
f_outline.fs << ">"; | ||
|
||
- writeUnicodes(f_outline.fs, item->getTitle(), item->getTitleLength()); | ||
+ writeUnicodes(f_outline.fs, item->getTitle()); | ||
|
||
f_outline.fs << "</a>"; | ||
|
||
diff --git a/pdf2htmlEX/src/util/encoding.cc b/pdf2htmlEX/src/util/encoding.cc | ||
index 6b600bc..1e3fc29 100644 | ||
--- a/pdf2htmlEX/src/util/encoding.cc | ||
+++ b/pdf2htmlEX/src/util/encoding.cc | ||
@@ -55,34 +55,46 @@ static int mapUTF8(Unicode u, char *buf, int bufSize) | ||
} | ||
} | ||
|
||
+static void writeUnicode(ostream & out, const Unicode u) { | ||
+ switch(u) | ||
+ { | ||
+ case '&': | ||
+ out << "&"; | ||
+ break; | ||
+ case '\"': | ||
+ out << """; | ||
+ break; | ||
+ case '\'': | ||
+ out << "'"; | ||
+ break; | ||
+ case '<': | ||
+ out << "<"; | ||
+ break; | ||
+ case '>': | ||
+ out << ">"; | ||
+ break; | ||
+ default: | ||
+ { | ||
+ char buf[4]; | ||
+ auto n = mapUTF8(u, buf, 4); | ||
+ out.write(buf, n); | ||
+ } | ||
+ } | ||
+} | ||
+ | ||
void writeUnicodes(ostream & out, const Unicode * u, int uLen) | ||
{ | ||
for(int i = 0; i < uLen; ++i) | ||
{ | ||
- switch(u[i]) | ||
- { | ||
- case '&': | ||
- out << "&"; | ||
- break; | ||
- case '\"': | ||
- out << """; | ||
- break; | ||
- case '\'': | ||
- out << "'"; | ||
- break; | ||
- case '<': | ||
- out << "<"; | ||
- break; | ||
- case '>': | ||
- out << ">"; | ||
- break; | ||
- default: | ||
- { | ||
- char buf[4]; | ||
- auto n = mapUTF8(u[i], buf, 4); | ||
- out.write(buf, n); | ||
- } | ||
- } | ||
+ writeUnicode(out, u[i]); | ||
+ } | ||
+} | ||
+ | ||
+void writeUnicodes(ostream & out, const std::vector<Unicode> & u) | ||
+{ | ||
+ for(const auto & i: u) | ||
+ { | ||
+ writeUnicode(out, i); | ||
} | ||
} | ||
|
||
diff --git a/pdf2htmlEX/src/util/encoding.h b/pdf2htmlEX/src/util/encoding.h | ||
index c4d7732..da3c00f 100644 | ||
--- a/pdf2htmlEX/src/util/encoding.h | ||
+++ b/pdf2htmlEX/src/util/encoding.h | ||
@@ -9,6 +9,7 @@ | ||
#define ENCODING_H__ | ||
|
||
#include <string> | ||
+#include <vector> | ||
#include <iostream> | ||
|
||
#include <CharTypes.h> | ||
@@ -19,6 +20,7 @@ namespace pdf2htmlEX { | ||
* Escape necessary characters, and map Unicode to UTF-8 | ||
*/ | ||
void writeUnicodes(std::ostream & out, const Unicode * u, int uLen); | ||
+void writeUnicodes(std::ostream & out, const std::vector<Unicode> & u); | ||
|
||
|
||
/* | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
28 changes: 28 additions & 0 deletions
28
...s/pdf2htmlex/all/patches/0.18.8.rc1-git-6f85c88/0002-Update-missing-font-workaround.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 2110b5eaa45decf7ee222953642af5c7967e0424 Mon Sep 17 00:00:00 2001 | ||
From: Vilius Sutkus '89 <[email protected]> | ||
Date: Mon, 5 Aug 2024 21:35:29 +0300 | ||
Subject: [PATCH 2/4] Update missing font workaround | ||
|
||
--- | ||
pdf2htmlEX/src/HTMLRenderer/font.cc | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/pdf2htmlEX/src/HTMLRenderer/font.cc b/pdf2htmlEX/src/HTMLRenderer/font.cc | ||
index 9c3112b..ff27da2 100644 | ||
--- a/pdf2htmlEX/src/HTMLRenderer/font.cc | ||
+++ b/pdf2htmlEX/src/HTMLRenderer/font.cc | ||
@@ -1080,7 +1080,10 @@ static string general_font_family(GfxFont * font) | ||
// TODO: this function is called when some font is unable to process, may use the name there as a hint | ||
void HTMLRenderer::export_remote_default_font(long long fn_id) | ||
{ | ||
- f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; | ||
+// Workaround for https://github.com/opendocument-app/pdf2htmlEX-Android/issues/94 | ||
+// Workaround for https://github.com/opendocument-app/OpenDocument.droid/issues/348 | ||
+// f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; | ||
+ f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:visible;}" << endl; | ||
} | ||
|
||
void HTMLRenderer::export_local_font(const FontInfo & info, GfxFont * font, const string & original_font_name, const string & cssfont) | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|
Oops, something went wrong.