From: <ai...@us...> - 2008-10-17 22:34:39
|
Revision: 8916 http://plplot.svn.sourceforge.net/plplot/?rev=8916&view=rev Author: airwin Date: 2008-10-17 22:34:35 +0000 (Fri, 17 Oct 2008) Log Message: ----------- Make debug messages a little more readable by humans. Modified Paths: -------------- trunk/src/plfreetype.c Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2008-10-17 19:13:44 UTC (rev 8915) +++ trunk/src/plfreetype.c 2008-10-17 22:34:35 UTC (rev 8916) @@ -116,7 +116,7 @@ * Some debugging macros \*--------------------------------------------------------------------------*/ -#define Debug5(a,b,c,d,e) do {if (pls->debug){fprintf(stderr,a,b,c,d,e);}}while(0) +#define Debug6(a,b,c,d,e,f) do {if (pls->debug){fprintf(stderr,a,b,c,d,e,f);}}while(0) /* FUNCTION PROTOTYPES */ @@ -815,7 +815,8 @@ /* this will help work out underlining and overlining*/ - Debug5("%d %d %d %d;",FT->face->underline_position>>6, + Debug6("%s %d %d %d %d\n","plD_render_freetype_text:", + FT->face->underline_position>>6, FT->face->descender>>6, FT->face->ascender>>6, ((FT->face->underline_position*-1)+FT->face->ascender)>>6); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-10-20 12:46:31
|
Revision: 8941 http://plplot.svn.sourceforge.net/plplot/?rev=8941&view=rev Author: andrewross Date: 2008-10-20 12:46:29 +0000 (Mon, 20 Oct 2008) Log Message: ----------- Patch from Martin Sarajervi to ensure plfreetype.c correctly free's textbuf. Modified Paths: -------------- trunk/src/plfreetype.c Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2008-10-20 10:13:43 UTC (rev 8940) +++ trunk/src/plfreetype.c 2008-10-20 12:46:29 UTC (rev 8941) @@ -1058,7 +1058,8 @@ if (FT) { if ((FT->smooth_text==1)&&(FT->BLENDED_ANTIALIASING==0)) plscmap0n(FT->ncol0_org); - + if (FT->textbuf) + free(FT->textbuf); FT_Done_Library(FT->library); free(pls->FT); pls->FT=NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-10-29 15:13:49
|
Revision: 8981 http://plplot.svn.sourceforge.net/plplot/?rev=8981&view=rev Author: andrewross Date: 2008-10-29 15:13:39 +0000 (Wed, 29 Oct 2008) Log Message: ----------- Add missing brackets to if statement. Caused uninitialised variable error with valgrind. It probably didn't affect results since the clipping would prevent an extraneous call to FT->pixel. Modified Paths: -------------- trunk/src/plfreetype.c Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2008-10-29 14:54:26 UTC (rev 8980) +++ trunk/src/plfreetype.c 2008-10-29 15:13:39 UTC (rev 8981) @@ -461,10 +461,11 @@ for (k=0;k<n;k++) { bittest=128; for (j=0;j<8;j++) { - if ((bittest&(unsigned char)slot->bitmap.buffer[(i*n)+k])==bittest) + if ((bittest&(unsigned char)slot->bitmap.buffer[(i*n)+k])==bittest) { xx = x+(k*8)+j; if ( (xx >= clipxmin) && (xx <= clipxmax) ) FT->pixel(pls, xx, y+i); + } bittest>>=1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-07-06 20:59:49
|
Revision: 12198 http://plplot.svn.sourceforge.net/plplot/?rev=12198&view=rev Author: airwin Date: 2012-07-06 20:59:43 +0000 (Fri, 06 Jul 2012) Log Message: ----------- AWI for phil rosenberg. Allow Windows users to use the PLPLOT_FREETYPE_FONT_DIR environment variable (just like users on Unix platforms do now) at run time to specify the directory where plfreetype looks for font files. Modified Paths: -------------- trunk/src/plfreetype.c Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2012-07-06 20:54:41 UTC (rev 12197) +++ trunk/src/plfreetype.c 2012-07-06 20:59:43 UTC (rev 12198) @@ -660,15 +660,16 @@ #if defined ( MSDOS ) || defined ( WIN32 ) -// -// Work out if we have Win95+ or Win3.?... sort of. -// Actually, this just tries to find the place where the fonts live by looking -// for arial, which should be on all windows machines. -// At present, it only looks in two places, on one drive. I might change this -// soon. -// - if ( WINDIR_PATH == NULL ) +// First check for a user customised location and if +// the fonts aren't found there try the default Windows +// locations + if ( ( a = getenv( "PLPLOT_FREETYPE_FONT_DIR" ) ) != NULL ) + strncpy( font_dir, a, PLPLOT_MAX_PATH - 1 ); + else if ( strlen( PL_FREETYPE_FONT_DIR ) > 0 ) + strncpy( font_dir, PL_FREETYPE_FONT_DIR, PLPLOT_MAX_PATH - 1 ); + else if ( WINDIR_PATH == NULL ) { + //try to guess the font location by looking for arial font on C: if ( access( "c:\\windows\\fonts\\arial.ttf", F_OK ) == 0 ) { strcpy( font_dir, "c:/windows/fonts/" ); @@ -682,6 +683,7 @@ } else { + //Try to guess the font location by looking for Arial font in the Windows Path strncat( WINDIR_PATH, "\\fonts\\arial.ttf", PLPLOT_MAX_PATH - 1 - strlen( WINDIR_PATH ) ); if ( access( WINDIR_PATH, F_OK ) == 0 ) { @@ -694,6 +696,7 @@ else plwarn( "Could not find font path; I sure hope you have defined fonts manually !" ); } + font_dir[PLPLOT_MAX_PATH - 1] = '\0'; if ( pls->debug ) fprintf( stderr, "%s\n", font_dir ); @@ -821,10 +824,10 @@ plexit( "FT_SetFace: Error loading a font in freetype" ); } - //check if the charmap was loaded correctly - freetype only checks for a unicode charmap - //if it is not set then use the first found charmap in the font - if ( FT->face->charmap == NULL ) - FT_Select_Charmap( FT->face,FT->face->charmaps[0]->encoding ); + //check if the charmap was loaded correctly - freetype only checks for a unicode charmap + //if it is not set then use the first found charmap in the font + if ( FT->face->charmap == NULL ) + FT_Select_Charmap( FT->face, FT->face->charmaps[0]->encoding ); } } FT_Set_Char_Size( FT->face, 0, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-01-19 10:07:48
|
Revision: 9345 http://plplot.svn.sourceforge.net/plplot/?rev=9345&view=rev Author: andrewross Date: 2009-01-19 10:07:43 +0000 (Mon, 19 Jan 2009) Log Message: ----------- Remove special case for text drawn in background colour in FT_PlotChar. This fixes example 24 when used with -drvopt smooth=1 (the default) and gd / wxwidgets drivers. Modified Paths: -------------- trunk/src/plfreetype.c Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2009-01-19 09:27:22 UTC (rev 9344) +++ trunk/src/plfreetype.c 2009-01-19 10:07:43 UTC (rev 9345) @@ -451,7 +451,11 @@ clipymin = tmp; } - if ((slot->bitmap.pixel_mode==ft_pixel_mode_mono)||(pls->icol0==0)) { + /* Comment this out as it fails for cases where we want to plot text + * in the background font, i.e. example 24. + */ + /*if ((slot->bitmap.pixel_mode==ft_pixel_mode_mono)||(pls->icol0==0)) {*/ + if (slot->bitmap.pixel_mode==ft_pixel_mode_mono) { x+=slot->bitmap_left; y-=slot->bitmap_top; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-07-04 20:33:46
|
Revision: 12196 http://plplot.svn.sourceforge.net/plplot/?rev=12196&view=rev Author: andrewross Date: 2012-07-04 20:33:40 +0000 (Wed, 04 Jul 2012) Log Message: ----------- Patch from Phil Rosenberg to fix freetype font handling if there is no unicode character map, as is the case with the Windows Symbol font. Modified Paths: -------------- trunk/src/plfreetype.c Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2012-07-04 20:27:19 UTC (rev 12195) +++ trunk/src/plfreetype.c 2012-07-04 20:33:40 UTC (rev 12196) @@ -820,6 +820,11 @@ if ( FT_New_Face( FT->library, font_name, 0, &FT->face ) ) plexit( "FT_SetFace: Error loading a font in freetype" ); } + + //check if the charmap was loaded correctly - freetype only checks for a unicode charmap + //if it is not set then use the first found charmap in the font + if ( FT->face->charmap == NULL ) + FT_Select_Charmap( FT->face,FT->face->charmaps[0]->encoding ); } } FT_Set_Char_Size( FT->face, 0, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |