zomgistania

Main page | About | Articles | Previous Posts | Archives

Thursday, March 30, 2006

HTML rendering with GDI

I started to code my custom HTML rendering control today, aptly named zHTMLView. Yes, I like the letter Z. Now go away.

zHTMLView demonstration

I was kinda surprised how well it turned out, and this quickly!

The words wrap correctly, except for bold text. If you resize the browser window, the control resizes and re-wraps text correctly etc.

Oh yeah and it displays bold and italic. And bold-italic. Now how awesome is that?


The word wrap was quite easy actually.


  1. Take the text from a text-node

  2. Get width of each word one at a time

  3. Check if the word would go over the control's border when drawn
    • If it goes -> new line.




Now, to fix word wrap with B elements and to implement some Block-level element detection etc.



And on a side note, Super Eurobeat 166 was released yesterday and I got my.. uhm.. legal copy today. It's made of win and good! On a second thought, I'm quite disappointed with it. Only two or so good songs.

1 Comments:

  • Screenshot went boom.

    But the idea looks nice about the word-wrap, still, why won't it handle bold wrapping correctly? Some problem with MeasureString?

    By Anonymous Camilo Martin, at 9:57 AM  

Post a Comment

<< Home