freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Compact format fonts


From: David Turner
Subject: Re: [Freetype] Compact format fonts
Date: Sat, 23 Nov 2002 17:41:36 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

Hello Eric,

sorry for this late answer.

Eric Nickell wrote:
I've just started poking around a little at Freetype, mostly as a way to
decode cff fonts embedded in pdf documents. When I run the following
code, the type 1 font tests out fine (as far as opening it), but the cff
font does not.  Any suggestions on what I'm doing wrong?

Attached is the cff file I'm trying to read, and below are excerts of
our test code trying to open it.

I've tested your file, and FreeType rejects it because it cannot read
the private dictionary. It seems that that file contains an offset
(3839) that is outside the font file's length (3317 bytes).

I don't know if the problem comes from FreeType mal-reading the offset
from the file, or a broken input. Can you guarantee that your file
is OK ??

Regards,

- David Turner
- The FreeType Project  (www.freetype.org)


Eric


#include <stdio.h>
#include <freetype.h>

void TestNewFace();

char *testFiles[] = {
        "garamond-lightitalic.psf",
        "ANBAIB+Times-Italic.cff",
};

#define N_TESTFILES     2

main()
{
  TestNewFace();
}

void
DieFtError(char *s, FT_Error error)
{
  printf("%s %d\n", s, error);
  exit(error);
}

void
AssertNoFTError(FT_Error error, char *s)
{
  if (error != 0)
    DieFtError(s, error);
}

FT_Library
GetLibrary()
{
  FT_Library library;
  FT_Error error;

  AssertNoFTError(FT_Init_FreeType(&library), "FT_Init_FreeType");
  return library;
}

void
TestNewFace()
{
  FT_Library library;
  FT_Face face;
  int i;

  library = GetLibrary();
  for (i = 0; i <  N_TESTFILES; i++) {
    AssertNoFTError(FT_New_Face(library, testFiles[i], 0, &face),
testFiles[i]);
  }
}






reply via email to

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