quran / quran_android

a quran reading application for android
http://android.quran.com
GNU General Public License v3.0
1.99k stars 882 forks source link

Using SVG for text #582

Closed ofa1 closed 7 years ago

ofa1 commented 8 years ago

Assalamualaikum

Instead of using images for the Quranic text, has SVG been considered as an option? I believe that we can convert the Quran images to SVG paths and use them to display instead of images. This way we'll have extremely light-weight and very high resolution (infinitely scalable) text for the Quran.

There's a library available for Android SVG : https://github.com/BigBadaboom/androidsvg

I have experience in dealing with SVGs and also casual android development, please let me know if I can help with this.

Wassalaam, Omair Ahmed

ahmedre commented 8 years ago

wa3laikum alsalam, jazakAllah khairan - so we actually generate the images from fonts, so we do have the font files and could use those. thought about it long time back, and didn't proceed for 2 reasons - 1. for svg specifically, from what i could remember, there was no support for the text svg stuff (not sure what it's called, it's been a while since i looked at it). 2. for fonts, there were a bunch of issues on older phones - this is no longer an issue really though.

i am not against going down this route, especially since it could (potentially) improve our performance and solve many issues for us (such as the translation arabic text looking different from the page text, having to download data on startup, etc) - but i am curious as to how difficult it is to convert Quran images into SVG paths (or fonts or something) for the other apps that we have.

(note though text rendering is super expensive as well and slow on Android, so we'll have to do tricks to pre-render the TextLayouts and what not).

jazakAllah khairan, walsalam 3alaikum.

ofa1 commented 8 years ago

Oh that's great! Can I have a look at how the images are generated? I will try and see if we can batch convert all pages to SVG paths/text.

With regards to no support for text/fonts - we really don't need that because SVG has this concept called paths which are, in plain words, math instructions on how to draw the lines. So as long as a phone can do math, and can render some SVG, we're good to go. No need for fonts and stuff at all :)

I don't have much knowledge on how expensive SVG rendering is, though I'm sure that it won't be expensive at all. SVG is used on a ton of webpages like Wikipedia, etc. so nothing stopping us Insha'Allah Khair.

وسلام Omair

On Wed, Oct 28, 2015 at 10:30 AM, Ahmed El-Helw notifications@github.com wrote:

wa3laikum alsalam, jazakAllah khairan - so we actually generate the images from fonts, so we do have the font files and could use those. thought about it long time back, and didn't proceed for 2 reasons - 1. for svg specifically, from what i could remember, there was no support for the text svg stuff (not sure what it's called, it's been a while since i looked at it). 2. for fonts, there were a bunch of issues on older phones - this is no longer an issue really though.

i am not against going down this route, especially since it could (potentially) improve our performance and solve many issues for us (such as the translation arabic text looking different from the page text, having to download data on startup, etc) - but i am curious as to how difficult it is to convert Quran images into SVG paths (or fonts or something) for the other apps that we have.

(note though text rendering is super expensive as well and slow on Android, so we'll have to do tricks to pre-render the TextLayouts and what not).

jazakAllah khairan, walsalam 3alaikum.

— Reply to this email directly or view it on GitHub https://github.com/quran/quran_android/issues/582#issuecomment-151726001 .

Omair Fareed Ahmed

ahmedre commented 8 years ago

https://github.com/quran/quran.com-images - i use the nextgen branch typically, but i think even master should be okay. these just generate images from the various font files and output position information to a table.

ofa1 commented 8 years ago

Quick question... we're having a separate font file for each page?

That's what this page is about? https://github.com/quran/quran.com-images/tree/nextgen/res/fonts

I'm completely new to perl so am having a hard time understanding that code.

ahmedre commented 8 years ago

sorry for the delayed reply - basically, each page has its own font, and each word is a glyph - that's the way the fonts came, and it's mainly due to the fact that the Quran is hand-drawn, so the same letter/word looks different in different places.

ofa1 commented 8 years ago

Got it. JazakAllahu Khairan.

ahmedre commented 7 years ago

closing this for now - we won't do svgs, though fonts (ttfs) are a possibility in the future.

hatemhosny commented 6 years ago

May be this can help: http://dm.qurancomplex.gov.sa/