An .epub is literally a zip of xhtml, css, and images.
If you want to build a good ereader, you either use a web browser or you reimplement one. And you have to support things like https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens, rtl, mathml, and—well—the rest of the nontrivial stack.