PDF-Writer
PDF-Writer copied to clipboard
Supporting ICU in BIDI
@galkahana I just added support for doing the BiDi using libICU, here are some notes:
- By default the library will build with both ICU And Fribidi, and use friBidi, if you'd like to make ICU default, the build needs to be done with
-DPDFHUMMUS_NO_FRIBIDI=1
- If you want to completely disable bidi, add those two flags:
-DPDFHUMMUS_NO_FRIBIDI=1 -DPDFHUMMUS_NO_ICUBIDI=1
- For some reason, i get this error while building if i run cmake with no flags:
make[2]: *** No rule to make target '../libIcu/source/build/lib/libfribidi.a', needed by 'PDFWriterTestPlayground/PDFWriterTestPlayground'. Stop.
Thanks man. Re 3. Any particular reason that you want to keep freebidi? I guess if you remove you still got icu, and the problem would go away. No?
Well the main reason is that the library is smaller than icu, if you check the cmake file you'll notice that you have to link 5.a files from icu to make things work vs 1 file from fribidi. My feeling is that fribidi is also faster, i can run some benchmarks and see if that's true. If you're concerned about the license we could always make icu the default
On Wed, 24 Aug 2016, 12:43 a.m. gal kahana, [email protected] wrote:
Thanks man. Re 3. Any particular reason that you want to keep freebidi? I guess if you remove you still got icu, and the problem would go away. No?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/galkahana/PDF-Writer/pull/65#issuecomment-241872102, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHns5BGbPP94r-CR3KBomdQFasj9lcwks5qi1tjgaJpZM4JrW5q .
Makes sense. Let's keep frigidi as an option.
Hey @galkahana , any idea when you're planning to merge?
Busy at present, which is why im delaying. I need to review, cleanup, see how to make it work for pc or if not remove by default, see if i can make it work for hummusjs too. Theres a bit of work that ill do and than ill merge.
Alright thanks man, let me know if i can help with any of those (except making it work for PC)
sure :)
after many years. got to BIDI support through a different project of mine, of trying to parse text out of pdf. for this i needed an inverse conversion, but the principal is the same. in any case, what's difficult is the building process, which now there's an example that you can use. this is the project - https://github.com/galkahana/pdf-text-extraction specifically, building of icu bidi is done here (under condition of USE_BIDI, which you can remove).
code usage is here but do note that this is about parsing, and normally you'd be using this for writing, and amrnablus code here is more aligned to what you'd need (as well as includes conversion to the location-aware unicode char so that the final glyph looks correct per its position in the word).
Pdfhummus wont inclide icu support. You can build an icu solution on top of it though, as explained here and theres a good example.