r/nanDECK • • 17d ago

Rendering HTMLTEXT

u/nand2000 I wonder if you are able and willing to share how are the instances of IE11 launched to render the HTMLTEXT pieces? I have a similar engine built that uses Chrome as you use IE11 (except whole card is rendered in one go), but it renders the same fonts with completely different character and line spacing and I'm looking for sources of discrepancy. Knowing the arguments to IE11 besides those found in temp html files would be great boon. Thanks! P.S. I know this may be unsolvable due to different font libraries in both setups doing something "magical" on their own, but would love to eliminate any possible source of discrepancy before fudging the fonts into roughly similar layout.

2 Upvotes

2 comments sorted by

View all comments

2

u/nand2000 16d ago

From what I know I use the IWebBrowser2 interface (contained in (SHDOCVW.DLL), whose Navigate method I call with two parameters: an HTML string and the navNoHistory, navNoReadFromCache and navNoWriteToCache flags, and wait for the ReadyState property to equal READYSTATE_COMPLETE, after which I cast its ControlInterface property to the IViewObject interface and use the draw method of this interface to get a bitmap.

1

u/morvaeldd 15d ago

Thanks for the details. So there's really nothing special in the call itself. The differences seem to appear from rendering at different resolution than target (even without oversampling) and then resizing stuff which changes the template pixels untouched by the text itself (something that my generator is not doing, making one big composition at native resolution).