Tehreer / Tehreer-Android

Standalone text engine for Android aimed to be free from platform limitations
Apache License 2.0
89 stars 16 forks source link

Any chance for iOS version? #19

Closed AbdullahRusi closed 4 years ago

AbdullahRusi commented 5 years ago

السلام عليكم ورحمة الله وبركاته

@mta452 Brother is there any chance for iOS version of your excellent library?

Got Xcode 11 GM and tested stock iOS 13 UITextView in simulator and found awful rendering with lots of glitches

with fonts which are working well in android when using your library.

Also i tried SheenFigureLegacy and managed to compile and run demo both with CG and latest FT (both seemed perform same) last one required extra steps: 1) select standart architecture and build only for active in build settings (otherwise it compiles for i386) 2) get ftapi.c from previous FT versions and place to base folder 3) include ftgzip.c 4) add this lines to it to fix error:

int z_verbose = 0;

void z_error(/* should be const */char* message)
{
    printf(message);
}

5) do not comment out ttdriver in FT module config (otherwise app will fall with exception)

it's already better than stock, but it contains old bugs that were already fixed in tehreer

mta452 commented 5 years ago

وعلکم السلام ورحمة اللہ وبرکاتة

I'm glad that you like the library. The iOS version is already under development. As the API of android version has grown very large, it's taking time to write it according to swift guidelines. A demo project also needs to be written for testing the functionality beforehand. But I'm hopeful that the first iOS version will be ready in next few months.

As for SheenFigureLegacy, it has been discontinued since the project has been divided into several other projects. So the bugs will be fixed in iOS port when released.

By the way, can you provide a link to your app using this library? I'll add it in the readme for reference.

AbdullahRusi commented 5 years ago

Wish you best of help, useful knowledge and guidance from Allah

As for app here it is https://play.google.com/store/apps/details?id=ing.galgaev.quran Many brothers asking for iOS version, and there was no iOS developer until recently (not me) Hope to port it some day and use your excellent library inshaa Allah

بارك الله فيكم

Screenshot_1568429867_proc

AbdullahRusi commented 4 years ago

السلام عليكم ورحمة الله وبركاته

Brother i would like to share tuned xcode project. CoreTextAndHarfbuzz.zip

It includes rendering using only CoreText(coloured rendering for html markup with tajweed rules) and using CoreText and Harfbuzz(black and white). Recently i found that custom rendering using CoreText is not so awful as it is when using standard UILabel or UITextView.

To switch using only CoreText uncomment line 100 and comment lines 133-136 in CTView.swift

It may be useful for you to compare text rendering while developing your library fix errors and improve over these major libs.

Maybe you have some suggestions how to implement coloured rendering with Harfbuzz.

As for apps using your library(maybe add to readme) i see also this app - checked apk

https://play.google.com/store/apps/details?id=org.quranacademy.quran

mta452 commented 4 years ago

وعلکم السلام ورحمة اللہ وبرکاتة

I have checked out your project. I must say, I'm amazed that so much is done with such little code. Character-Glyph mapping is required to implement colored rendering with Harfbuzz. As an alternative, you can also check out flutter which uses its own text engine. Maybe that will be helpful for your use case. And finally, first version of Tehreer-Cocoa is also in last stages. I have pushed it on github https://github.com/Tehreer/Tehreer-Cocoa. Feel free to check it out as well.