Re: [ft-devel] benchmark of sfnt checksum recalculation
Here is 2nd testcases checking ca. 1900 fonts [...] Thanks. Since this is a once-per-font operation, I don't think we should think too much about timing issues. Please proceed. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] benchmark of sfnt checksum recalculation
Hi all, Just I've committed to make tricky font detector to ignore the existing checksum written in the TrueType header, like this. In my benchmark, the latency in FT_New_Face() introduced by this change is less than 0.01%. However, if anybody thinks extra seek of the font file is problematic (and you do not care about the embedded tricky font, e.g. FT2 is used only for font files, not a document package), please post a message. I'm really willing to add configuration option to prioritize the existing value. Regards, mpsuzuki diff --git a/ChangeLog b/ChangeLog index fe645d4..0221692 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2011-04-30 suzuki toshiya mpsuz...@hiroshima-u.ac.jp + [truetype] Recalculate the sfnt table checksum always. + + * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate + the sfnt table checksum even if non-zero value is writte in + the TrueType font header. Some bad PDF generators write + wrong values. For detail, see examples and benchmark tests + of the latency by recalculation: + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html + +2011-04-30 suzuki toshiya mpsuz...@hiroshima-u.ac.jp + [truetype] Register a set of tricky fonts, NEC FA family. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 11cd4b3..942361c 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -213,8 +213,10 @@ tt_get_sfnt_checksum( TT_Faceface, FT_UShort i ) { +#if 0 /* if we believe the written value, use following part. */ if ( face-dir_tables[i].CheckSum ) return face-dir_tables[i].CheckSum; +#endif if ( !face-goto_table ) return 0; Werner LEMBERG wrote: Here is 2nd testcases checking ca. 1900 fonts [...] Thanks. Since this is a once-per-font operation, I don't think we should think too much about timing issues. Please proceed. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] benchmark of sfnt checksum recalculation
Just I've committed to make tricky font detector to ignore the existing checksum written in the TrueType header, [...] Thanks! Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] configure option to disable mmap()
Dear Werner, During the benchmark tests, sometimes I build FreeType2 library without mmap() on GNU/Linux, to guess the situation in legacy or embedded systems without mmap() functions that the slower standard I/O is used. At present, configure script always uses mmap() if it is found, so I added an option --disable-mmap to ignore it. Although this is only for developers who want to make irregular configuration, is it meaningful to merger in official source code? diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw index a58d20c..2b071f8 100644 --- a/builds/unix/configure.raw +++ b/builds/unix/configure.raw @@ -189,8 +189,14 @@ CPPFLAGS=${orig_CPPFLAGS} # Here we check whether we can use our mmap file component. -AC_FUNC_MMAP -if test $ac_cv_func_mmap_fixed_mapped != yes; then +AC_ARG_ENABLE([mmap], + AS_HELP_STRING([--disable-mmap], + [do not check mmap() and do not use]), + [enable_mmap=no],[enable_mmap=yes]) +if test x${enable_mmap} != xno; then + AC_FUNC_MMAP +fi +if test x${enable_mmap} = xno -o $ac_cv_func_mmap_fixed_mapped != yes ; then FTSYS_SRC='$(BASE_DIR)/ftsystem.c' else FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] configure option to disable mmap()
At present, configure script always uses mmap() if it is found, so I added an option --disable-mmap to ignore it. Although this is only for developers who want to make irregular configuration, is it meaningful to merger in official source code? If you think this is useful, please add it! Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel