diff --git a/build.sh b/build.sh index 744d31b..c25f4bf 100755 --- a/build.sh +++ b/build.sh @@ -22,7 +22,7 @@ case "$method" in ln -s libfreetype.so.6 libfreetype.so ln -s libharfbuzz.so.0 libharfbuzz.so - ln -s libgumbo.so.1 libgumbo.so + ln -s libgumbo.so.2 libgumbo.so ln -s libdjvulibre.so.21 libdjvulibre.so cd ../thirdparty @@ -48,7 +48,7 @@ case "$method" in cp thirdparty/jbig2dec/.libs/libjbig2dec.so libs cp thirdparty/freetype2/objs/.libs/libfreetype.so libs - cp thirdparty/harfbuzz/src/.libs/libharfbuzz.so libs + cp thirdparty/harfbuzz/build/src/libharfbuzz.so libs cp thirdparty/gumbo/.libs/libgumbo.so libs cp thirdparty/djvulibre/libdjvu/.libs/libdjvulibre.so libs diff --git a/crates/core/src/document/mupdf_sys.rs b/crates/core/src/document/mupdf_sys.rs index 2bcac49..a22e121 100644 --- a/crates/core/src/document/mupdf_sys.rs +++ b/crates/core/src/document/mupdf_sys.rs @@ -3,7 +3,7 @@ use std::mem; pub const FZ_MAX_COLORS: usize = 32; -pub const FZ_VERSION: &str = "1.23.11"; +pub const FZ_VERSION: &str = "1.27.0"; pub const FZ_META_INFO_AUTHOR: &str = "info:Author"; pub const FZ_META_INFO_TITLE: &str = "info:Title"; @@ -14,10 +14,25 @@ pub const FZ_TEXT_PRESERVE_IMAGES: libc::c_int = 4; pub const FZ_TEXT_INHIBIT_SPACES: libc::c_int = 8; pub const FZ_TEXT_DEHYPHENATE: libc::c_int = 16; pub const FZ_TEXT_PRESERVE_SPANS: libc::c_int = 32; -pub const FZ_TEXT_MEDIABOX_CLIP: libc::c_int = 64; +pub const FZ_TEXT_CLIP: libc::c_int = 64; +pub const FZ_TEXT_CLIP_RECT: libc::c_int = 1<<17; +pub const FZ_TEXT_COLLECT_STRUCTURE: libc::c_int = 256; +pub const FZ_TEXT_COLLECT_VECTORS: libc::c_int = 1024; +pub const FZ_TEXT_ACCURATE_BBOXES: libc::c_int = 512; +pub const FZ_TEXT_ACCURATE_ASCENDERS: libc::c_int = 1<<18; +pub const FZ_TEXT_ACCURATE_SIDE_BEARINGS: libc::c_int = 1<<19; +pub const FZ_TEXT_IGNORE_ACTUALTEXT: libc::c_int = 2048; +pub const FZ_TEXT_SEGMENT: libc::c_int = 4096; +pub const FZ_TEXT_PARAGRAPH_BREAK: libc::c_int = 8192; +pub const FZ_TEXT_TABLE_HUNT: libc::c_int = 16384; +pub const FZ_TEXT_USE_CID_FOR_UNKNOWN_UNICODE: libc::c_int = 128; +pub const FZ_TEXT_USE_GID_FOR_UNKNOWN_UNICODE: libc::c_int = 65536; pub const FZ_PAGE_BLOCK_TEXT: libc::c_int = 0; pub const FZ_PAGE_BLOCK_IMAGE: libc::c_int = 1; +pub const FZ_PAGE_BLOCK_STRUCT: libc::c_int = 2; +pub const FZ_PAGE_BLOCK_VECTOR: libc::c_int = 3; +pub const FZ_PAGE_BLOCK_GRID: libc::c_int = 4; pub const CACHE_SIZE: libc::size_t = 32 * 1024 * 1024; @@ -33,10 +48,15 @@ pub enum FzAllocContext {} pub enum FzLocksContext {} pub enum FzCookie {} pub enum FzStoreDropFn {} +pub enum FzStoreDroppableFn {} pub enum FzLinkSetRectFn {} pub enum FzLinkSetUriFn {} pub enum FzLinkDropLinkFn {} pub enum FzSeparations {} +pub enum FzTextStruct {} +pub enum FzGridPositions {} +pub enum FzGridInfo {} +pub enum FzPoolArray {} pub enum FzImage {} #[link(name="mupdf")] @@ -137,23 +157,25 @@ pub struct FzMatrix { pub struct FzStorable { refs: libc::c_int, drop: *mut FzStoreDropFn, + droppable: *mut FzStoreDroppableFn, } #[repr(C)] pub struct FzTextOptions { pub flags: libc::c_int, pub scale: libc::c_float, + pub clip: FzRect, } #[repr(C)] pub struct FzLinkDest { pub loc: FzLocation, - pub kind: libc::c_int, - pub x: libc::c_float, - pub y: libc::c_float, - pub w: libc::c_float, - pub h: libc::c_float, - pub zoom: libc::c_float, + kind: libc::c_int, + x: libc::c_float, + y: libc::c_float, + w: libc::c_float, + h: libc::c_float, + zoom: libc::c_float, } #[repr(C)] @@ -195,15 +217,19 @@ pub struct FzLink { #[repr(C)] pub struct FzTextPage { + refs: libc::c_int, pool: *mut FzPool, - media_box: FzRect, + mediabox: FzRect, pub first_block: *mut FzTextBlock, last_block: *mut FzTextBlock, + last_struct: *mut FzTextStruct, + id_list: *mut FzPoolArray, } #[repr(C)] pub struct FzTextBlock { pub kind: libc::c_int, + id: libc::c_int, pub bbox: FzRect, pub u: FzTextBlockTextImage, prev: *mut FzTextBlock, @@ -215,6 +241,7 @@ pub struct FzTextBlock { pub struct FzTextBlockText { pub first_line: *mut FzTextLine, last_line: *mut FzTextLine, + flags: libc::c_int, } #[derive(Copy, Clone)] @@ -224,15 +251,41 @@ pub struct FzTextBlockImage { image: *mut FzImage, } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct FzTextBlockStruct{ + down: *mut FzTextStruct, + index: libc::c_int, +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct FzTextBlockVector { + flags: u32, + argb: u32, +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct FzTextBlockGrid { + xs: *mut FzGridPositions, + ys: *mut FzGridPositions, + info: *mut FzGridInfo, +} + #[repr(C)] pub union FzTextBlockTextImage { pub text: FzTextBlockText, pub image: FzTextBlockImage, + pub stru: FzTextBlockStruct, + pub vector: FzTextBlockVector, + pub grid: FzTextBlockGrid, } #[repr(C)] pub struct FzTextLine { - wmode: libc::c_int, + wmode: u8, + flags: u8, dir: FzPoint, pub bbox: FzRect, pub first_char: *mut FzTextChar, @@ -244,7 +297,9 @@ pub struct FzTextLine { #[repr(C)] pub struct FzTextChar { pub c: libc::c_int, - color: libc::c_int, + bidi: u16, + flags: u16, + argb: u32, origin: FzPoint, pub quad: FzQuad, size: libc::c_float, @@ -269,7 +324,11 @@ pub struct FzOutline { y: libc::c_float, pub next: *mut FzOutline, pub down: *mut FzOutline, - is_open: libc::c_int, + is_open: libc::c_uint, + flags: libc::c_uint, + r: libc::c_uint, + g: libc::c_uint, + b: libc::c_uint, } impl Default for FzOutline { diff --git a/crates/core/src/document/pdf.rs b/crates/core/src/document/pdf.rs index 1052904..6a68d90 100644 --- a/crates/core/src/document/pdf.rs +++ b/crates/core/src/document/pdf.rs @@ -320,7 +320,7 @@ impl<'a> PdfPage<'a> { pub fn images(&self) -> Option> { unsafe { let mut images: Vec = Vec::new(); - let opts = FzTextOptions { flags: FZ_TEXT_PRESERVE_IMAGES, scale: 1.0 }; + let opts = FzTextOptions { flags: FZ_TEXT_PRESERVE_IMAGES, scale: 1.0, clip: FzRect::default() }; let tp = mp_new_stext_page_from_page(self.ctx.0, self.page, &opts); if tp.is_null() { return None; diff --git a/crates/core/src/font/mod.rs b/crates/core/src/font/mod.rs index 45eca13..b2f3633 100644 --- a/crates/core/src/font/mod.rs +++ b/crates/core/src/font/mod.rs @@ -126,9 +126,11 @@ extern { pub static _binary_NotoSansChakma_Regular_otf: [libc::c_uchar; 29488]; pub static _binary_NotoSansCham_Regular_otf: [libc::c_uchar; 21224]; pub static _binary_NotoSansCherokee_Regular_otf: [libc::c_uchar; 57308]; + pub static _binary_NotoSansChorasmian_Regular_otf: [libc::c_uchar; 12460]; pub static _binary_NotoSansCoptic_Regular_otf: [libc::c_uchar; 21380]; pub static _binary_NotoSansCuneiform_Regular_otf: [libc::c_uchar; 416308]; pub static _binary_NotoSansCypriot_Regular_otf: [libc::c_uchar; 7024]; + pub static _binary_NotoSansCyproMinoan_Regular_otf: [libc::c_uchar; 8568]; pub static _binary_NotoSansDeseret_Regular_otf: [libc::c_uchar; 9016]; pub static _binary_NotoSansDuployan_Regular_otf: [libc::c_uchar; 10276]; pub static _binary_NotoSansEgyptianHieroglyphs_Regular_otf: [libc::c_uchar; 362960]; @@ -145,6 +147,7 @@ extern { pub static _binary_NotoSansInscriptionalParthian_Regular_otf: [libc::c_uchar; 6788]; pub static _binary_NotoSansJavanese_Regular_otf: [libc::c_uchar; 86944]; pub static _binary_NotoSansKaithi_Regular_otf: [libc::c_uchar; 39756]; + pub static _binary_NotoSansKawi_Regular_otf: [libc::c_uchar; 30940]; pub static _binary_NotoSansKayahLi_Regular_otf: [libc::c_uchar; 7100]; pub static _binary_NotoSansKharoshthi_Regular_otf: [libc::c_uchar; 27708]; pub static _binary_NotoSansKhudawadi_Regular_otf: [libc::c_uchar; 14764]; @@ -170,10 +173,12 @@ extern { pub static _binary_NotoSansMongolian_Regular_otf: [libc::c_uchar; 111040]; pub static _binary_NotoSansMro_Regular_otf: [libc::c_uchar; 5608]; pub static _binary_NotoSansMultani_Regular_otf: [libc::c_uchar; 7852]; - pub static _binary_NotoSansNKo_Regular_otf: [libc::c_uchar; 15164]; pub static _binary_NotoSansNabataean_Regular_otf: [libc::c_uchar; 6448]; - pub static _binary_NotoSansNewTaiLue_Regular_otf: [libc::c_uchar; 10884]; + pub static _binary_NotoSansNagMundari_Regular_otf: [libc::c_uchar; 8612]; + pub static _binary_NotoSansNandinagari_Regular_otf: [libc::c_uchar; 86940]; pub static _binary_NotoSansNewa_Regular_otf: [libc::c_uchar; 99568]; + pub static _binary_NotoSansNewTaiLue_Regular_otf: [libc::c_uchar; 10884]; + pub static _binary_NotoSansNKo_Regular_otf: [libc::c_uchar; 15164]; pub static _binary_NotoSansNushu_Regular_otf: [libc::c_uchar; 72472]; pub static _binary_NotoSansOgham_Regular_otf: [libc::c_uchar; 3720]; pub static _binary_NotoSansOlChiki_Regular_otf: [libc::c_uchar; 7024]; @@ -185,7 +190,6 @@ extern { pub static _binary_NotoSansOldSogdian_Regular_otf: [libc::c_uchar; 12260]; pub static _binary_NotoSansOldSouthArabian_Regular_otf: [libc::c_uchar; 4624]; pub static _binary_NotoSansOldTurkic_Regular_otf: [libc::c_uchar; 6884]; - pub static _binary_NotoSansOriya_Regular_otf: [libc::c_uchar; 62564]; pub static _binary_NotoSansOsage_Regular_otf: [libc::c_uchar; 9292]; pub static _binary_NotoSansOsmanya_Regular_otf: [libc::c_uchar; 6784]; pub static _binary_NotoSansPahawhHmong_Regular_otf: [libc::c_uchar; 13024]; @@ -201,6 +205,7 @@ extern { pub static _binary_NotoSansSharada_Regular_otf: [libc::c_uchar; 32824]; pub static _binary_NotoSansShavian_Regular_otf: [libc::c_uchar; 5468]; pub static _binary_NotoSansSiddham_Regular_otf: [libc::c_uchar; 91992]; + pub static _binary_NotoSansSignWriting_Regular_otf: [libc::c_uchar; 2780224]; pub static _binary_NotoSansSogdian_Regular_otf: [libc::c_uchar; 48356]; pub static _binary_NotoSansSoraSompeng_Regular_otf: [libc::c_uchar; 6332]; pub static _binary_NotoSansSoyombo_Regular_otf: [libc::c_uchar; 52036]; @@ -215,6 +220,7 @@ extern { pub static _binary_NotoSansTaiTham_Regular_otf: [libc::c_uchar; 76880]; pub static _binary_NotoSansTaiViet_Regular_otf: [libc::c_uchar; 12280]; pub static _binary_NotoSansTakri_Regular_otf: [libc::c_uchar; 17864]; + pub static _binary_NotoSansTangsa_Regular_otf: [libc::c_uchar; 16908]; pub static _binary_NotoSansThaana_Regular_otf: [libc::c_uchar; 12392]; pub static _binary_NotoSansTifinagh_Regular_otf: [libc::c_uchar; 24776]; pub static _binary_NotoSansTirhuta_Regular_otf: [libc::c_uchar; 52432]; @@ -230,6 +236,7 @@ extern { pub static _binary_NotoSerifBalinese_Regular_otf: [libc::c_uchar; 32348]; pub static _binary_NotoSerifBengali_Regular_otf: [libc::c_uchar; 101332]; pub static _binary_NotoSerifDevanagari_Regular_otf: [libc::c_uchar; 169744]; + pub static _binary_NotoSerifDivesAkuru_Regular_otf: [libc::c_uchar; 27972]; pub static _binary_NotoSerifDogra_Regular_otf: [libc::c_uchar; 19944]; pub static _binary_NotoSerifEthiopic_Regular_otf: [libc::c_uchar; 113328]; pub static _binary_NotoSerifGeorgian_Regular_otf: [libc::c_uchar; 31988]; @@ -238,18 +245,23 @@ extern { pub static _binary_NotoSerifGurmukhi_Regular_otf: [libc::c_uchar; 26992]; pub static _binary_NotoSerifHebrew_Regular_otf: [libc::c_uchar; 15320]; pub static _binary_NotoSerifKannada_Regular_otf: [libc::c_uchar; 89032]; + pub static _binary_NotoSerifKhitanSmallScript_Regular_otf: [libc::c_uchar; 508920]; pub static _binary_NotoSerifKhmer_Regular_otf: [libc::c_uchar; 40436]; pub static _binary_NotoSerifKhojki_Regular_otf: [libc::c_uchar; 60112]; pub static _binary_NotoSerifLao_Regular_otf: [libc::c_uchar; 16196]; + pub static _binary_NotoSerifMakasar_Regular_otf: [libc::c_uchar; 5864]; pub static _binary_NotoSerifMalayalam_Regular_otf: [libc::c_uchar; 45668]; pub static _binary_NotoSerifMyanmar_Regular_otf: [libc::c_uchar; 127564]; pub static _binary_NotoSerifNyiakengPuachueHmong_Regular_otf: [libc::c_uchar; 12208]; + pub static _binary_NotoSerifOldUyghur_Regular_otf: [libc::c_uchar; 15620]; + pub static _binary_NotoSerifOriya_Regular_otf: [libc::c_uchar; 105824]; pub static _binary_NotoSerifSinhala_Regular_otf: [libc::c_uchar; 74924]; pub static _binary_NotoSerifTamil_Regular_otf: [libc::c_uchar; 33752]; - pub static _binary_NotoSerifTangut_Regular_otf: [libc::c_uchar; 2001224]; pub static _binary_NotoSerifTelugu_Regular_otf: [libc::c_uchar; 82032]; pub static _binary_NotoSerifThai_Regular_otf: [libc::c_uchar; 17556]; pub static _binary_NotoSerifTibetan_Regular_otf: [libc::c_uchar; 334156]; + pub static _binary_NotoSerifToto_Regular_otf: [libc::c_uchar; 5732]; + pub static _binary_NotoSerifVithkuqi_Regular_otf: [libc::c_uchar; 42508]; pub static _binary_NotoSerifYezidi_Regular_otf: [libc::c_uchar; 8664]; } @@ -278,9 +290,11 @@ extern { pub static _binary_resources_fonts_noto_NotoSansChakma_Regular_otf_start: [libc::c_uchar; 29488]; pub static _binary_resources_fonts_noto_NotoSansCham_Regular_otf_start: [libc::c_uchar; 21224]; pub static _binary_resources_fonts_noto_NotoSansCherokee_Regular_otf_start: [libc::c_uchar; 57308]; + pub static _binary_resources_fonts_noto_NotoSansChorasmian_Regular_otf_start: [libc::c_uchar; 12460]; pub static _binary_resources_fonts_noto_NotoSansCoptic_Regular_otf_start: [libc::c_uchar; 21380]; pub static _binary_resources_fonts_noto_NotoSansCuneiform_Regular_otf_start: [libc::c_uchar; 416308]; pub static _binary_resources_fonts_noto_NotoSansCypriot_Regular_otf_start: [libc::c_uchar; 7024]; + pub static _binary_resources_fonts_noto_NotoSansCyproMinoan_Regular_otf_start: [libc::c_uchar; 8568]; pub static _binary_resources_fonts_noto_NotoSansDeseret_Regular_otf_start: [libc::c_uchar; 9016]; pub static _binary_resources_fonts_noto_NotoSansDuployan_Regular_otf_start: [libc::c_uchar; 10276]; pub static _binary_resources_fonts_noto_NotoSansEgyptianHieroglyphs_Regular_otf_start: [libc::c_uchar; 362960]; @@ -297,6 +311,7 @@ extern { pub static _binary_resources_fonts_noto_NotoSansInscriptionalParthian_Regular_otf_start: [libc::c_uchar; 6788]; pub static _binary_resources_fonts_noto_NotoSansJavanese_Regular_otf_start: [libc::c_uchar; 86944]; pub static _binary_resources_fonts_noto_NotoSansKaithi_Regular_otf_start: [libc::c_uchar; 39756]; + pub static _binary_resources_fonts_noto_NotoSansKawi_Regular_otf_start: [libc::c_uchar; 30940]; pub static _binary_resources_fonts_noto_NotoSansKayahLi_Regular_otf_start: [libc::c_uchar; 7100]; pub static _binary_resources_fonts_noto_NotoSansKharoshthi_Regular_otf_start: [libc::c_uchar; 27708]; pub static _binary_resources_fonts_noto_NotoSansKhudawadi_Regular_otf_start: [libc::c_uchar; 14764]; @@ -322,10 +337,12 @@ extern { pub static _binary_resources_fonts_noto_NotoSansMongolian_Regular_otf_start: [libc::c_uchar; 111040]; pub static _binary_resources_fonts_noto_NotoSansMro_Regular_otf_start: [libc::c_uchar; 5608]; pub static _binary_resources_fonts_noto_NotoSansMultani_Regular_otf_start: [libc::c_uchar; 7852]; - pub static _binary_resources_fonts_noto_NotoSansNKo_Regular_otf_start: [libc::c_uchar; 15164]; pub static _binary_resources_fonts_noto_NotoSansNabataean_Regular_otf_start: [libc::c_uchar; 6448]; - pub static _binary_resources_fonts_noto_NotoSansNewTaiLue_Regular_otf_start: [libc::c_uchar; 10884]; + pub static _binary_resources_fonts_noto_NotoSansNagMundari_Regular_otf_start: [libc::c_uchar; 8612]; + pub static _binary_resources_fonts_noto_NotoSansNandinagari_Regular_otf_start: [libc::c_uchar; 86940]; pub static _binary_resources_fonts_noto_NotoSansNewa_Regular_otf_start: [libc::c_uchar; 99568]; + pub static _binary_resources_fonts_noto_NotoSansNewTaiLue_Regular_otf_start: [libc::c_uchar; 10884]; + pub static _binary_resources_fonts_noto_NotoSansNKo_Regular_otf_start: [libc::c_uchar; 15164]; pub static _binary_resources_fonts_noto_NotoSansNushu_Regular_otf_start: [libc::c_uchar; 72472]; pub static _binary_resources_fonts_noto_NotoSansOgham_Regular_otf_start: [libc::c_uchar; 3720]; pub static _binary_resources_fonts_noto_NotoSansOlChiki_Regular_otf_start: [libc::c_uchar; 7024]; @@ -337,7 +354,6 @@ extern { pub static _binary_resources_fonts_noto_NotoSansOldSogdian_Regular_otf_start: [libc::c_uchar; 12260]; pub static _binary_resources_fonts_noto_NotoSansOldSouthArabian_Regular_otf_start: [libc::c_uchar; 4624]; pub static _binary_resources_fonts_noto_NotoSansOldTurkic_Regular_otf_start: [libc::c_uchar; 6884]; - pub static _binary_resources_fonts_noto_NotoSansOriya_Regular_otf_start: [libc::c_uchar; 62564]; pub static _binary_resources_fonts_noto_NotoSansOsage_Regular_otf_start: [libc::c_uchar; 9292]; pub static _binary_resources_fonts_noto_NotoSansOsmanya_Regular_otf_start: [libc::c_uchar; 6784]; pub static _binary_resources_fonts_noto_NotoSansPahawhHmong_Regular_otf_start: [libc::c_uchar; 13024]; @@ -353,6 +369,7 @@ extern { pub static _binary_resources_fonts_noto_NotoSansSharada_Regular_otf_start: [libc::c_uchar; 32824]; pub static _binary_resources_fonts_noto_NotoSansShavian_Regular_otf_start: [libc::c_uchar; 5468]; pub static _binary_resources_fonts_noto_NotoSansSiddham_Regular_otf_start: [libc::c_uchar; 91992]; + pub static _binary_resources_fonts_noto_NotoSansSignWriting_Regular_otf_start: [libc::c_uchar; 2780224]; pub static _binary_resources_fonts_noto_NotoSansSogdian_Regular_otf_start: [libc::c_uchar; 48356]; pub static _binary_resources_fonts_noto_NotoSansSoraSompeng_Regular_otf_start: [libc::c_uchar; 6332]; pub static _binary_resources_fonts_noto_NotoSansSoyombo_Regular_otf_start: [libc::c_uchar; 52036]; @@ -367,6 +384,7 @@ extern { pub static _binary_resources_fonts_noto_NotoSansTaiTham_Regular_otf_start: [libc::c_uchar; 76880]; pub static _binary_resources_fonts_noto_NotoSansTaiViet_Regular_otf_start: [libc::c_uchar; 12280]; pub static _binary_resources_fonts_noto_NotoSansTakri_Regular_otf_start: [libc::c_uchar; 17864]; + pub static _binary_resources_fonts_noto_NotoSansTangsa_Regular_otf_start: [libc::c_uchar; 16908]; pub static _binary_resources_fonts_noto_NotoSansThaana_Regular_otf_start: [libc::c_uchar; 12392]; pub static _binary_resources_fonts_noto_NotoSansTifinagh_Regular_otf_start: [libc::c_uchar; 24776]; pub static _binary_resources_fonts_noto_NotoSansTirhuta_Regular_otf_start: [libc::c_uchar; 52432]; @@ -382,6 +400,7 @@ extern { pub static _binary_resources_fonts_noto_NotoSerifBalinese_Regular_otf_start: [libc::c_uchar; 32348]; pub static _binary_resources_fonts_noto_NotoSerifBengali_Regular_otf_start: [libc::c_uchar; 101332]; pub static _binary_resources_fonts_noto_NotoSerifDevanagari_Regular_otf_start: [libc::c_uchar; 169744]; + pub static _binary_resources_fonts_noto_NotoSerifDivesAkuru_Regular_otf_start: [libc::c_uchar; 27972]; pub static _binary_resources_fonts_noto_NotoSerifDogra_Regular_otf_start: [libc::c_uchar; 19944]; pub static _binary_resources_fonts_noto_NotoSerifEthiopic_Regular_otf_start: [libc::c_uchar; 113328]; pub static _binary_resources_fonts_noto_NotoSerifGeorgian_Regular_otf_start: [libc::c_uchar; 31988]; @@ -390,18 +409,23 @@ extern { pub static _binary_resources_fonts_noto_NotoSerifGurmukhi_Regular_otf_start: [libc::c_uchar; 26992]; pub static _binary_resources_fonts_noto_NotoSerifHebrew_Regular_otf_start: [libc::c_uchar; 15320]; pub static _binary_resources_fonts_noto_NotoSerifKannada_Regular_otf_start: [libc::c_uchar; 89032]; + pub static _binary_resources_fonts_noto_NotoSerifKhitanSmallScript_Regular_otf_start: [libc::c_uchar; 508920]; pub static _binary_resources_fonts_noto_NotoSerifKhmer_Regular_otf_start: [libc::c_uchar; 40436]; pub static _binary_resources_fonts_noto_NotoSerifKhojki_Regular_otf_start: [libc::c_uchar; 60112]; pub static _binary_resources_fonts_noto_NotoSerifLao_Regular_otf_start: [libc::c_uchar; 16196]; + pub static _binary_resources_fonts_noto_NotoSerifMakasar_Regular_otf_start: [libc::c_uchar; 5864]; pub static _binary_resources_fonts_noto_NotoSerifMalayalam_Regular_otf_start: [libc::c_uchar; 45668]; pub static _binary_resources_fonts_noto_NotoSerifMyanmar_Regular_otf_start: [libc::c_uchar; 127564]; pub static _binary_resources_fonts_noto_NotoSerifNyiakengPuachueHmong_Regular_otf_start: [libc::c_uchar; 12208]; + pub static _binary_resources_fonts_noto_NotoSerifOldUyghur_Regular_otf_start: [libc::c_uchar; 15620]; + pub static _binary_resources_fonts_noto_NotoSerifOriya_Regular_otf_start: [libc::c_uchar; 105824]; pub static _binary_resources_fonts_noto_NotoSerifSinhala_Regular_otf_start: [libc::c_uchar; 74924]; pub static _binary_resources_fonts_noto_NotoSerifTamil_Regular_otf_start: [libc::c_uchar; 33752]; - pub static _binary_resources_fonts_noto_NotoSerifTangut_Regular_otf_start: [libc::c_uchar; 2001224]; pub static _binary_resources_fonts_noto_NotoSerifTelugu_Regular_otf_start: [libc::c_uchar; 82032]; pub static _binary_resources_fonts_noto_NotoSerifThai_Regular_otf_start: [libc::c_uchar; 17556]; pub static _binary_resources_fonts_noto_NotoSerifTibetan_Regular_otf_start: [libc::c_uchar; 334156]; + pub static _binary_resources_fonts_noto_NotoSerifToto_Regular_otf_start: [libc::c_uchar; 5732]; + pub static _binary_resources_fonts_noto_NotoSerifVithkuqi_Regular_otf_start: [libc::c_uchar; 42508]; pub static _binary_resources_fonts_noto_NotoSerifYezidi_Regular_otf_start: [libc::c_uchar; 8664]; } @@ -633,11 +657,14 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_CHAKMA => &_binary_NotoSansChakma_Regular_otf, HB_SCRIPT_CHAM => &_binary_NotoSansCham_Regular_otf, HB_SCRIPT_CHEROKEE => &_binary_NotoSansCherokee_Regular_otf, + HB_SCRIPT_CHORASMIAN => &_binary_NotoSansChorasmian_Regular_otf, HB_SCRIPT_COPTIC => &_binary_NotoSansCoptic_Regular_otf, HB_SCRIPT_CUNEIFORM => &_binary_NotoSansCuneiform_Regular_otf, HB_SCRIPT_CYPRIOT => &_binary_NotoSansCypriot_Regular_otf, + HB_SCRIPT_CYPRO_MINOAN => &_binary_NotoSansCyproMinoan_Regular_otf, HB_SCRIPT_DESERET => &_binary_NotoSansDeseret_Regular_otf, HB_SCRIPT_DEVANAGARI => &_binary_NotoSerifDevanagari_Regular_otf, + HB_SCRIPT_DIVES_AKURU => &_binary_NotoSerifDivesAkuru_Regular_otf, HB_SCRIPT_DOGRA => &_binary_NotoSerifDogra_Regular_otf, HB_SCRIPT_DUPLOYAN => &_binary_NotoSansDuployan_Regular_otf, HB_SCRIPT_EGYPTIAN_HIEROGLYPHS => &_binary_NotoSansEgyptianHieroglyphs_Regular_otf, @@ -661,8 +688,10 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_JAVANESE => &_binary_NotoSansJavanese_Regular_otf, HB_SCRIPT_KAITHI => &_binary_NotoSansKaithi_Regular_otf, HB_SCRIPT_KANNADA => &_binary_NotoSerifKannada_Regular_otf, + HB_SCRIPT_KAWI => &_binary_NotoSansKawi_Regular_otf, HB_SCRIPT_KAYAH_LI => &_binary_NotoSansKayahLi_Regular_otf, HB_SCRIPT_KHAROSHTHI => &_binary_NotoSansKharoshthi_Regular_otf, + HB_SCRIPT_KHITAN_SMALL_SCRIPT => &_binary_NotoSerifKhitanSmallScript_Regular_otf, HB_SCRIPT_KHMER => &_binary_NotoSerifKhmer_Regular_otf, HB_SCRIPT_KHOJKI => &_binary_NotoSerifKhojki_Regular_otf, HB_SCRIPT_KHUDAWADI => &_binary_NotoSansKhudawadi_Regular_otf, @@ -675,6 +704,7 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_LYCIAN => &_binary_NotoSansLycian_Regular_otf, HB_SCRIPT_LYDIAN => &_binary_NotoSansLydian_Regular_otf, HB_SCRIPT_MAHAJANI => &_binary_NotoSansMahajani_Regular_otf, + HB_SCRIPT_MAKASAR => &_binary_NotoSerifMakasar_Regular_otf, HB_SCRIPT_MALAYALAM => &_binary_NotoSerifMalayalam_Regular_otf, HB_SCRIPT_MANDAIC => &_binary_NotoSansMandaic_Regular_otf, HB_SCRIPT_MANICHAEAN => &_binary_NotoSansManichaean_Regular_otf, @@ -690,6 +720,8 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_MULTANI => &_binary_NotoSansMultani_Regular_otf, HB_SCRIPT_MYANMAR => &_binary_NotoSerifMyanmar_Regular_otf, HB_SCRIPT_NABATAEAN => &_binary_NotoSansNabataean_Regular_otf, + HB_SCRIPT_NAG_MUNDARI => &_binary_NotoSansNagMundari_Regular_otf, + HB_SCRIPT_NANDINAGARI => &_binary_NotoSansNandinagari_Regular_otf, HB_SCRIPT_NEWA => &_binary_NotoSansNewa_Regular_otf, HB_SCRIPT_NEW_TAI_LUE => &_binary_NotoSansNewTaiLue_Regular_otf, HB_SCRIPT_NKO => &_binary_NotoSansNKo_Regular_otf, @@ -704,8 +736,9 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_OLD_SOGDIAN => &_binary_NotoSansOldSogdian_Regular_otf, HB_SCRIPT_OLD_SOUTH_ARABIAN => &_binary_NotoSansOldSouthArabian_Regular_otf, HB_SCRIPT_OLD_TURKIC => &_binary_NotoSansOldTurkic_Regular_otf, + HB_SCRIPT_OLD_UYGHUR => &_binary_NotoSerifOldUyghur_Regular_otf, HB_SCRIPT_OL_CHIKI => &_binary_NotoSansOlChiki_Regular_otf, - HB_SCRIPT_ORIYA => &_binary_NotoSansOriya_Regular_otf, + HB_SCRIPT_ORIYA => &_binary_NotoSerifOriya_Regular_otf, HB_SCRIPT_OSAGE => &_binary_NotoSansOsage_Regular_otf, HB_SCRIPT_OSMANYA => &_binary_NotoSansOsmanya_Regular_otf, HB_SCRIPT_PAHAWH_HMONG => &_binary_NotoSansPahawhHmong_Regular_otf, @@ -721,6 +754,7 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_SHARADA => &_binary_NotoSansSharada_Regular_otf, HB_SCRIPT_SHAVIAN => &_binary_NotoSansShavian_Regular_otf, HB_SCRIPT_SIDDHAM => &_binary_NotoSansSiddham_Regular_otf, + HB_SCRIPT_SIGNWRITING => &_binary_NotoSansSignWriting_Regular_otf, HB_SCRIPT_SINHALA => &_binary_NotoSerifSinhala_Regular_otf, HB_SCRIPT_SOGDIAN => &_binary_NotoSansSogdian_Regular_otf, HB_SCRIPT_SORA_SOMPENG => &_binary_NotoSansSoraSompeng_Regular_otf, @@ -734,14 +768,17 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_TAI_VIET => &_binary_NotoSansTaiViet_Regular_otf, HB_SCRIPT_TAKRI => &_binary_NotoSansTakri_Regular_otf, HB_SCRIPT_TAMIL => &_binary_NotoSerifTamil_Regular_otf, + HB_SCRIPT_TANGSA => &_binary_NotoSansTangsa_Regular_otf, HB_SCRIPT_TELUGU => &_binary_NotoSerifTelugu_Regular_otf, HB_SCRIPT_THAANA => &_binary_NotoSansThaana_Regular_otf, HB_SCRIPT_THAI => &_binary_NotoSerifThai_Regular_otf, HB_SCRIPT_TIBETAN => &_binary_NotoSerifTibetan_Regular_otf, HB_SCRIPT_TIFINAGH => &_binary_NotoSansTifinagh_Regular_otf, HB_SCRIPT_TIRHUTA => &_binary_NotoSansTirhuta_Regular_otf, + HB_SCRIPT_TOTO => &_binary_NotoSerifToto_Regular_otf, HB_SCRIPT_UGARITIC => &_binary_NotoSansUgaritic_Regular_otf, HB_SCRIPT_VAI => &_binary_NotoSansVai_Regular_otf, + HB_SCRIPT_VITHKUQI => &_binary_NotoSerifVithkuqi_Regular_otf, HB_SCRIPT_WANCHO => &_binary_NotoSansWancho_Regular_otf, HB_SCRIPT_WARANG_CITI => &_binary_NotoSansWarangCiti_Regular_otf, HB_SCRIPT_YEZIDI => &_binary_NotoSerifYezidi_Regular_otf, @@ -790,11 +827,14 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_CHAKMA => &_binary_resources_fonts_noto_NotoSansChakma_Regular_otf_start, HB_SCRIPT_CHAM => &_binary_resources_fonts_noto_NotoSansCham_Regular_otf_start, HB_SCRIPT_CHEROKEE => &_binary_resources_fonts_noto_NotoSansCherokee_Regular_otf_start, + HB_SCRIPT_CHORASMIAN => &_binary_resources_fonts_noto_NotoSansChorasmian_Regular_otf_start, HB_SCRIPT_COPTIC => &_binary_resources_fonts_noto_NotoSansCoptic_Regular_otf_start, HB_SCRIPT_CUNEIFORM => &_binary_resources_fonts_noto_NotoSansCuneiform_Regular_otf_start, HB_SCRIPT_CYPRIOT => &_binary_resources_fonts_noto_NotoSansCypriot_Regular_otf_start, + HB_SCRIPT_CYPRO_MINOAN => &_binary_resources_fonts_noto_NotoSansCyproMinoan_Regular_otf_start, HB_SCRIPT_DESERET => &_binary_resources_fonts_noto_NotoSansDeseret_Regular_otf_start, HB_SCRIPT_DEVANAGARI => &_binary_resources_fonts_noto_NotoSerifDevanagari_Regular_otf_start, + HB_SCRIPT_DIVES_AKURU => &_binary_resources_fonts_noto_NotoSerifDivesAkuru_Regular_otf_start, HB_SCRIPT_DOGRA => &_binary_resources_fonts_noto_NotoSerifDogra_Regular_otf_start, HB_SCRIPT_DUPLOYAN => &_binary_resources_fonts_noto_NotoSansDuployan_Regular_otf_start, HB_SCRIPT_EGYPTIAN_HIEROGLYPHS => &_binary_resources_fonts_noto_NotoSansEgyptianHieroglyphs_Regular_otf_start, @@ -818,8 +858,10 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_JAVANESE => &_binary_resources_fonts_noto_NotoSansJavanese_Regular_otf_start, HB_SCRIPT_KAITHI => &_binary_resources_fonts_noto_NotoSansKaithi_Regular_otf_start, HB_SCRIPT_KANNADA => &_binary_resources_fonts_noto_NotoSerifKannada_Regular_otf_start, + HB_SCRIPT_KAWI => &_binary_resources_fonts_noto_NotoSansKawi_Regular_otf_start, HB_SCRIPT_KAYAH_LI => &_binary_resources_fonts_noto_NotoSansKayahLi_Regular_otf_start, HB_SCRIPT_KHAROSHTHI => &_binary_resources_fonts_noto_NotoSansKharoshthi_Regular_otf_start, + HB_SCRIPT_KHITAN_SMALL_SCRIPT => &_binary_resources_fonts_noto_NotoSerifKhitanSmallScript_Regular_otf_start, HB_SCRIPT_KHMER => &_binary_resources_fonts_noto_NotoSerifKhmer_Regular_otf_start, HB_SCRIPT_KHOJKI => &_binary_resources_fonts_noto_NotoSerifKhojki_Regular_otf_start, HB_SCRIPT_KHUDAWADI => &_binary_resources_fonts_noto_NotoSansKhudawadi_Regular_otf_start, @@ -832,6 +874,7 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_LYCIAN => &_binary_resources_fonts_noto_NotoSansLycian_Regular_otf_start, HB_SCRIPT_LYDIAN => &_binary_resources_fonts_noto_NotoSansLydian_Regular_otf_start, HB_SCRIPT_MAHAJANI => &_binary_resources_fonts_noto_NotoSansMahajani_Regular_otf_start, + HB_SCRIPT_MAKASAR => &_binary_resources_fonts_noto_NotoSerifMakasar_Regular_otf_start, HB_SCRIPT_MALAYALAM => &_binary_resources_fonts_noto_NotoSerifMalayalam_Regular_otf_start, HB_SCRIPT_MANDAIC => &_binary_resources_fonts_noto_NotoSansMandaic_Regular_otf_start, HB_SCRIPT_MANICHAEAN => &_binary_resources_fonts_noto_NotoSansManichaean_Regular_otf_start, @@ -847,6 +890,8 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_MULTANI => &_binary_resources_fonts_noto_NotoSansMultani_Regular_otf_start, HB_SCRIPT_MYANMAR => &_binary_resources_fonts_noto_NotoSerifMyanmar_Regular_otf_start, HB_SCRIPT_NABATAEAN => &_binary_resources_fonts_noto_NotoSansNabataean_Regular_otf_start, + HB_SCRIPT_NAG_MUNDARI => &_binary_resources_fonts_noto_NotoSansNagMundari_Regular_otf_start, + HB_SCRIPT_NANDINAGARI => &_binary_resources_fonts_noto_NotoSansNandinagari_Regular_otf_start, HB_SCRIPT_NEWA => &_binary_resources_fonts_noto_NotoSansNewa_Regular_otf_start, HB_SCRIPT_NEW_TAI_LUE => &_binary_resources_fonts_noto_NotoSansNewTaiLue_Regular_otf_start, HB_SCRIPT_NKO => &_binary_resources_fonts_noto_NotoSansNKo_Regular_otf_start, @@ -861,8 +906,9 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_OLD_SOGDIAN => &_binary_resources_fonts_noto_NotoSansOldSogdian_Regular_otf_start, HB_SCRIPT_OLD_SOUTH_ARABIAN => &_binary_resources_fonts_noto_NotoSansOldSouthArabian_Regular_otf_start, HB_SCRIPT_OLD_TURKIC => &_binary_resources_fonts_noto_NotoSansOldTurkic_Regular_otf_start, + HB_SCRIPT_OLD_UYGHUR => &_binary_resources_fonts_noto_NotoSerifOldUyghur_Regular_otf_start, HB_SCRIPT_OL_CHIKI => &_binary_resources_fonts_noto_NotoSansOlChiki_Regular_otf_start, - HB_SCRIPT_ORIYA => &_binary_resources_fonts_noto_NotoSansOriya_Regular_otf_start, + HB_SCRIPT_ORIYA => &_binary_resources_fonts_noto_NotoSerifOriya_Regular_otf_start, HB_SCRIPT_OSAGE => &_binary_resources_fonts_noto_NotoSansOsage_Regular_otf_start, HB_SCRIPT_OSMANYA => &_binary_resources_fonts_noto_NotoSansOsmanya_Regular_otf_start, HB_SCRIPT_PAHAWH_HMONG => &_binary_resources_fonts_noto_NotoSansPahawhHmong_Regular_otf_start, @@ -878,6 +924,7 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_SHARADA => &_binary_resources_fonts_noto_NotoSansSharada_Regular_otf_start, HB_SCRIPT_SHAVIAN => &_binary_resources_fonts_noto_NotoSansShavian_Regular_otf_start, HB_SCRIPT_SIDDHAM => &_binary_resources_fonts_noto_NotoSansSiddham_Regular_otf_start, + HB_SCRIPT_SIGNWRITING => &_binary_resources_fonts_noto_NotoSansSignWriting_Regular_otf_start, HB_SCRIPT_SINHALA => &_binary_resources_fonts_noto_NotoSerifSinhala_Regular_otf_start, HB_SCRIPT_SOGDIAN => &_binary_resources_fonts_noto_NotoSansSogdian_Regular_otf_start, HB_SCRIPT_SORA_SOMPENG => &_binary_resources_fonts_noto_NotoSansSoraSompeng_Regular_otf_start, @@ -891,14 +938,17 @@ unsafe fn font_data_from_script(script: HbScript) -> &'static [libc::c_uchar] { HB_SCRIPT_TAI_VIET => &_binary_resources_fonts_noto_NotoSansTaiViet_Regular_otf_start, HB_SCRIPT_TAKRI => &_binary_resources_fonts_noto_NotoSansTakri_Regular_otf_start, HB_SCRIPT_TAMIL => &_binary_resources_fonts_noto_NotoSerifTamil_Regular_otf_start, + HB_SCRIPT_TANGSA => &_binary_resources_fonts_noto_NotoSansTangsa_Regular_otf_start, HB_SCRIPT_TELUGU => &_binary_resources_fonts_noto_NotoSerifTelugu_Regular_otf_start, HB_SCRIPT_THAANA => &_binary_resources_fonts_noto_NotoSansThaana_Regular_otf_start, HB_SCRIPT_THAI => &_binary_resources_fonts_noto_NotoSerifThai_Regular_otf_start, HB_SCRIPT_TIBETAN => &_binary_resources_fonts_noto_NotoSerifTibetan_Regular_otf_start, HB_SCRIPT_TIFINAGH => &_binary_resources_fonts_noto_NotoSansTifinagh_Regular_otf_start, HB_SCRIPT_TIRHUTA => &_binary_resources_fonts_noto_NotoSansTirhuta_Regular_otf_start, + HB_SCRIPT_TOTO => &_binary_resources_fonts_noto_NotoSerifToto_Regular_otf_start, HB_SCRIPT_UGARITIC => &_binary_resources_fonts_noto_NotoSansUgaritic_Regular_otf_start, HB_SCRIPT_VAI => &_binary_resources_fonts_noto_NotoSansVai_Regular_otf_start, + HB_SCRIPT_VITHKUQI => &_binary_resources_fonts_noto_NotoSerifVithkuqi_Regular_otf_start, HB_SCRIPT_WANCHO => &_binary_resources_fonts_noto_NotoSansWancho_Regular_otf_start, HB_SCRIPT_WARANG_CITI => &_binary_resources_fonts_noto_NotoSansWarangCiti_Regular_otf_start, HB_SCRIPT_YEZIDI => &_binary_resources_fonts_noto_NotoSerifYezidi_Regular_otf_start, diff --git a/dist.sh b/dist.sh index 5fcb138..a899b64 100755 --- a/dist.sh +++ b/dist.sh @@ -21,7 +21,7 @@ cp libs/libjbig2dec.so dist/libs/libjbig2dec.so.0 cp libs/libfreetype.so dist/libs/libfreetype.so.6 cp libs/libharfbuzz.so dist/libs/libharfbuzz.so.0 -cp libs/libgumbo.so dist/libs/libgumbo.so.1 +cp libs/libgumbo.so dist/libs/libgumbo.so.2 cp libs/libdjvulibre.so dist/libs/libdjvulibre.so.21 cp libs/libmupdf.so dist/libs diff --git a/doc/BUILD.md b/doc/BUILD.md index 1f0965e..f9e42fd 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -39,7 +39,7 @@ rustup target add arm-unknown-linux-gnueabihf ## Developer Tools -Install the required dependencies: *MuPDF 1.23.11*, *DjVuLibre*, *FreeType*, *HarfBuzz*. +Install the required dependencies: *MuPDF 1.27.0*, *DjVuLibre*, *FreeType*, *HarfBuzz*. ### Emulator diff --git a/thirdparty/download.sh b/thirdparty/download.sh index f78f65f..1982109 100755 --- a/thirdparty/download.sh +++ b/thirdparty/download.sh @@ -5,17 +5,17 @@ declare -A urls=( ["zlib"]="https://www.zlib.net/zlib-1.3.1.tar.gz" ["bzip2"]="https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" # Images - ["libpng"]="https://download.sourceforge.net/libpng/libpng-1.6.43.tar.gz" + ["libpng"]="https://download.sourceforge.net/libpng/libpng-1.6.53.tar.gz" ["libjpeg"]="http://www.ijg.org/files/jpegsrc.v9f.tar.gz" - ["openjpeg"]="https://github.com/uclouvain/openjpeg/archive/v2.5.2.tar.gz" + ["openjpeg"]="https://github.com/uclouvain/openjpeg/archive/v2.5.4.tar.gz" ["jbig2dec"]="https://github.com/ArtifexSoftware/jbig2dec/releases/download/0.20/jbig2dec-0.20.tar.gz" # Fonts - ["freetype2"]="https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.gz" - ["harfbuzz"]="https://github.com/harfbuzz/harfbuzz/archive/8.4.0.tar.gz" + ["freetype2"]="https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.gz" + ["harfbuzz"]="https://github.com/harfbuzz/harfbuzz/archive/11.5.0.tar.gz" # Documents ["gumbo"]="https://github.com/google/gumbo-parser/archive/v0.10.1.tar.gz" - ["djvulibre"]="http://downloads.sourceforge.net/djvu/djvulibre-3.5.28.tar.gz" - ["mupdf"]="https://mupdf.com/downloads/archive/mupdf-1.23.11-source.tar.gz" + ["djvulibre"]="http://downloads.sourceforge.net/djvu/djvulibre-3.5.29.tar.gz" + ["mupdf"]="https://casper.mupdf.com/downloads/archive/mupdf-1.27.0-source.tar.gz" ) for name in "${@:-${!urls[@]}}" ; do diff --git a/thirdparty/harfbuzz/build-kobo.sh b/thirdparty/harfbuzz/build-kobo.sh index 68744ff..90c71be 100755 --- a/thirdparty/harfbuzz/build-kobo.sh +++ b/thirdparty/harfbuzz/build-kobo.sh @@ -10,4 +10,5 @@ export CXXFLAGS="$CFLAGS" export FREETYPE_CFLAGS="-I${FREETYPE_DIR}/include" export FREETYPE_LIBS="-L${FREETYPE_DIR}/objs/.libs -L${LIBPNG_DIR}/.libs -L${BZIP2_DIR} -L${ZLIB_DIR} -lfreetype -lpng16 -lbz2 -lz" -./autogen.sh --host=${TRIPLE} --disable-static --with-freetype=yes --with-glib=no --with-icu=no --with-cairo=no --with-fontconfig=no && make +meson setup -Dglib=disabled -Dicu=disabled -Dcairo=disabled -Dfreetype=enabled --cross-file kobo-options.txt build +meson compile -C build diff --git a/thirdparty/harfbuzz/kobo-options.txt b/thirdparty/harfbuzz/kobo-options.txt new file mode 100644 index 0000000..9a51369 --- /dev/null +++ b/thirdparty/harfbuzz/kobo-options.txt @@ -0,0 +1,11 @@ +[binaries] +c = 'arm-linux-gnueabihf-gcc' +cpp = 'arm-linux-gnueabihf-g++' +ar = 'arm-linux-gnueabihf-ar' +strip = 'arm-linux-gnueabihf-strip' + +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'armv8' +endian = 'little' diff --git a/thirdparty/harfbuzz/kobo.patch b/thirdparty/harfbuzz/kobo.patch new file mode 100644 index 0000000..9f6ac8e --- /dev/null +++ b/thirdparty/harfbuzz/kobo.patch @@ -0,0 +1,16 @@ +diff -ru a/meson.build b/meson.build +--- a/meson.build 2026-01-08 21:58:37 ++++ b/meson.build 2026-01-08 22:03:29 +@@ -107,7 +107,11 @@ + + m_dep = cpp.find_library('m', required: false) + +-freetype_dep = dependency('freetype2', version: freetype_min_version, required: get_option('freetype'), default_options: ['harfbuzz=disabled']) ++freetype_dep = declare_dependency(dependencies : [cpp.find_library('freetype', dirs : [meson.current_source_dir() / '..' / 'freetype2/objs/.libs']), ++ cpp.find_library('png16', dirs: [meson.current_source_dir() / '..' / 'libpng/.libs']), ++ cpp.find_library('bz2', dirs: [meson.current_source_dir() / '..' / 'bzip2']), ++ cpp.find_library('z', dirs: [meson.current_source_dir() / '..' / 'zlib'])], ++ include_directories : include_directories('../freetype2/include')) + glib_dep = dependency('glib-2.0', version: glib_min_version, required: get_option('glib')) + gobject_dep = dependency('gobject-2.0', version: glib_min_version, required: get_option('gobject')) + graphite2_dep = dependency('graphite2', version: graphite2_min_version, required: get_option('graphite2')) diff --git a/thirdparty/mupdf/build-kobo.sh b/thirdparty/mupdf/build-kobo.sh index 99a25e8..a9c82f7 100755 --- a/thirdparty/mupdf/build-kobo.sh +++ b/thirdparty/mupdf/build-kobo.sh @@ -1,10 +1,9 @@ #! /bin/sh -[ -e thirdparty/README ] && rm -rf thirdparty/* [ -e .gitattributes ] && rm -rf .git* BUILD_KIND=${1:-release} make verbose=yes generate -make verbose=yes tesseract=no USE_SYSTEM_LIBS=yes OS=kobo build="$BUILD_KIND" libs +make verbose=yes mujs=no tesseract=no extract=no archive=no brotli=no barcode=no commercial=no USE_SYSTEM_LIBS=yes OS=kobo build="$BUILD_KIND" libs -arm-linux-gnueabihf-gcc -Wl,--gc-sections -o build/"$BUILD_KIND"/libmupdf.so $(find build/"$BUILD_KIND" -name '*.o' | grep -Ev '(SourceHanSerif-Regular|DroidSansFallbackFull|NotoSerifTangut|color-lcms)') -lm -L../freetype2/objs/.libs -lfreetype -L../harfbuzz/src/.libs -lgumbo -L../gumbo/.libs -lharfbuzz -L../jbig2dec/.libs -ljbig2dec -L../libjpeg/.libs -ljpeg -L../openjpeg/build/bin -lopenjp2 -L../zlib -lz -shared -Wl,-soname -Wl,libmupdf.so -Wl,--no-undefined +arm-linux-gnueabihf-gcc -Wl,--gc-sections -o build/"$BUILD_KIND"/libmupdf.so $(find build/"$BUILD_KIND" -name '*.o' | grep -Ev '(SourceHanSerif-Regular|DroidSansFallbackFull|NotoSerifTangut|color-lcms)') -lm -L../freetype2/objs/.libs -lfreetype -L../harfbuzz/build/src -lharfbuzz -L../gumbo/.libs -lgumbo -L../jbig2dec/.libs -ljbig2dec -L../libjpeg/.libs -ljpeg -L../openjpeg/build/bin -lopenjp2 -L../zlib -lz -shared -Wl,-soname -Wl,libmupdf.so -Wl,--no-undefined diff --git a/thirdparty/mupdf/kobo.patch b/thirdparty/mupdf/kobo.patch index deddbcd..2c19f2f 100644 --- a/thirdparty/mupdf/kobo.patch +++ b/thirdparty/mupdf/kobo.patch @@ -1,29 +1,17 @@ -diff -ru a/Makefile b/Makefile ---- a/Makefile 2023-11-14 09:46:57 -+++ b/Makefile 2023-11-14 09:47:11 -@@ -150,7 +150,7 @@ - - THIRD_GLUT_OBJ := $(THIRD_GLUT_SRC:%.c=$(OUT)/%.o) - --MUPDF_SRC := $(sort $(wildcard source/fitz/*.c)) -+MUPDF_SRC := $(sort $(filter-out source/fitz/output-docx.c, $(wildcard source/fitz/*.c))) - MUPDF_SRC += $(sort $(wildcard source/fitz/*.cpp)) - MUPDF_SRC += $(sort $(wildcard source/pdf/*.c)) - MUPDF_SRC += $(sort $(wildcard source/xps/*.c)) diff -ru a/Makerules b/Makerules ---- a/Makerules 2023-11-14 09:46:58 -+++ b/Makerules 2023-11-14 09:47:11 -@@ -321,6 +321,35 @@ - HAVE_WIN32=yes - endif - +--- a/Makerules 2026-01-09 12:19:57 ++++ b/Makerules 2026-01-09 12:19:36 +@@ -354,6 +354,35 @@ + # This does rely on the generated directory being populated with the font files. + # Run 'make generate' before doing the cross compile. + +ifeq "$(OS)" "kobo" + CC = arm-linux-gnueabihf-gcc + CXX = arm-linux-gnueabihf-g++ + LD = arm-linux-gnueabihf-ld + AR = arm-linux-gnueabihf-ar + AS = arm-linux-gnueabihf-as -+ CFLAGS += -O2 -fPIC -mcpu=cortex-a9 -mfpu=neon -DTOFU_CJK_LANG -DTOFU_CJK_EXT -DFZ_ENABLE_ICC=0 -DFZ_ENABLE_JS=0 -DFZ_ENABLE_SPOT_RENDERING=0 -DFZ_ENABLE_ODT_OUTPUT=0 -DFZ_ENABLE_DOCX_OUTPUT=0 -DFZ_ENABLE_OCR_OUTPUT=0 ++ CFLAGS += -O2 -fPIC -mcpu=cortex-a9 -mfpu=neon -DTOFU_CJK_LANG -DTOFU_CJK_EXT -DFZ_ENABLE_ICC=0 -DFZ_ENABLE_SPOT_RENDERING=0 -DFZ_ENABLE_ODT_OUTPUT=0 -DFZ_ENABLE_OCR_OUTPUT=0 + HAVE_PTHREAD := yes + HAVE_LIBCRYPTO := no + HAVE_X11 := no @@ -35,7 +23,7 @@ diff -ru a/Makerules b/Makerules + SYS_GUMBO_CFLAGS := -I../gumbo/src + SYS_GUMBO_LIBS := -L../gumbo/.libs -lgumbo + SYS_HARFBUZZ_CFLAGS := -I../harfbuzz/src -+ SYS_HARFBUZZ_LIBS := -L../harfbuzz/src/.libs -lharfbuzz ++ SYS_HARFBUZZ_LIBS := -L../harfbuzz/build/src -lharfbuzz + SYS_OPENJPEG_CFLAGS := -I../openjpeg/src/lib/openjp2 + SYS_OPENJPEG_LIBS := -L../openjpeg/build/bin -lopenjpeg + SYS_JBIG2DEC_CFLAGS := -I../jbig2dec @@ -46,81 +34,20 @@ diff -ru a/Makerules b/Makerules + SYS_ZLIB_LIBS := -L../zlib -lz +endif + - # Most variables when building for iOS are set up in ios/build_libs.sh, - # which is called from the Xcode project as a "Run Script" build step. - # The following section works for both device and simulator builds. + ifeq "$(OS)" "wasm" + build_prefix += wasm/ + CC = emcc diff -ru a/Makethird b/Makethird ---- a/Makethird 2023-11-14 09:46:58 -+++ b/Makethird 2023-11-14 09:47:11 -@@ -43,10 +43,6 @@ +--- a/Makethird 2026-01-09 12:19:57 ++++ b/Makethird 2026-01-09 12:19:36 +@@ -83,10 +83,6 @@ endif endif - + -# --- Include source file lists --- - -include Makelists - - # --- FREETYPE 2 --- - - ifeq ($(USE_SYSTEM_FREETYPE),yes) -@@ -235,36 +231,3 @@ - $(CXX_CMD) $(LIB_CFLAGS) $(TESSERACT_CFLAGS) $(TESSERACT_BUILD_CFLAGS) - endif - endif -- --# --- EXTRACT --- -- --THIRD_CFLAGS += $(EXTRACT_CFLAGS) --THIRD_LIBS += $(EXTRACT_LIBS) --THIRD_SRC += $(EXTRACT_SRC) --$(OUT)/thirdparty/extract/%.o: thirdparty/extract/%.c -- $(CC_CMD) $(WARNING_CFLAGS) $(LIB_CFLAGS) $(EXTRACT_CFLAGS) $(ZLIB_CFLAGS) $(EXTRACT_BUILD_CFLAGS) -- --# The first python3 command in the next two rules returns 0 (success) iff --# python3 exists and is version 3.6 or later. -- --thirdparty/extract/src/docx_template.c: thirdparty/extract/src/template.docx thirdparty/extract/src/docx_template_build.py -- $(QUIET_GEN) if python3 -c 'import sys; sys.exit(sys.version_info < (3,6))'; \ -- then python3 thirdparty/extract/src/docx_template_build.py \ -- -i thirdparty/extract/src/template.docx \ -- -n docx \ -- -o thirdparty/extract/src/docx_template ; \ -- else echo python3 is older than 3.6 so not running docx_template_build.py; \ -- fi -- @touch $@ -- --thirdparty/extract/src/odt_template.c: thirdparty/extract/src/template.odt thirdparty/extract/src/docx_template_build.py -- $(QUIET_GEN) if python3 -c 'import sys; sys.exit(sys.version_info < (3,6))'; \ -- then python3 thirdparty/extract/src/docx_template_build.py \ -- -i thirdparty/extract/src/template.odt \ -- -n odt \ -- -o thirdparty/extract/src/odt_template ; \ -- else echo python3 is older than 3.6 so not running docx_template_build.py; \ -- fi -- @touch $@ -- --generate: thirdparty/extract/src/docx_template.c -diff -ru a/source/html/html-parse.c b/source/html/html-parse.c ---- a/source/html/html-parse.c 2023-11-14 09:46:58 -+++ b/source/html/html-parse.c 2023-11-14 09:59:43 -@@ -1615,13 +1615,13 @@ - } - - static const char *mobi_font_size[7] = { -- "8pt", -- "10pt", -- "12pt", -- "14pt", -- "16pt", -- "18pt", -- "20pt", -+ "0.67em", -+ "0.83em", -+ "1em", -+ "1.17em", -+ "1.33em", -+ "1.5em", -+ "1.67em", - }; - - static void + # --- BROTLI --- + + ifeq ($(USE_BROTLI),yes)