[ft-devel] Re: render error after ftgrays: Speed up rendering of small cubic splines.

2010-08-24 Thread GRAHAM ASHER
Thanks for that. I'll have a look at it when I have time - probably at the 
weekend. I must say though that I did not make this checkin. Although the 
change 
is due to a suggestion of mine, someone else made the change and 'kindly' 
attributed it to me.

Can you supply the font file too? I assume it's an Adobe Type 1 file or 
something like that.

Graham




- Original Message 
From: kde...@vogtner.de kde...@vogtner.de
To: Graham Asher graham.as...@btinternet.com
Sent: Tuesday, 24 August, 2010 14:02:34
Subject: render error after ftgrays: Speed up rendering of small cubic 
splines.

Graham,

please find enclosed a test case (pdf) which includes the font and a
screen shot.

git bisect said:

/tmp/unter/freetype2 git bisect bad
7fb3ef64a24489189113f693696eaf935f500c3f is first bad commit
commit 7fb3ef64a24489189113f693696eaf935f500c3f
Author: Graham Asher graham.as...@btinternet.com
Date:   Thu Jun 10 08:10:57 2010 +0200

ftgrays: Speed up rendering of small cubic splines.

* src/smooth/ftgrays.c (gray_render_cubic): Implement new,
simplified algorithm to find out whether the spline can be replaced
with two straight lines.  See this thread for more:

  http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg0.html

:100644 100644 183237f08775ddd8e69134f992717f3a9e920f5c
83211cfb85702072ebb3d14b7d10be2cd1259aa2 M  ChangeLog
:04 04 13cdcced61359f0d3f72e75580006b7e824535e9
a3d9ee83023ed6fca1ad26f2e76e7577756f2212 M  src

Regards

Stefan


___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel


[ft-devel] Exposing tricky font list to FT2 client

2010-08-24 Thread mpsuzuki
Hi all,

By recent discussions in poppler mailing list (poppler
is an open source PDF rendering library forked from xpdf),
I found a typical scenario that the tricky font list
cannot force the hinting for tricky fonts like MingLiU.

  http://lists.freedesktop.org/archives/poppler/2010-August/006295.html

By my analysis(*1), it is hard for FT2 decide if hinting
should be forced for a font extracted from a PDF. The
information available at higher layer is important to
decide.

FT2 already provides an API to switch the hinting after
the creation of FT_Face object (FT_Face_SetUnpatentedHinting).
The FT2 clients with their own tricky font list can use
this API to force the hinting.

But, it seems that some developers don't want to maintain
their own external tricky font list.

Thus, I sketched an interface to configure the tricky font
list from FT2 client. The mechanism is quite simple:

1) Substitute the array of the string for tricky font family
name list (stored in TrueType driver) by FT_List object in
FT_Library (FT_Library-tricky_fonts).

  1-a) tricky_fonts is allocated when FT_Library is created.
  1-b) tricky_fonts is freed when FT_Library is destroyed.

2) Add 3 public functions to configure FT_Library-tricky_fonts 

FT_Library_TrickyFontList_Add( library, condition )
FT_Library_TrickyFontList_Remove( library, condition )
FT_Face_Get_TrickyLevel( face, tricky_level )

  2-a) at present, condition is a string FAMILYNAME=XXX.
   other properties(*2) can be supported in future.

  2-b) the condition string is duplicated to the buffer
   allocated during the insertion, and the buffer
   is freed during the removal.

3) Substitute tt_check_trickyness() by public function
FT_Face_Get_TrickyLevel().

4) Register known tricky fonts to FT_Library when TrueType
driver is initialized.

The following patch is a rough sketch. I'm wondering if
I should provide a simple function to check the list by
passing the family name string. In current sketch, FT2
clients should pass FT_Face object - if they want to check
before FT_Face creation, they have to make a fake FT_Face
object including family_name. Having a fake FT_Face object
and a genuine FT_Face object in one program might make
the maintainer confused.
--
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 7799b70..846385c 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1081,6 +1081,40 @@ FT_BEGIN_HEADER
 #define FT_FACE_FLAG_TRICKY( 1L  13 )
 
 
+  /*/
+  /*   */
+  /* Enum*/
+  /*FT_Face_Tricky_Level   */
+  /*   */
+  /* Description */
+  /*An enumeration type to indicate the tricky level of the face.  */
+  /*   */
+  /* Values  */
+  /*FT_FACE_TRICKY_NO: nothing in blacklist matches*/
+  /*   */
+  /*FT_FACE_TRICKY_EXACT: partial match in blacklisted fonts.  */
+  /*   */
+  /*FT_FACE_TRICKY_PARTIAL: partial match in blacklisted fonts.*/
+  /*   */
+  typedef enum  FT_Face_Tricky_Level_
+  {
+FT_FACE_TRICKY_NO,   /* match nothing in blacklist */
+FT_FACE_TRICKY_EXACT,/* exact match in blacklist */
+FT_FACE_TRICKY_PARTIAL   /* partial match in blacklist */ 
+  } FT_Face_Tricky_Level;
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Library_TrickyFontList_Add( FT_Library  library,
+ FT_String*  condition );
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Library_TrickyFontList_Remove( FT_Library  library,
+FT_String*  condition );
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Face_Get_TrickyLevel( FT_Faceface,
+   FT_Face_Tricky_Level*  level );
+
   /*
*
* @macro:
diff --git a/include/freetype/internal/ftobjs.h 
b/include/freetype/internal/ftobjs.h
index 670eb78..c47ffe5 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -850,6 +850,7 @@ FT_BEGIN_HEADER
 FT_ListRec renderers;/* list of renderers*/
 FT_Renderercur_renderer; /* current outline renderer */
 FT_Module  auto_hinter;
+FT_List