Skip to content

Pen and brush not aligned in DrawText #329

Answered by tocsoft
johantiger asked this question in Q&A
Discussion options

You must be logged in to vote

Your doing nothing wrong there, that's totally a bug.

Looking closely it looks like there is a path thickness/2 offset being applied to the path during the outlining stage.

As a work around you might be able to do something like this.

FontCollection fontCollection = new();
FontFamily fontFamily = fontCollection.Add(Path.Combine(functionDirectory, "Assets", "Fonts",
    "OpenSans-ExtraBold.ttf"));

Font bibfont = fontFamily.CreateFont(600, FontStyle.Bold);
Font namefont = fontFamily.CreateFont(140, FontStyle.Bold);

RichTextOptions options = new RichTextOptions(bibfont)
{
    VerticalAlignment = VerticalAlignment.Center,
    HorizontalAlignment = HorizontalAlignment.Center,
    TextAlignment 

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@johantiger
Comment options

@JimBobSquarePants
Comment options

@JimBobSquarePants
Comment options

Answer selected by johantiger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants