freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ftview segfault on ArefRuqaaInk-Regular.ttf (one of google web fonts


From: Hin-Tak Leung
Subject: Re: ftview segfault on ArefRuqaaInk-Regular.ttf (one of google web fonts)
Date: Wed, 24 May 2023 23:27:48 +0000 (UTC)

I think I have gotten to the bottom of the segfault problem. Pretty sure it is the librsvg people being clever/helpful somewhere between Werner's version and current.

rsvg_handle_get_intrinsic_dimensions() for this header (literal from a a previous message in this thread):

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">...
</svg>

is supposed to fail to return any width and height, which is probably what Werner's older librsvg does. And the ft demo code would set the svg dimension to units_per_EM when it fails.

dimension_svg.width = units_per_EM;
dimension_svg.height = units_per_EM;

but in my newer/current librsvg it returns with a success of 1x1 (I think that's just a "convenient assumption" to go for unit square for intended size when there is no info ), so it is out by a factor of 1000x1000 .

I'll see if I can find the actual change, but I believe the below is the correct fix:

===
@@ -243,6 +243,10 @@
{
dimension_svg.width = (int)out_width.length; /* XXX rounding? */
dimension_svg.height = (int)out_height.length;
+ if (((int)out_width.length == 1) && ((int)out_height.length == 1)) {
+ dimension_svg.width = units_per_EM;
+ dimension_svg.height = units_per_EM;
+ }
}
else
{
===

reply via email to

[Prev in Thread] Current Thread [Next in Thread]