开发者

HTML rendering algorithm [closed]

开发者 https://www.devze.com 2023-01-14 05:07 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, a开发者_运维百科nd more. You can edit the question so it can be answered with facts and citations.

Closed last month.

Improve this question

I am making an e-book reader for the J2ME and I wonder if I could make it render HTML pages. For the moment, I am using some simplified styling of my own.

So, could anyone point me to a good in-depth tutorial or a specification of an open-source HTML engine? Of course, I have some idea about it all, i.e. the main steps involved, the usage of finite-state machines an so forth, but it's not enough.

But why reinvent the wheel, when it's complicated enough? Do you know of any HTML engine written purely in Java, and light enough to be used as a lib in a J2ME project?

P.S. For the J2ME know-hows:

  • Porting from Java SE to J2ME is not necessarily an issue for me
  • I am not yet concerned about the inability (or at least unsuitability) of using vector fonts

UPDATE

If you could only point me to a detailed guide about layouting HTML code, I'd be more than grateful! I need to layout some very simple HTML, like text with basic styling, images, divs and tables. That's all.

(I know it's not trivial even though I need simple layouting, that's why I am asking.)


Webkit comes to mind.


I think Firefox uses Gecko Layout engine. Could prove helpful. More here

  1. https://developer.mozilla.org/en/docs/Gecko and
  2. https://wiki.mozilla.org/Gecko:Home_Page and
  3. For some videos http://redivide.com/blog/gecko-reflow-awesome-visualization-of-web-page-layout/


Dear me, I seem to be answering my own question.

The only possibilities that I found are:

  • J2ME Polish HTML Browser Component
  • J2MEHTML
  • Fire

Unfortunatelly, neither of these seems to be agile enough so that I could implement it for my own puproses, which are:

  • render on any Graphics object
  • support for bitmap fonts
  • split content to pages
  • TeX hyphenation
  • be able to obtain the word (if any) at a given point on the image.

This all I've done, but the trouble is that it is not rendering html, but custom and limited styling.


I googled and found Cobra


Another option would be LWUIT
It has an HTML component in last version.(see http://www.nextgenmoco.com/2010/05/css-support-added-to-htmlcomponent.html)
LWUIT is a swing-insipered set of UI components for J2ME, it's open source and had some sort of SUN support, I don't know if oracle will still support it.

0

精彩评论

暂无评论...
验证码 换一张
取 消