freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] inkscape fails with FT221


From: David Turner
Subject: Re: [ft-devel] inkscape fails with FT221
Date: Thu, 18 May 2006 00:22:41 +0200
User-agent: Thunderbird 1.5 (X11/20060309)

Hello David,

David Somers
a écrit :
> I've just tried to install Inkscape 0.43 on my gentoo box and it (or one of 
> its components) seems to use the FT internal headers:
>
> libnrtype/FontInstance.cpp:29:40: freetype/internal/tttypes.h: No such file 
> or 
> directory
> libnrtype/FontInstance.cpp:30:41: freetype/internal/ftstream.h: No such file 
> or directory
>
> Has anybody else come across this problem or is my box in a state of 
> confusion?
>
>   
No, it's just that Inkscape is one of the rogue clients, though this was
undetected until
you tried recompiling it.

Here's a patch that fixes the issue. Ironically, the code doesn't really
need the internal
headers to compile. The patch also prevents a potential segmentation fault.

Hope it will be accepted for 0.44 soon. Werner, could you add the patch
to our
public page ?

Regards,

- David Turner
- The FreeType Project (www.freetype.org)


diff -burN inkscape-0.43/src/libnrtype/FontInstance.cpp 
inkscape-0.43-new/src/libnrtype/FontInstance.cpp
--- inkscape-0.43/src/libnrtype/FontInstance.cpp        2005-09-26 
07:22:49.000000000 +0200
+++ inkscape-0.43-new/src/libnrtype/FontInstance.cpp    2006-05-17 
22:44:46.000000000 +0200
@@ -24,11 +24,11 @@
 #include "RasterFont.h"
 
 /* Freetype 2 */
-# include <freetype/ftoutln.h>
-# include <freetype/ftbbox.h>
-# include <freetype/internal/tttypes.h>
-# include <freetype/internal/ftstream.h>
-# include <freetype/tttags.h>
+# include <ft2build.h>
+# include FT_OUTLINE_H
+# include FT_BBOX_H
+# include FT_TRUETYPE_TAGS_H
+# include FT_TRUETYPE_TABLES_H
 # include <pango/pangoft2.h>
 
 
@@ -423,10 +423,10 @@
                        }
                        if ( theFace->glyph->format == ft_glyph_format_outline 
) {
                                FT_Outline_Funcs ft2_outline_funcs = {
-                                       ft2_move_to,
-                                       ft2_line_to,
-                                       ft2_conic_to,
-                                       ft2_cubic_to,
+                                       (FT_Outline_MoveToFunc)  ft2_move_to,
+                                       (FT_Outline_LineToFunc)  ft2_line_to,
+                                       (FT_Outline_ConicToFunc) ft2_conic_to,
+                                       (FT_Outline_CubicToFunc) ft2_cubic_to,
                                        0, 0
                                };
                                n_g.outline=new Path;
@@ -474,12 +474,12 @@
 
     theFace=pango_ft2_font_get_face(pFont);
 
-       if ( theFace->units_per_EM == 0 ) return false; // bitmap font
-       
        if ( pFont == NULL ) return false;
        
        if ( theFace == NULL ) return false;
 
+    if ( !FT_IS_SCALABLE(theFace) ) return false;  // bitmap font
+
     TT_HoriHeader *hhea = (TT_HoriHeader*)FT_Get_Sfnt_Table(theFace, 
ft_sfnt_hhea);
     if (hhea == NULL) return false;
     run = hhea->caret_Slope_Run;

reply via email to

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