Example: drawing text based on height of previous block #255
Unanswered
webprofusion-chrisc
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While playing around with ImageSharp.Fonts I thought I'd try to make my own web browser :)
I initially got confused by looking at the "Samples" code in the repo as the CustomGlyphRenderer does some stuff with boxes (and uses internal classes) and I assumed this was how to measure text block height, turns out there is of course the TextMeasurer class which already does this.
Here is my sample which loads a web page, tries to find some text elements and then renders them (each block of text positioned after the last one). Note that I started to try to parse css styles but got bored :)
Output:

Beta Was this translation helpful? Give feedback.
All reactions