diff options
Diffstat (limited to 'source/blender/blenlib/intern/freetypefont.c')
-rw-r--r-- | source/blender/blenlib/intern/freetypefont.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 6d6abc88999..1b569cf794f 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -46,12 +46,13 @@ #include "BLI_vfontdata.h" #include "BLI_blenlib.h" -#include "BLI_math.h" +#include "BLI_math.h" +#include "BLI_utildefines.h" //XXX #include "BIF_toolbox.h" #include "BKE_font.h" -#include "BKE_utildefines.h" + #include "DNA_vfont_types.h" #include "DNA_packedFile_types.h" @@ -126,7 +127,6 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf // get number of on-curve points for beziertriples (including conic virtual on-points) for(j = 0; j < ftoutline.n_contours; j++) { - l = 0; for(k = 0; k < npoints[j]; k++) { if(j > 0) l = k + ftoutline.contours[j - 1] + 1; else l = k; if(ftoutline.tags[l] == FT_Curve_Tag_On) @@ -252,15 +252,15 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf } // get the handles that are aligned, tricky... - // DistVL2Dfl, check if the three beztriple points are on one line - // VecLenf, see if there's a distance between the three points - // VecLenf again, to check the angle between the handles + // dist_to_line_v2, check if the three beztriple points are on one line + // len_squared_v2v2, see if there's a distance between the three points + // len_squared_v2v2 again, to check the angle between the handles // finally, check if one of them is a vector handle if((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001) && - (len_v3v3(bezt->vec[0], bezt->vec[1]) > 0.0001) && - (len_v3v3(bezt->vec[1], bezt->vec[2]) > 0.0001) && - (len_v3v3(bezt->vec[0], bezt->vec[2]) > 0.0002) && - (len_v3v3(bezt->vec[0], bezt->vec[2]) > MAX2(len_v3v3(bezt->vec[0], bezt->vec[1]), len_v3v3(bezt->vec[1], bezt->vec[2]))) && + (len_squared_v2v2(bezt->vec[0], bezt->vec[1]) > 0.0001*0.0001) && + (len_squared_v2v2(bezt->vec[1], bezt->vec[2]) > 0.0001*0.0001) && + (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > 0.0002*0.0001) && + (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > MAX2(len_squared_v2v2(bezt->vec[0], bezt->vec[1]), len_squared_v2v2(bezt->vec[1], bezt->vec[2]))) && bezt->h1 != HD_VECT && bezt->h2 != HD_VECT) { bezt->h1= bezt->h2= HD_ALIGN; @@ -367,7 +367,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf) // No charmap found from the ttf so we need to figure it out if(glyph_index == 0) { - FT_CharMap found = 0; + FT_CharMap found = NULL; FT_CharMap charmap; int n; @@ -477,7 +477,7 @@ VFontData *BLI_vfontdata_from_freetypefont(PackedFile *pf) err = FT_Init_FreeType( &library); if(err) { //XXX error("Failed to load the Freetype font library"); - return 0; + return NULL; } success = check_freetypefont(pf); |