I'm wondering whether it's possible to measure text using ImageSharp? I'm trying to replace some code that uses Drawing.MeasureString from System.Graphics.
I tried searching Google for "imagesharp measure text" and also tried searching this repo, but didn't see anything relevant.
Hi @Daniel15
See http://sixlabors.com/2017/04/08/watermarks/ for information on text measuring.
We will get decent documentation out as soon as we can to make finding info easier. We're just utterly swamped now getting the library in shape to launch the first beta.
Hope the example all makes sense.
Cheers
James
Thanks for the example! It looks very useful :)
I just tried it out and it works wonderfully! Thank you so much @JimBobSquarePants 馃槂
I saw in #6 that there's plans to have API docs. Is there a staging website available to see work-in-progress docs? I'd be happy reading through auto-generated API docs even if they're incomplete.
That's great to hear!
We're building docs using Wyam in our feature/docs branch - You can build them locally using the instructions found here
https://wyam.io/docs/usage/command-line
The one's in the repo just now are completely unfinished and will change quite dramatically; The API docs do generate though. I'm actually, this second, working on them.
For anyone else here looking for an answer to text measuring. The example provided above can be found here since it appears that blog post no longer exists.
Thanks @vanhouc, more direct answer :
var font = SixLabors.Fonts.SystemFonts.CreateFont("Arial", 12);
TextMeasurer.Measure("YOUR TEXT", new RendererOptions(font));
Most helpful comment
For anyone else here looking for an answer to text measuring. The example provided above can be found here since it appears that blog post no longer exists.