2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323...
[blender.git] / source / blender / blenlib / intern / freetypefont.c
index 74f152ac635ffb206158edf5d551be5e6a0a883c..4b7b5914b60f6dd2fd944ebcf8e3f75c2ef6fd43 100644 (file)
 #include "BLI_blenlib.h"
 #include "BLI_arithb.h"  
 
-#include "BIF_toolbox.h"
+//XXX #include "BIF_toolbox.h"
 
 #include "BKE_global.h"
+#include "BKE_font.h"
 #include "BKE_utildefines.h"
 
 #include "DNA_vfont_types.h"
@@ -178,6 +179,7 @@ void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vfd)
                                                bezt->vec[2][1] = (dy + (2 * ftoutline.points[l+1].y)* scale) / 3.0;
 
                                                bezt->h1= bezt->h2= HD_ALIGN;
+                                               bezt->radius= 1.0f;
                                                bezt++;
                                        }
                                }
@@ -264,6 +266,7 @@ void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vfd)
                                        {
                                                bezt->h1= bezt->h2= HD_ALIGN;
                                        }
+                                       bezt->radius= 1.0f;
                                        bezt++;
                                }
                        }
@@ -280,13 +283,7 @@ int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
        struct TmpFont *tf;
        
        // Find the correct FreeType font
-       tf= G.ttfdata.first;
-       while(tf)
-       {
-               if(tf->vfont == vfont)
-                       break;
-               tf= tf->next;           
-       }
+       tf= vfont_find_tmpfont(vfont);
        
        // What, no font found. Something strange here
        if(!tf) return FALSE;
@@ -404,8 +401,6 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
                        break;
                lcode = charcode;
        }
-       
-       err = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
 
        return vfd;     
 }
@@ -432,7 +427,7 @@ static int check_freetypefont(PackedFile * pf)
                                                        &face );
        if(err) {
                success = 0;
-           error("This is not a valid font");
+           //XXX error("This is not a valid font");
        }
        else {
 /*
@@ -461,7 +456,7 @@ static int check_freetypefont(PackedFile * pf)
                        if (glyph->format == ft_glyph_format_outline ) {
                                success = 1;
                        } else {
-                               error("Selected Font has no outline data");
+                               //XXX error("Selected Font has no outline data");
                                success = 0;
                        }
                }
@@ -479,7 +474,7 @@ VFontData *BLI_vfontdata_from_freetypefont(PackedFile *pf)
        //init Freetype 
        err = FT_Init_FreeType( &library);
        if(err) {
-               error("Failed to load the Freetype font library");
+               //XXX error("Failed to load the Freetype font library");
                return 0;
        }
 
@@ -504,7 +499,7 @@ int BLI_vfontchar_from_freetypefont(VFont *vfont, unsigned long character)
        // Init Freetype
        err = FT_Init_FreeType(&library);
        if(err) {
-               error("Failed to load the Freetype font library");
+               //XXX error("Failed to load the Freetype font library");
                return 0;
        }