Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-05-12 03:08:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-05-12 03:08:02 +0400
commit5db81a0695e5e2c34a3d970a97c241cb08c4f0e1 (patch)
tree772315f5448b4a9aa7d4baf449773199145b407a
parentb78bb98cc9a5427025f1cf34553304fe66702281 (diff)
Fix T40144: Font rendering problems
-rw-r--r--source/blender/blenlib/intern/freetypefont.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 366740db0d9..b3392e28223 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -111,13 +111,15 @@ static VChar *freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *
for (k = 0; k < n; k++) {
l = (j > 0) ? (k + ftoutline.contours[j - 1] + 1) : k;
+ if (k == 0) l_first = l;
if (ftoutline.tags[l] == FT_Curve_Tag_On)
onpoints[j]++;
- if (k < n - 1) {
- if (ftoutline.tags[l] == FT_Curve_Tag_Conic &&
- ftoutline.tags[l + 1] == FT_Curve_Tag_Conic)
+ {
+ const int l_next = (k < n - 1) ? (l + 1) : l_first;
+ if (ftoutline.tags[l] == FT_Curve_Tag_Conic &&
+ ftoutline.tags[l_next] == FT_Curve_Tag_Conic)
{
onpoints[j]++;
}
@@ -148,10 +150,13 @@ static VChar *freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *
if (k == 0) l_first = l;
/* virtual conic on-curve points */
- if (k < n - 1) {
- if (ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l + 1] == FT_Curve_Tag_Conic) {
- dx = (ftoutline.points[l].x + ftoutline.points[l + 1].x) * scale / 2.0f;
- dy = (ftoutline.points[l].y + ftoutline.points[l + 1].y) * scale / 2.0f;
+ {
+ const int l_next = (k < n - 1) ? (l + 1) : l_first;
+ if (ftoutline.tags[l] == FT_Curve_Tag_Conic &&
+ ftoutline.tags[l_next] == FT_Curve_Tag_Conic)
+ {
+ dx = (ftoutline.points[l].x + ftoutline.points[l_next].x) * scale / 2.0f;
+ dy = (ftoutline.points[l].y + ftoutline.points[l_next].y) * scale / 2.0f;
/* left handle */
bezt->vec[0][0] = (dx + (2 * ftoutline.points[l].x) * scale) / 3.0f;
@@ -162,8 +167,8 @@ static VChar *freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *
bezt->vec[1][1] = dy;
/* right handle */
- bezt->vec[2][0] = (dx + (2 * ftoutline.points[l + 1].x) * scale) / 3.0f;
- bezt->vec[2][1] = (dy + (2 * ftoutline.points[l + 1].y) * scale) / 3.0f;
+ bezt->vec[2][0] = (dx + (2 * ftoutline.points[l_next].x) * scale) / 3.0f;
+ bezt->vec[2][1] = (dy + (2 * ftoutline.points[l_next].y) * scale) / 3.0f;
bezt->h1 = bezt->h2 = HD_ALIGN;
bezt->radius = 1.0f;