mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-04 21:15:06 +00:00
[util/cairo] Handle all null matrices
This commit is contained in:
parent
392463267f
commit
2ddae77179
1 changed files with 12 additions and 0 deletions
|
@ -156,6 +156,18 @@ helper_cairo_create_scaled_font (const font_options_t *font_opts,
|
||||||
&font_matrix,
|
&font_matrix,
|
||||||
&ctm,
|
&ctm,
|
||||||
font_options);
|
font_options);
|
||||||
|
if (cairo_scaled_font_status (scaled_font) == CAIRO_STATUS_INVALID_MATRIX)
|
||||||
|
{
|
||||||
|
// Set font matrix to 0, which *does* work with cairo_scaled_font_create()
|
||||||
|
font_matrix.xx = font_matrix.yy = 0;
|
||||||
|
font_matrix.xy = font_matrix.yx = 0;
|
||||||
|
font_matrix.x0 = font_matrix.y0 = 0;
|
||||||
|
scaled_font = cairo_scaled_font_create (cairo_face,
|
||||||
|
&font_matrix,
|
||||||
|
&ctm,
|
||||||
|
font_options);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
cairo_font_options_destroy (font_options);
|
cairo_font_options_destroy (font_options);
|
||||||
cairo_font_face_destroy (cairo_face);
|
cairo_font_face_destroy (cairo_face);
|
||||||
|
|
Loading…
Add table
Reference in a new issue