commit freetype2 for openSUSE:Factory
Hello community, here is the log from the commit of package freetype2 for openSUSE:Factory checked in at 2012-12-21 14:35:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/freetype2 (Old) and /work/SRC/openSUSE:Factory/.freetype2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "freetype2", Maintainer is "jw@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/freetype2/freetype2.changes 2012-06-25 14:04:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.freetype2.new/freetype2.changes 2012-12-21 14:35:41.000000000 +0100 @@ -1,0 +2,12 @@ +Thu Dec 20 13:56:36 UTC 2012 - idonmez@suse.com + +- Update to version 2.4.11 + * Some vulnerabilities in the BDF implementation have been fixed. + * Support for OpenType collections (OTC) has been added. + * Pure CFF fonts within an SFNT wrapper are now supported. + * Minor rendering improvements to the auto-hinter. + * `FT_GlyphSlot_Oblique' now uses a shear angle of 12°. +- Modify freetype2-subpixel.patch for new subpixel hinting option. +- Drop fix-build.patch: no longer needed + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/freetype2/ft2demos.changes 2012-06-25 14:04:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.freetype2.new/ft2demos.changes 2012-12-21 14:35:41.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Dec 20 13:57:51 UTC 2012 - idonmez@suse.com + +- Update to version 2.4.11 + * ftdiff now supports UTF-8 encoded input files for option `-f'. + * Using keys `r' and `R', you can now adjust the stroker radius in + ftview. + +------------------------------------------------------------------- Old: ---- fix-build.patch freetype-2.4.10.tar.bz2 freetype-doc-2.4.10.tar.bz2 ft2demos-2.4.10.tar.bz2 New: ---- freetype-2.4.11.tar.bz2 freetype-doc-2.4.11.tar.bz2 ft2demos-2.4.11.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ freetype2.spec ++++++ --- /var/tmp/diff_new_pack.wgFkuv/_old 2012-12-21 14:35:45.000000000 +0100 +++ /var/tmp/diff_new_pack.wgFkuv/_new 2012-12-21 14:35:45.000000000 +0100 @@ -25,7 +25,7 @@ Obsoletes: freetype2-64bit %endif # -Version: 2.4.10 +Version: 2.4.11 Release: 0 Summary: A TrueType Font Library License: SUSE-Freetype or GPL-2.0+ @@ -35,7 +35,6 @@ Source1: http://download.savannah.gnu.org/releases/freetype/freetype-doc-%{version}.tar.bz2 Source3: baselibs.conf Patch3: freetype2-bitmap-foundry.patch -Patch9: fix-build.patch Patch10: freetype2-no_rpath.patch Patch308961: bugzilla-308961-cmex-workaround.patch Patch200: freetype2-subpixel.patch @@ -80,7 +79,6 @@ %define enable_subpixel_rendering 0 %setup -q -n freetype-%{version} -a 1 %patch3 -p 1 -b .bitmap-foundry -%patch9 -p 1 %patch10 %patch308961 -p 1 %if %{enable_subpixel_rendering} ++++++ ft2demos.spec ++++++ --- /var/tmp/diff_new_pack.wgFkuv/_old 2012-12-21 14:35:45.000000000 +0100 +++ /var/tmp/diff_new_pack.wgFkuv/_new 2012-12-21 14:35:45.000000000 +0100 @@ -17,7 +17,7 @@ Name: ft2demos -Version: 2.4.10 +Version: 2.4.11 Release: 0 Summary: Freetype2 Utilities and Demo Programs License: GPL-2.0+ @@ -26,7 +26,6 @@ Url: http://www.freetype.org Source0: http://savannah.nongnu.org/download/freetype/freetype-%{version}.tar.bz2 Source1: http://savannah.nongnu.org/download/freetype/ft2demos-%{version}.tar.bz2 -Patch9: fix-build.patch Patch308961: bugzilla-308961-cmex-workaround.patch Patch50: ft2demos-build-testname.patch Patch200: freetype2-subpixel.patch @@ -45,7 +44,6 @@ %prep %define enable_subpixel_rendering 0%{?opensuse_bs} %setup -q -n freetype-%{freetype_version} -b 1 -%patch9 -p 1 %patch308961 -p 1 pushd ../ft2demos-%{version} %patch50 -p 1 ++++++ freetype-2.4.10.tar.bz2 -> freetype-2.4.11.tar.bz2 ++++++ ++++ 19578 lines of diff (skipped) ++++++ freetype-doc-2.4.10.tar.bz2 -> freetype-doc-2.4.11.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.4.10/docs/ft2faq.html new/freetype-2.4.11/docs/ft2faq.html --- old/freetype-2.4.10/docs/ft2faq.html 2011-02-25 06:16:34.000000000 +0100 +++ new/freetype-2.4.11/docs/ft2faq.html 2012-12-16 15:03:45.000000000 +0100 @@ -25,7 +25,7 @@ cellpadding="5"> <tr> <td bgcolor="#06425F"> - <a href="../../index2.html"> + <a href="../../index.html"> <img src="../../image/fond3.jpg" align="right" border="0" @@ -352,7 +352,7 @@ <p>FreeType 1 includes an extension to support OpenType text layout processing. This support hasn't become part of FreeType 2; a much improved version is now part of the <a - href="http:///www.pango.org">Pango</a> library.</p> + href="http://www.pango.org">Pango</a> library.</p> </li> </ul> @@ -381,7 +381,7 @@ font files with small code size and very low memory usage.</p> <p>A good, freely available font editor is <a - href="http://fontforge.sf.net">FontForge</a>.</p> + href="http://fontforge.org/">FontForge</a>.</p> <p><a href="#top" class="index"> @@ -623,7 +623,7 @@ <p>The algorithm has been specifically designed for FreeType. It is based on ideas that were originally found in the implementation of the - <a href="http://www.levien.com/libart">libArt</a> graphics library to + <a href="http://www.levien.com/libart/">libArt</a> graphics library to compute the <em>exact pixel coverage</em> of a vector image with no sub-sampling and filtering.</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.4.10/docs/tutorial/example1.c new/freetype-2.4.11/docs/tutorial/example1.c --- old/freetype-2.4.10/docs/tutorial/example1.c 2005-09-03 09:37:12.000000000 +0200 +++ new/freetype-2.4.11/docs/tutorial/example1.c 2012-07-10 06:34:07.000000000 +0200 @@ -98,7 +98,7 @@ error = FT_Init_FreeType( &library ); /* initialize library */ /* error handling omitted */ - error = FT_New_Face( library, argv[1], 0, &face ); /* create face object */ + error = FT_New_Face( library, filename, 0, &face );/* create face object */ /* error handling omitted */ /* use 50pt at 100dpi */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.4.10/docs/tutorial/step1.html new/freetype-2.4.11/docs/tutorial/step1.html --- old/freetype-2.4.10/docs/tutorial/step1.html 2010-05-16 15:38:13.000000000 +0200 +++ new/freetype-2.4.11/docs/tutorial/step1.html 2012-09-20 12:27:16.000000000 +0200 @@ -953,7 +953,7 @@ <p>We use the function <tt>FT_Load_Char</tt> instead of <tt>FT_Load_Glyph</tt>. As you probably imagine, it is equivalent to calling <tt>FT_Get_Char_Index</tt> then - <tt>FT_Get_Load_Glyph</tt>.</p> + <tt>FT_Load_Glyph</tt>.</p> </li> <li> @@ -1098,7 +1098,7 @@ <a href="step2.html">FreeType 2 Tutorial Step 2</a> </h3> -<p><font size=-3>Last update: 16-May-2010</font></p> +<p><font size=-3>Last update: 20-Sep-2012</font></p> </body> </html> ++++++ freetype2-subpixel.patch ++++++ --- /var/tmp/diff_new_pack.wgFkuv/_old 2012-12-21 14:35:46.000000000 +0100 +++ /var/tmp/diff_new_pack.wgFkuv/_new 2012-12-21 14:35:46.000000000 +0100 @@ -1,8 +1,8 @@ -Index: freetype-2.4.3/include/freetype/config/ftoption.h +Index: freetype-2.4.11/include/freetype/config/ftoption.h =================================================================== ---- freetype-2.4.3.orig/include/freetype/config/ftoption.h 2010-07-05 06:38:55.000000000 +0200 -+++ freetype-2.4.3/include/freetype/config/ftoption.h 2010-10-29 16:15:59.582654748 +0200 -@@ -93,7 +93,7 @@ FT_BEGIN_HEADER +--- freetype-2.4.11.orig/include/freetype/config/ftoption.h ++++ freetype-2.4.11/include/freetype/config/ftoption.h +@@ -92,7 +92,7 @@ FT_BEGIN_HEADER /* This is done to allow FreeType clients to run unmodified, forcing */ /* them to display normal gray-level anti-aliased glyphs. */ /* */ @@ -11,3 +11,12 @@ /*************************************************************************/ +@@ -577,7 +577,7 @@ FT_BEGIN_HEADER + /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */ + /* defined. */ + /* */ +-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */ ++#define TT_CONFIG_OPTION_SUBPIXEL_HINTING + + + /*************************************************************************/ ++++++ ft2demos-2.4.10.tar.bz2 -> ft2demos-2.4.11.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/ChangeLog new/ft2demos-2.4.11/ChangeLog --- old/ft2demos-2.4.10/ChangeLog 2012-06-15 06:48:45.000000000 +0200 +++ new/ft2demos-2.4.11/ChangeLog 2012-12-19 09:43:43.000000000 +0100 @@ -1,3 +1,101 @@ +2012-12-19 Werner Lemberg <wl@gnu.org> + + * Version 2.4.11 released. + ========================== + + + Tag sources with `VER-2-4-11'. + + * README: Updated. + +2012-11-27 Werner Lemberg <wl@gnu.org> + + * src/ftdiff.c (usage): Updated. + +2012-11-26 Werner Lemberg <wl@gnu.org> + + [ftdiff] Accept UTF-8 encoded input files. + + * src/ftdiff.c (default_text): Use `char*' instead of `unsigned + char*'. + (main): Ditto for `text' variable. + (RenderStateRec): Ditto for `text' member. + (render_state_draw): Ditto for `text' argument. + Use `utf8_next' to parse UTF-8 encoded text. + +2012-11-04 Werner Lemberg <wl@gnu.org> + + [ftdump] Improve output of cmap tables. + + * src/ftdump.c (Print_Charmaps): Indicate Unicode Variation + Sequences. + +2012-10-20 Werner Lemberg <wl@gnu.org> + + * src/ftdump.c: (main): Minor output formatting. + +2012-09-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [ftview] Use pixel size calculation that works for bitmap fonts too. + + * src/ftview.c (Render_Stroke, Render_Embolden): Rely on the status + point size and resolution to get the pixel size. + +2012-08-19 Alexei Podtelezhnikov <apodtele@gmail.com> + + [ftview] Implement adjustable stroker radius. + + * src/ftview.c (status): New field 'radius'. + (Render_Stroke): Updated. + (Process_Event): Add the keys `r' and `R' to handle the change. + (event_radius_change): Implement it. + (event_help): Updated. + +2012-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> + + [ftview] Use more readable loop. + + * src/ftview.c (main): use do-while instead of for-break. + +2012-07-20 Alexei Podtelezhnikov <apodtele@gmail.com> + + [ftview] Clean up the code. + + * src/ftview.c (Render_Slanted): Move the shear matrix setup out of + the loop. + * src/ftview.c (Render_Embolden): Move the emboldening strength + calculation out of the loop. + +2012-07-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + [ftview] Further code homogenization. + + * src/ftview.c (Render_Stroke): Stroker contructor and destructor + are moved to... + * src/ftcommon.c (FTDemo_New, FTDemo_Done): Here. + * src/ftcommon.h (FTDemo_Handle): New field `stroker'. + +2012-07-11 Werner Lemberg <wl@gnu.org> + + Avoid crashes in case of failure. + + * src/ftcommon.c (FTDemo_Draw_Slot), src/ftgrid.c + (grid_status_draw_outline), src/ftview.c (Render_Stroke): Only call + `FT_Done_Glyph' in case of success. + +2012-07-10 Alexei Podtelezhnikov <apodtele@gmail.com> + + [ftview] Clean up and homogenize the code. + + * src/ftview.c (Render_Stroke): Replace while-loop with for-loop. + (Render_Slanted): Ditto. + (Render_Embolden): Ditto. + (Render_All): Ditto. + (Render_Waterfall): Ditto. + (Render_Stroke): Homogenize with other similar functions. + (Render_Text): Code cleanup. + (event_gamma_grid): Ditto. + 2012-06-15 Werner Lemberg <wl@gnu.org> * Version 2.4.10 released. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/README new/ft2demos-2.4.11/README --- old/ft2demos-2.4.10/README 2012-06-15 06:49:06.000000000 +0200 +++ new/ft2demos-2.4.11/README 2012-12-19 09:45:11.000000000 +0100 @@ -8,8 +8,8 @@ downloaded one of the stable FreeType 2 source packages from our server, you most probably have to rename its directory, for example: - mv freetype-2.4.10 freetype2 on Unix - rename freetype-2.4.10 freetype2 on Windows + mv freetype-2.4.11 freetype2 on Unix + rename freetype-2.4.11 freetype2 on Windows WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/src/ftcommon.c new/ft2demos-2.4.11/src/ftcommon.c --- old/ft2demos-2.4.10/src/ftcommon.c 2012-03-07 13:59:10.000000000 +0100 +++ new/ft2demos-2.4.11/src/ftcommon.c 2012-07-18 10:45:42.000000000 +0200 @@ -286,6 +286,8 @@ FT_Bitmap_New( &handle->bitmap ); + FT_Stroker_New( handle->library, &handle->stroker ); + handle->encoding = encoding; handle->hinted = 1; @@ -336,6 +338,7 @@ FT_Done_Glyph( glyph->image ); } + FT_Stroker_Done( handle->stroker ); FT_Bitmap_Done( handle->library, &handle->bitmap ); FTC_Manager_Done( handle->cache_manager ); FT_Done_FreeType( handle->library ); @@ -946,8 +949,8 @@ return error; error = FTDemo_Draw_Glyph( handle, display, glyph, pen_x, pen_y ); - - FT_Done_Glyph( glyph ); + if ( !error ) + FT_Done_Glyph( glyph ); return error; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/src/ftcommon.h new/ft2demos-2.4.11/src/ftcommon.h --- old/ft2demos-2.4.10/src/ftcommon.h 2012-03-03 07:37:27.000000000 +0100 +++ new/ft2demos-2.4.11/src/ftcommon.h 2012-07-18 10:45:42.000000000 +0200 @@ -21,6 +21,7 @@ #include FT_CACHE_MANAGER_H #include FT_GLYPH_H +#include FT_STROKER_H #include FT_BITMAP_H #include <stdlib.h> @@ -191,6 +192,7 @@ int string_reload; FT_Encoding encoding; + FT_Stroker stroker; FT_Bitmap bitmap; /* used as bitmap conversion buffer */ } FTDemo_Handle; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/src/ftdiff.c new/ft2demos-2.4.11/src/ftdiff.c --- old/ft2demos-2.4.10/src/ftdiff.c 2012-03-02 19:40:54.000000000 +0100 +++ new/ft2demos-2.4.11/src/ftdiff.c 2012-11-27 07:38:11.000000000 +0100 @@ -45,6 +45,7 @@ " -r R use resolution R dpi (default: 72dpi)\n" " -s S set character size to S points (default: 16pt)\n" " -f TEXTFILE change displayed text, using text in TEXTFILE\n" + " (in UTF-8 encoding)\n" "\n" ); exit( 1 ); @@ -101,15 +102,15 @@ } DisplayRec, *Display; - static const unsigned char* default_text = (unsigned char*) + static const char* default_text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras sit amet" " dui. Nam sapien. Fusce vestibulum ornare metus. Maecenas ligula orci," " consequat vitae, dictum nec, lacinia non, elit. Aliquam iaculis" " molestie neque. Maecenas suscipit felis ut pede convallis malesuada." " Aliquam erat volutpat. Nunc pulvinar condimentum nunc. Donec ac sem vel" " leo bibendum aliquam. Pellentesque habitant morbi tristique senectus et" - " netus et malesuada fames ac turpis egestas.\n\n" - + " netus et malesuada fames ac turpis egestas.\n" + "\n" "Sed commodo. Nulla ut libero sit amet justo varius blandit. Mauris vitae" " nulla eget lorem pretium ornare. Proin vulputate erat porta risus." " Vestibulum malesuada, odio at vehicula lobortis, nisi metus hendrerit" @@ -119,7 +120,8 @@ " sit amet augue. Morbi ullamcorper mattis enim. Aliquam erat volutpat." " Morbi nec felis non enim pulvinar lobortis. Ut libero. Nullam id orci" " quis nisl dapibus rutrum. Suspendisse consequat vulputate leo. Aenean" - " non orci non tellus iaculis vestibulum. Sed neque.\n\n"; + " non orci non tellus iaculis vestibulum. Sed neque.\n" + "\n"; /***********************************************************************/ @@ -174,25 +176,25 @@ typedef struct _RenderStateRec { - FT_Library library; - const unsigned char* text; - int resolution; - float char_size; - int need_rescale; - int col; - ColumnStateRec columns[3]; - FontFace faces; - int num_faces; - int face_index; - const char* filepath; - const char* filename; - FT_Face face; - FT_Size size; - char** files; - char* message; - DisplayRec display; - char filepath0[1024]; - char message0[1024]; + FT_Library library; + const char* text; + int resolution; + float char_size; + int need_rescale; + int col; + ColumnStateRec columns[3]; + FontFace faces; + int num_faces; + int face_index; + const char* filepath; + const char* filename; + FT_Face face; + FT_Size size; + char** files; + char* message; + DisplayRec display; + char filepath0[1024]; + char message0[1024]; } RenderStateRec, *RenderState; @@ -415,26 +417,29 @@ /** RENDERING **/ static void - render_state_draw( RenderState state, - const unsigned char* text, - int idx, - int x, - int y, - int width, - int height ) - { - ColumnState column = &state->columns[idx]; - const unsigned char* p = text; - long load_flags = FT_LOAD_DEFAULT; - FT_Face face = state->face; - int left = x; - int right = x + width; - int bottom = y + height; - int line_height; - FT_UInt prev_glyph = 0; - FT_Pos prev_rsb_delta = 0; - FT_Pos x_origin = x << 6; - HintMode rmode = column->hint_mode; + render_state_draw( RenderState state, + const char* text, + int idx, + int x, + int y, + int width, + int height ) + { + ColumnState column = &state->columns[idx]; + const char* p = text; + const char* p_end = p + strlen( text ); + long load_flags = FT_LOAD_DEFAULT; + FT_Face face = state->face; + int left = x; + int right = x + width; + int bottom = y + height; + int line_height; + FT_UInt prev_glyph = 0; + FT_Pos prev_rsb_delta = 0; + FT_Pos x_origin = x << 6; + HintMode rmode = column->hint_mode; + FT_Bool have_0x0A = 0; + FT_Bool have_0x0D = 0; if ( !face ) @@ -461,39 +466,65 @@ if ( rmode == HINT_MODE_UNHINTED ) load_flags |= FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP; - for ( ; *p; p++ ) + while ( 1 ) { + int ch; FT_UInt gindex; FT_GlyphSlot slot = face->glyph; FT_Bitmap* map = &slot->bitmap; int xmax; + ch = utf8_next( &p, p_end ); + /* handle newlines */ - if ( *p == 0x0A ) + if ( ch == 0x0A ) { - if ( p[1] == 0x0D ) - p++; - x_origin = left << 6; - y += line_height; - prev_rsb_delta = 0; - if ( y >= bottom ) - break; + if ( have_0x0D ) + { + have_0x0A = 0; + have_0x0D = 0; + } + else + { + have_0x0A = 1; + + x_origin = left << 6; + y += line_height; + prev_rsb_delta = 0; + if ( y >= bottom ) + break; + } + continue; } - else if ( *p == 0x0D ) + else if ( ch == 0x0D ) { - if ( p[1] == 0x0A ) - p++; - x_origin = left << 6; - y += line_height; - prev_rsb_delta = 0; - if ( y >= bottom ) - break; + if ( have_0x0A ) + { + have_0x0A = 0; + have_0x0D = 0; + } + else + { + have_0x0D = 1; + + x_origin = left << 6; + y += line_height; + prev_rsb_delta = 0; + if ( y >= bottom ) + break; + } + continue; } + else + { + have_0x0A = 0; + have_0x0D = 0; + } - gindex = FT_Get_Char_Index( state->face, p[0] ); + gindex = FT_Get_Char_Index( state->face, ch ); error = FT_Load_Glyph( face, gindex, load_flags ); if ( error ) @@ -1147,7 +1178,7 @@ int resolution = -1; double size = -1; const char* textfile = NULL; - unsigned char* text = (unsigned char*)default_text; + char* text = (char*)default_text; char* execname = ft_basename( argv[0] ); @@ -1201,7 +1232,7 @@ tsize = ftell( tfile ); fseek( tfile, 0, SEEK_SET ); - text = (unsigned char*)malloc( tsize + 1 ); + text = (char*)malloc( tsize + 1 ); if ( text != NULL ) { @@ -1211,7 +1242,7 @@ else { fprintf( stderr, "not enough memory to read `%s'\n", textfile ); - text = (unsigned char *)default_text; + text = (char *)default_text; } fclose( tfile ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/src/ftdump.c new/ft2demos-2.4.11/src/ftdump.c --- old/ft2demos-2.4.10/src/ftdump.c 2010-07-13 07:30:28.000000000 +0200 +++ new/ft2demos-2.4.11/src/ftdump.c 2012-11-04 17:46:49.000000000 +0100 @@ -2,7 +2,7 @@ /* */ /* The FreeType project -- a free and portable quality TrueType renderer. */ /* */ -/* Copyright 1996-2000, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2000, 2003-2007, 2010, 2012 by */ /* D. Turner, R.Wilhelm, and W. Lemberg */ /* */ /****************************************************************************/ @@ -402,7 +402,7 @@ case TT_PLATFORM_MACINTOSH: if ( name.language_id != TT_MAC_LANGID_ENGLISH ) - printf( " (language=%d)", name.language_id ); + printf( " (language=%u)", name.language_id ); fputs( ":\n", stdout ); switch ( name.encoding_id ) @@ -509,13 +509,23 @@ for( i = 0; i < face->num_charmaps; i++ ) { - printf( " %d: platform %d, encoding %d, language %d", + FT_ULong lang_id = FT_Get_CMap_Language_ID( face->charmaps[i] ); + + + printf( " %d: platform %u, encoding %2u", i, face->charmaps[i]->platform_id, - face->charmaps[i]->encoding_id, - (FT_UInt)FT_Get_CMap_Language_ID( face->charmaps[i] ) ); + face->charmaps[i]->encoding_id ); + + if ( lang_id == 0xFFFFFFFFUL ) + printf( " (Unicode Variation Sequences)" ); + else + printf( " language %lu", + lang_id ); + if ( i == active ) printf( " (active)" ); + printf ( "\n" ); if ( verbose ) @@ -675,7 +685,7 @@ printf( "\n" ); Print_Type( face ); - printf( " glyph count: %ld\n", face->num_glyphs ); + printf( " glyph count: %ld\n", face->num_glyphs ); if ( name_tables && FT_IS_SFNT( face ) ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/src/ftgrid.c new/ft2demos-2.4.11/src/ftgrid.c --- old/ft2demos-2.4.10/src/ftgrid.c 2012-03-02 19:19:00.000000000 +0100 +++ new/ft2demos-2.4.11/src/ftgrid.c 2012-07-11 12:08:20.000000000 +0200 @@ -511,9 +511,10 @@ FT_Get_Glyph( slot, &glyph ); FT_Glyph_Stroke( &glyph, stroker, 1 ); - FTDemo_Draw_Glyph_Color( handle, display, glyph, &ox, &oy, - st->outline_color ); - FT_Done_Glyph( glyph ); + error = FTDemo_Draw_Glyph_Color( handle, display, glyph, &ox, &oy, + st->outline_color ); + if ( !error ) + FT_Done_Glyph( glyph ); } /* now draw the points */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.4.10/src/ftview.c new/ft2demos-2.4.11/src/ftview.c --- old/ft2demos-2.4.10/src/ftview.c 2012-05-28 22:42:15.000000000 +0200 +++ new/ft2demos-2.4.11/src/ftview.c 2012-09-21 21:41:06.000000000 +0200 @@ -77,6 +77,7 @@ double gamma; double xbold_factor; double ybold_factor; + double radius; double slant; int debug; @@ -94,7 +95,7 @@ int fw_index; } status = { RENDER_MODE_ALL, FT_ENCODING_NONE, 72, 48, -1, - 1.0, 0.04, 0.04, 0.22, + 1.0, 0.04, 0.04, 0.02, 0.22, 0, 0, 0, 0, 0, NULL, { 0 }, 0, 0, 0, { 0x10, 0x40, 0x70, 0x40, 0x10 }, 2 }; @@ -124,10 +125,13 @@ Render_Stroke( int num_indices, int first_index ) { - int start_x, start_y, step_y, x, y; - int i; - FT_Size size; - FT_Stroker stroker = NULL; + int start_x, start_y, step_y, x, y; + int i; + FT_Size size; + FT_Face face; + FT_GlyphSlot slot; + + FT_Fixed radius; error = FTDemo_Get_Size( handle, &size ); @@ -139,22 +143,19 @@ } INIT_SIZE( size, start_x, start_y, step_y, x, y ); + face = size->face; + slot = face->glyph; - i = first_index; - - error = FT_Stroker_New( handle->library, &stroker ); - if ( error ) - goto Exit; + radius = status.radius * ( status.ptsize * status.res / 72 ); - FT_Stroker_Set( stroker, 64, + FT_Stroker_Set( handle->stroker, radius, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINEJOIN_ROUND, 0 ); - while ( i < num_indices ) + for ( i = first_index; i < num_indices; i++ ) { - int gindex; - FT_GlyphSlot slot; + int gindex; if ( handle->encoding == FT_ENCODING_NONE ) @@ -162,9 +163,8 @@ else gindex = FTDemo_Get_Index( handle, i ); - error = FT_Load_Glyph( size->face, gindex, + error = FT_Load_Glyph( face, gindex, handle->load_flags | FT_LOAD_NO_BITMAP ); - slot = size->face->glyph; if ( !error && slot->format == FT_GLYPH_FORMAT_OUTLINE ) { @@ -175,7 +175,7 @@ if ( error ) goto Next; - error = FT_Glyph_Stroke( &glyph, stroker, 1 ); + error = FT_Glyph_Stroke( &glyph, handle->stroker, 1 ); if ( error ) { FT_Done_Glyph( glyph ); @@ -183,10 +183,11 @@ } error = FTDemo_Draw_Glyph( handle, display, glyph, &x, &y ); - FT_Done_Glyph( glyph ); + if ( !error ) + FT_Done_Glyph( glyph ); if ( error ) - status.Fail++; + goto Next; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; @@ -197,18 +198,10 @@ } } else - { Next: status.Fail++; - } - - i++; } - Exit: - if ( stroker ) - FT_Stroker_Done( stroker ); - return error; } @@ -217,9 +210,13 @@ Render_Slanted( int num_indices, int first_index ) { - int start_x, start_y, step_y, x, y; - int i; - FT_Size size; + int start_x, start_y, step_y, x, y; + int i; + FT_Size size; + FT_Face face; + FT_GlyphSlot slot; + + FT_Matrix shear; error = FTDemo_Get_Size( handle, &size ); @@ -231,13 +228,31 @@ } INIT_SIZE( size, start_x, start_y, step_y, x, y ); + face = size->face; + slot = face->glyph; - i = first_index; + /***************************************************************/ + /* */ + /* 2*2 affine transformation matrix, 16.16 fixed float format */ + /* */ + /* Shear matrix: */ + /* */ + /* | x' | | 1 k | | x | x' = x + ky */ + /* | | = | | * | | <==> */ + /* | y' | | 0 1 | | y | y' = y */ + /* */ + /* outline' shear outline */ + /* */ + /***************************************************************/ + + shear.xx = 1 << 16; + shear.xy = (FT_Fixed)( status.slant * ( 1 << 16 ) ); + shear.yx = 0; + shear.yy = 1 << 16; - while ( i < num_indices ) + for ( i = first_index; i < num_indices; i++ ) { - int gindex; - FT_Face face = size->face; + int gindex; if ( handle->encoding == FT_ENCODING_NONE ) @@ -248,37 +263,12 @@ error = FT_Load_Glyph( face, gindex, handle->load_flags ); if ( !error ) { - FT_Matrix shear; - FT_Outline* outline; - - - /***************************************************************/ - /* */ - /* 2*2 affine transformation matrix, 16.16 fixed float format */ - /* */ - /* Shear matrix: */ - /* */ - /* | x' | | 1 k | | x | x' = x + ky */ - /* | | = | | * | | <==> */ - /* | y' | | 0 1 | | y | y' = y */ - /* */ - /* outline' shear outline */ - /* */ - /***************************************************************/ - - shear.xx = 1 << 16; - shear.xy = (FT_Fixed)( status.slant * ( 1 << 16 ) ); - shear.yx = 0; - shear.yy = 1 << 16; + FT_Outline_Transform( &slot->outline, &shear ); - outline = &(face->glyph)->outline; - - FT_Outline_Transform( outline, &shear ); - - error = FTDemo_Draw_Slot( handle, display, face->glyph, &x, &y ); + error = FTDemo_Draw_Slot( handle, display, slot, &x, &y ); if ( error ) - status.Fail++; + goto Next; else if ( X_TOO_LONG( x, size, display ) ) { x = start_x; @@ -289,9 +279,8 @@ } } else + Next: status.Fail++; - - i++; } return error; @@ -302,9 +291,13 @@ Render_Embolden( int num_indices, int first_index ) { - int start_x, start_y, step_y, x, y; - int i; - FT_Size size; + int start_x, start_y, step_y, x, y; + int i; + FT_Size size; + FT_Face face; + FT_GlyphSlot slot; + + FT_Pos xstr, ystr; error = FTDemo_Get_Size( handle, &size ); @@ -316,13 +309,16 @@ } INIT_SIZE( size, start_x, start_y, step_y, x, y ); + face = size->face; + slot = face->glyph; - i = first_index; + ystr = status.ptsize * status.res / 72; + xstr = status.xbold_factor * ystr; + ystr = status.ybold_factor * ystr; - while ( i < num_indices ) + for ( i = first_index; i < num_indices; i++ ) { - int gindex; - FT_Face face = size->face; + int gindex; if ( handle->encoding == FT_ENCODING_NONE ) @@ -336,20 +332,6 @@ /* this is essentially the code of function */ /* `FT_GlyphSlot_Embolden' */ - FT_GlyphSlot slot = face->glyph; - FT_Library library = slot->library; - FT_Pos xstr, ystr; - - - if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && - slot->format != FT_GLYPH_FORMAT_BITMAP ) - goto Next; - - ystr = FT_MulFix( face->units_per_EM, - face->size->metrics.y_scale ); - xstr = (FT_Fixed)( ystr * status.xbold_factor ); - ystr = (FT_Fixed)( ystr * status.ybold_factor ); - if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { error = FT_Outline_EmboldenXY( &slot->outline, xstr, ystr ); @@ -365,10 +347,12 @@ if ( error ) goto Next; - error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr ); + error = FT_Bitmap_Embolden( slot->library, &slot->bitmap, + xstr, ystr ); if ( error ) goto Next; - } + } else + goto Next; if ( slot->advance.x ) slot->advance.x += xstr; @@ -400,8 +384,6 @@ else Next: status.Fail++; - - i++; } return error; @@ -427,9 +409,7 @@ INIT_SIZE( size, start_x, start_y, step_y, x, y ); - i = first_index; - - while ( i < num_indices ) + for ( i = first_index; i < num_indices; i++ ) { int gindex; @@ -450,8 +430,6 @@ if ( Y_TOO_LONG( y, size, display ) ) break; } - - i++; } return FT_Err_Ok; @@ -463,15 +441,12 @@ int first_index ) { int start_x, start_y, step_y, x, y; - int i; FT_Size size; const char* p; const char* pEnd; - num_indices = num_indices; /* pacify compiler */ - error = FTDemo_Get_Size( handle, &size ); if ( error ) { @@ -481,18 +456,13 @@ INIT_SIZE( size, start_x, start_y, step_y, x, y ); - i = first_index; - p = (const char*)Text; pEnd = p + strlen( (const char*)Text ); - while ( i > 0 ) - { + while ( first_index-- ) utf8_next( &p, pEnd ); - i--; - } - while ( num_indices != 0 ) + while ( num_indices-- ) { FT_UInt gindex; int ch; @@ -521,9 +491,6 @@ break; } } - - if ( num_indices > 0 ) - num_indices -= 1; } return FT_Err_Ok; @@ -568,12 +535,6 @@ for ( pt_size = first_size; pt_size < max_size; pt_size += 64 ) { - sprintf( (char*)text, - "%g: the quick brown fox jumps over the lazy dog" - " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", pt_size / 64.0 ); - - p = text; - FTDemo_Set_Current_Charsize( handle, pt_size, status.res ); error = FTDemo_Get_Size( handle, &size ); @@ -593,7 +554,11 @@ if ( y >= display->bitmap->rows ) break; - while ( *p ) + sprintf( (char*)text, + "%g: the quick brown fox jumps over the lazy dog" + " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", pt_size / 64.0 ); + + for ( p = text; *p; p++ ) { FT_UInt gindex; @@ -605,8 +570,6 @@ status.Fail++; else if ( X_TOO_LONG( x, size, display ) ) break; - - p++; } } @@ -659,6 +622,7 @@ grLn(); grWriteln( " x, X adjust horizontal emboldening" ); grWriteln( " y, Y adjust vertical emboldening" ); + grWriteln( " r, R adjust stroking radius" ); grWriteln( " s, S adjust slanting" ); grLn(); grWriteln( " F toggle custom LCD filter mode" ); @@ -710,9 +674,9 @@ grWriteCellString( display->bitmap, 0, 0, "Gamma grid", display->fore_color ); - for ( g = 1; g <= gammas; g += 1 ) + for ( g = 1; g <= gammas; g++ ) { - double ggamma = g / 10.0; + double ggamma = 0.1 * g; char temp[6]; int y = y_0 + ( yside + 1 ) * ( g - 1 ); int nx, ny; @@ -797,6 +761,23 @@ static void + event_radius_change( double delta ) + { + status.radius += delta; + + if ( status.radius > 0.05 ) + status.radius = 0.05; + else if ( status.radius < 0.0 ) + status.radius = 0.0; + + sprintf( status.header_buffer, "stroking radius changed to %.3f", + status.radius ); + + status.header = status.header_buffer; + } + + + static void event_slant_change( double delta ) { status.slant += delta; @@ -1034,6 +1015,14 @@ event_slant_change( -0.02 ); break; + case grKEY( 'r' ): + event_radius_change( 0.005 ); + break; + + case grKEY( 'R' ): + event_radius_change( -0.005 ); + break; + case grKEY( 'x' ): event_bold_change( 0.005, 0.0 ); break; @@ -1436,7 +1425,7 @@ FTDemo_Update_Current_Flags( handle ); - for ( ;; ) + do { FTDemo_Display_Clear( display ); @@ -1490,9 +1479,7 @@ status.header = 0; grListenSurface( display->surface, 0, &event ); - if ( Process_Event( &event ) ) - break; - } + } while ( Process_Event( &event ) == 0 ); printf( "Execution completed successfully.\n" ); printf( "Fails = %d\n", status.Fail ); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de