Back to index

texmacs  1.0.7.15
Classes | Functions
tt_post.h File Reference
#include "sfnt.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tt_post_table

Functions

struct tt_post_tablett_read_post_table (sfnt *sfont)
void tt_release_post_table (struct tt_post_table *post)
USHORT tt_lookup_post_table (struct tt_post_table *post, const char *glyphname)

Class Documentation

struct tt_post_table

Definition at line 28 of file tt_post.h.

Class Members
USHORT count
char ** glyphNamePtr
ULONG isFixedPitch
Fixed italicAngle
ULONG maxMemType1
ULONG maxMemType42
ULONG minMemType1
ULONG minMemType42
char ** names
USHORT numberOfGlyphs
FWord underlinePosition
FWord underlineThickness
Fixed Version

Function Documentation

USHORT tt_lookup_post_table ( struct tt_post_table post,
const char *  glyphname 
)

Definition at line 153 of file tt_post.c.

{
  USHORT  gid;

  ASSERT(post && glyphname);

  for (gid = 0; gid < post->count; gid++) {
    if (post->glyphNamePtr[gid] &&
       !strcmp(glyphname, post->glyphNamePtr[gid])) {
      return  gid;
    }
  }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct tt_post_table* tt_read_post_table ( sfnt sfont) [read]

Definition at line 97 of file tt_post.c.

{
  struct tt_post_table *post;
  ULONG  offset;

  offset = sfnt_locate_table(sfont, "post");

  post   = NEW(1, struct tt_post_table);

  post->Version            = sfnt_get_ulong(sfont); /* Fixed */
  post->italicAngle        = sfnt_get_ulong(sfont); /* Fixed */
  post->underlinePosition  = sfnt_get_short(sfont); /* FWord */
  post->underlineThickness = sfnt_get_short(sfont); /* FWord */
  post->isFixedPitch       = sfnt_get_ulong(sfont);
  post->minMemType42       = sfnt_get_ulong(sfont);
  post->maxMemType42       = sfnt_get_ulong(sfont);
  post->minMemType1        = sfnt_get_ulong(sfont);
  post->maxMemType1        = sfnt_get_ulong(sfont);

  post->numberOfGlyphs    = 0;
  post->glyphNamePtr      = NULL;
  post->count             = 0;
  post->names             = NULL;

  if (post->Version == 0x00010000UL) {
    post->numberOfGlyphs  = 258; /* wrong */
    post->glyphNamePtr    = (char **) macglyphorder;
    post->count           = 0;
    post->names           = NULL;
  } else if (post->Version == 0x00025000UL) {
    WARN("TrueType 'post' version 2.5 found (deprecated)");
    post->numberOfGlyphs  = 0; /* wrong */
    post->glyphNamePtr    = NULL;
    post->count           = 0;
    post->names           = NULL;
  } else if (post->Version == 0x00020000UL) {
    if (read_v2_post_names(post, sfont) < 0) {
      WARN("Invalid TrueType 'post' table...");
      tt_release_post_table(post);
      post = NULL;
    }
  } else if (post->Version == 0x00030000UL) {
    post->numberOfGlyphs  = 0; /* wrong */
    post->glyphNamePtr    = NULL;
    post->count           = 0;
    post->names           = NULL;
  } else {
    WARN("Unknown 'post' version: %08X", post->Version);
    tt_release_post_table(post);
    post = NULL;
  }

  return post;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void tt_release_post_table ( struct tt_post_table post)

Definition at line 170 of file tt_post.c.

{
  USHORT i;

  ASSERT(post);

  if (post->glyphNamePtr && post->Version != 0x00010000UL)
    RELEASE(post->glyphNamePtr);
  if (post->names) {
    for (i = 0; i < post->count; i++) {
      if (post->names[i])
       RELEASE(post->names[i]);
    }
    RELEASE(post->names);
  }
  post->count        = 0;
  post->glyphNamePtr = NULL;
  post->names        = NULL;

  RELEASE(post);

  return;
}

Here is the caller graph for this function: