Closed tocsoft closed 7 years ago
I've updated based on your feedback... I renamed RenderOptions
to TextOptions
as I felt that made more sense when its being passed into Render(..)
/ Measure(..)
methods.
I also renamed the private 'Render' method to ProcessText
to be a bit more generic.
@vidstige I've had a pass of cleaning up the unit tests in relation to measuring strings, the changes are https://github.com/tocsoft/NRasterizer/commit/e0a14073851ba50841afc493c04ddd20a026a997 do you want me to add that changes to this PR or would you rather I sent you this over as a separate PR? after/if you accept this one.
@tocsoft ah, back from vaccation. :-) Sorry for letting you hang. I guess it's easiest for you to pull these changes + the cleanup commit into a new branch and make a new pull request against master?
Also I feel we need a refactor. It feels to quirky to have the bool renderGlyph
argument to ProcessText
, but rather there should a function returning iterator that iterates over glyph coordinates. You see where I am going with this? Then the measure text and draw text functions could both use this iterator. Sample signature IEnumerable<Point2D> GlyphPositions(Point2D position, string text, int size, TextOptions options = DefaultTextOptions)
or something like that.
Perhaps start with creating the new pr as this branch has merge conflicts? You can also merge and resolve conflicts in here if it easier for you :+1:
Let's get this baby in anyway :)
superseded by #48
Added a new method to measure the text.
Fixes #42
While I was in here I tried to refactor, what owns the output resolution, and how we pass rendering options in to try and simplify the API.