[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Minor modification of `FT_Outline_Check'?

From: Werner LEMBERG
Subject: [ft-devel] Minor modification of `FT_Outline_Check'?
Date: Thu, 25 Aug 2016 09:17:42 +0200 (CEST)


I got the following report.

  I found a .ttf file on the web whose outline->n_points and
  outline->n_contours are zero. FT_Outline_Check() reports success
  because of this condition:

    /* empty glyph? */
    if ( n_points == 0 && n_contours == 0 )
      return FT_Err_Ok;

  However, the for loop in FT_Outline_Decompose()

    for ( n = 0; n < outline->n_contours; n++ )

  is never executed which implies that the if condition should return
  failure.  I gather that FT_Outline_Decompose() should be called only
  if FT_Outline_Check() returns success, but, according to current
  code and one of my test files, FT_Outline_Decompose() should not be
  called at all.

  If you agree, can you fix the if statement in the next release?
  And, maybe, you even need to change "and" to "or" as well.

I'm inclined to do that, also clarifying the documentation to
explicitly explain what a valid outline means.

Any objections?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]