summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2006-05-20 00:07:15 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2006-05-20 00:07:15 +0000
commitd2de2941ed93d19a9e04bb25e0b9198bc750fd51 (patch)
tree5fac481b68b10578917b41a4de1a3d713043b7a6 /src/libnrtype
parentremove inclusion of internal freetype headers (which weren't needed anyway) (diff)
downloadinkscape-d2de2941ed93d19a9e04bb25e0b9198bc750fd51.tar.gz
inkscape-d2de2941ed93d19a9e04bb25e0b9198bc750fd51.zip
* src/libnrtype/FontInstance.cpp: patch from David Turner of the
FreeType Project. Fixes a compilation problem and a possible segmentation fault. (bzr r900)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/FontInstance.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index b06b74d90..504cab76a 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -20,9 +20,11 @@
#include "RasterFont.h"
/* Freetype 2 */
-# include <freetype/ftoutln.h>
-# include <freetype/ftbbox.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>
@@ -402,7 +404,7 @@ void font_instance::LoadGlyph(int glyph_id)
if ( pFont == NULL ) return;
InitTheFace();
#ifndef USE_PANGO_WIN32
- if ( theFace->units_per_EM == 0 ) return; // bitmap font
+ if ( !FT_IS_SCALABLE(theFace) ) return; // bitmap font
#endif
if ( id_to_no.find(glyph_id) == id_to_no.end() ) {
@@ -514,10 +516,10 @@ void font_instance::LoadGlyph(int glyph_id)
}
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;
@@ -557,7 +559,7 @@ bool font_instance::FontMetrics(double &ascent,double &descent,double &leading)
descent=fabs(otm.otmDescent*scale);
leading=fabs(otm.otmLineGap*scale);
#else
- if ( theFace->units_per_EM == 0 ) return false; // bitmap font
+ if ( !FT_IS_SCALABLE(theFace) ) return false; // bitmap font
ascent=fabs(((double)theFace->ascender)/((double)theFace->units_per_EM));
descent=fabs(((double)theFace->descender)/((double)theFace->units_per_EM));
leading=fabs(((double)theFace->height)/((double)theFace->units_per_EM));
@@ -581,7 +583,7 @@ bool font_instance::FontSlope(double &run, double &rise)
run=otm.otmsCharSlopeRun;
rise=otm.otmsCharSlopeRise;
#else
- if ( theFace->units_per_EM == 0 ) return false; // bitmap font
+ 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;