Hello!
My application uses the font “Unit Rounded OT” converted to a true type font. This font is rendered correctly in Windows but not in Linux. If the glyph is somehow “round” in the lower right, Juce draws an edge instead. At the most extreme, this effect can be seen with the “8”, but it’s also visible with a “0”, “9”, “S”, …
As I found, the problem is the handling of the start point of a contour returned by the freetype library. I changed the code of “addGlyph” in “juce_linux_Fonts.cpp” to the following:
[code]…
for (int p = startPoint; p <= endPoint; p++)
{
const float x = CONVERTX (points[p]);
const float y = CONVERTY (points[p]);
if (p == startPoint)
{
if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic)
{
float x2 = CONVERTX (points [endPoint]);
float y2 = CONVERTY (points [endPoint]);
if (FT_CURVE_TAG (tags[endPoint]) == FT_Curve_Tag_On)
{
destShape.startNewSubPath (x2, y2);
}
else
{
destShape.startNewSubPath ((x + x2) * 0.5f, (y + y2) * 0.5f);
}
}
else
{
destShape.startNewSubPath (x, y);
}
}
if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_On)
{
if (p != startPoint)
{
destShape.lineTo (x, y);
}
}
else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic)
{
…
[/code]
The font mentioned above works now, and other fonts don’t seem to be disturbed.
I found that solution for the handling of the first point of a contour in the implementation of the freetype-internal function “Decompose_Curve”.
Best Regards,
Andreas
