Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context.FontMatrix cause an exception to be thrown. #7

Open
zwcloud opened this issue Aug 5, 2018 · 1 comment
Open

Context.FontMatrix cause an exception to be thrown. #7

zwcloud opened this issue Aug 5, 2018 · 1 comment

Comments

@zwcloud
Copy link
Owner

zwcloud commented Aug 5, 2018

This is an issue from Brad and is to be reproduced.

Context context;
Matrix matrix = context.FontMatrix;

This will cause an exception to be thrown. It looks like it is coming from the Native code. I wasn’t sure how you were sourcing the cairod.dll so I stopped digging there.

@MatthiasSchilder
Copy link

I did see the same issue when using the FontMatrix-getter. Changing the Matrix-parameter of NativeMethods.cairo_get_font_matrix to being a non-out-param did the trick for us:

internal static extern void cairo_get_font_matrix (IntPtr cr, Matrix matrix);
public Matrix FontMatrix {
	get {
		CheckDisposed ();
		Matrix m = new Matrix();
		NativeMethods.cairo_get_font_matrix (handle, m);
		return m;
	}
	set {
		CheckDisposed ();
		NativeMethods.cairo_set_font_matrix (handle, value);
	}
}

This way, it is also done in the Matrix property of Context (which worked out of the box), so I assume this fixes it.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants