From 4db572fa920c77654159a3041a39baf076272c23 Mon Sep 17 00:00:00 2001 From: kramm Date: Sat, 5 Jul 2003 17:37:58 +0000 Subject: [PATCH] some fixes for font in proba.pdf. --- pdf2swf/ttf2pt1/ft.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pdf2swf/ttf2pt1/ft.c b/pdf2swf/ttf2pt1/ft.c index 92ffedd..12f44c6 100644 --- a/pdf2swf/ttf2pt1/ft.c +++ b/pdf2swf/ttf2pt1/ft.c @@ -5,6 +5,7 @@ * */ +#include "../../config.h" #ifdef USE_FREETYPE #include @@ -307,9 +308,8 @@ glenc( e = 0; } - if( FT_Set_Charmap(face, face->charmaps[e]) ) { + if( !face->charmaps || FT_Set_Charmap(face, face->charmaps[e]) ) { fprintf(stderr, "**** Cannot set charmap in FreeType ****\n"); - exit(1); } populate_map: @@ -414,6 +414,10 @@ fnmetrics( { int len; + if(!fm->name_family) + fm->name_family = ""; + if(!fm->name_style) + fm->name_style= ""; len = strlen(fm->name_family) + strlen(fm->name_style) + 2; if(( fm->name_full = malloc(len) )==NULL) { fprintf (stderr, "****malloc failed %s line %d\n", __FILE__, __LINE__); @@ -452,7 +456,7 @@ fnmetrics( #endif /* ENABLE_SFNT */ for(i=0; fm->name_ps[i]!=0; i++) if(fm->name_ps[i] == ' ') - fm->name_ps[i] = '_'; /* no spaces in the Postscript name *m + fm->name_ps[i] = '_'; /* no spaces in the Postscript name */ /* guess the boldness from the font names */ fm->force_bold=0; @@ -462,14 +466,15 @@ fnmetrics( fieldstocheck[2] = fm->name_ps; for(i=0; !fm->force_bold && iforce_bold=1; break; -- 1.7.10.4