NightWhistler / HtmlSpanner

Android HTML rendering library with CSS support
http://nightwhistler.github.io/HtmlSpanner/
875 stars 208 forks source link

Fork #2

Closed dschuermann closed 11 years ago

dschuermann commented 12 years ago

Hi Alex,

I forked your project under https://github.com/dschuermann/HtmlSpanner and made several changes to fit my needs. I think you will not like every change, so I did not make a pull request. I just want to inform you about my changes:

NightWhistler commented 12 years ago

Hi Dominique,

It's cool to see HtmlSpanner get some attention... PageTurner gets forked a lot, but HtmlSpanner not so often, so it's nice to see it get some use beyond PageTurner.

I took a quick browse through your commits, but it looks like you also restructured the code to fit on wider lines... which makes it hard to pick out the changed lines quickly. I'll read through it more thoroughly when I have some more time.

From what I have seen I'll definitely include your changes to list handling in the main line, it looks cleaner than my implementation. I'll have to check the whitespace handling a bit more thoroughly... PageTurner has a very specific design goal of handling badly formatted books as well as possible, which includes stripping out unneccesary whitespace.

As to changing it to a library project: that makes a lot of sense... my background is more in Java EE development, so using Maven comes naturally to me. I have had more questions on how to get both PageTurner and HtmlSpanner to build though. I'll have to think about that one.

Anyway, great job on the fork and I look forward to seeing what else you come up with... I think I'll also check out your donations project, since it looks like an interesting alternative to my current strategy for PageTurner.

Cheers,

Alex

Verzonden van mijn Android telefoon met K-9 Mail.

"Dominik Schürmann" reply@reply.github.com schreef:

Hi Alex,

I forked your project under https://github.com/dschuermann/HtmlSpanner and made several changes to fit my needs. I think you will not like every change, so I did not make a pull request. I just want to inform you about my changes:


Reply to this email directly or view it on GitHub: https://github.com/NightWhistler/HtmlSpanner/issues/2

dschuermann commented 12 years ago

Sry for the large commit, the fork was the outcome of a hack session :) You can add a dependency on a library project in properties->Android of a Eclipse Project. Then when building the project, the library project is build first and included.

btw: I am using HtmlSpanner to display help texts in my app AdAway. Html.fromHtml did not include support for lists and had some other bugs... I will probably use HtmlSpanner in other projects in the future. I don't like the idea of using WebView to display formatted text.

dschuermann commented 12 years ago

After going through the code again, I have a question: In BoldHandler you are using your own FontFamilySpan, but in ItalicHandler you are using StyleSpan from Android. Why this difference and why even introducing FontFamilySpan?

NightWhistler commented 12 years ago

I'd have to check, but it looks like I simply forgot to update the ItalicHandler.

I introduced the font-family because the font rendering with TTF fonts was giving bad results on Android 4... I switched to OTF fonts, but the results were still ugly when using the "fake" italic and bold.

I introduced the font family to be able to build a font out of several OTF files, with separate files for normal, bold and italic. If a font-file is missing for one of those, it falls back to the "fake" bold and / or italic.

NightWhistler commented 11 years ago

I'm gearing up for a new PageTurner release and I finally had a chance to do a side by side compare of your version with the main line of HtmlSpanner.

Since you moved all the files I don't think I can cherry-pick the changes through git, so what I'll do is manually pull the changes into the main line and then set you as the author of the commit. That way you get proper credit for your work.

dschuermann commented 11 years ago

Sry again for forking so rude :) Keep in mind that I changed some behaviors probably not wanted by you.

NightWhistler commented 11 years ago

Nothing rude about it :) I really like how easy Github it makes to fork and change... and you cleaned up a number of things quite nicely... including missing license headers on my part :)

Keep up the good work!

nagendraksrivastava commented 9 years ago

I tried to use your library for my android app but it is not getting com.osbcp.cssparser:cssparser:1.5 source and ended up with error, is there any fix for this ?