freetype
[Top][All Lists]
Advanced

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

[Freetype] Compact format fonts


From: Eric Nickell
Subject: [Freetype] Compact format fonts
Date: Mon, 4 Nov 2002 13:05:29 PST

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.

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]);
  }
}

Attachment: ANBAIB+Times-Italic.cff
Description: Binary data


reply via email to

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