Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsAFMObject.cpp File Reference
#include "nsAFMObject.h"
#include "Helvetica.h"
#include "Helvetica-Bold.h"
#include "Helvetica-BoldOblique.h"
#include "Helvetica-Oblique.h"
#include "Times-Roman.h"
#include "Times-Bold.h"
#include "Times-BoldItalic.h"
#include "Times-Italic.h"
#include "Courier.h"
#include "Courier-Bold.h"
#include "Courier-BoldOblique.h"
#include "Courier-Oblique.h"
#include "Symbol.h"
#include "nsReadableUtils.h"
#include "nsVoidArray.h"

Go to the source code of this file.

Classes

struct  SubstituteMap
struct  keyname_st
 
A static structure initialized AFM font keyword definitions 3/12/99 dwc More...

Defines

#define NS_IS_BOLD(weight)   ((weight) >= 401 ? 1 : 0)
#define ISSPACE(ch)   ((ch)==' '||(ch)=='\n'||(ch)=='\r'||(ch)=='\t'||(ch)==';')
#define CORRECTSTRING(d)   (d?d:"")
#define BOOLOUT(B)   (mPSFontInfo->mIsBaseFont==PR_TRUE?"PR_TRUE":"PR_FALSE")

Functions

static PRBool PR_CALLBACK GenericFontEnumCallback (const nsString &aFamily, PRBool aGeneric, void *aData)
 
helper callback function

Variables

static SubstituteMap gSubstituteMap []
static const PRUint32 gNumSubstituteMap = sizeof(gSubstituteMap)/sizeof(SubstituteMap)
DefFonts gSubstituteFonts []
static struct keyname_st keynames []

Class Documentation

struct SubstituteMap

Definition at line 55 of file nsAFMObject.cpp.

Class Members
PRBool bold
PRInt16 index
PRUint8 italic
const char * name
struct keyname_st

A static structure initialized AFM font keyword definitions 3/12/99 dwc

Definition at line 105 of file nsAFMObject.cpp.

Class Members
AFMKey key
const char * name

Define Documentation

#define BOOLOUT (   B)    (mPSFontInfo->mIsBaseFont==PR_TRUE?"PR_TRUE":"PR_FALSE")

Definition at line 903 of file nsAFMObject.cpp.

#define CORRECTSTRING (   d)    (d?d:"")

Definition at line 902 of file nsAFMObject.cpp.

#define ISSPACE (   ch)    ((ch)==' '||(ch)=='\n'||(ch)=='\r'||(ch)=='\t'||(ch)==';')

Definition at line 195 of file nsAFMObject.cpp.

#define NS_IS_BOLD (   weight)    ((weight) >= 401 ? 1 : 0)

Definition at line 80 of file nsAFMObject.cpp.


Function Documentation

static PRBool PR_CALLBACK GenericFontEnumCallback ( const nsString aFamily,
PRBool  aGeneric,
void aData 
) [static]


helper callback function

Definition at line 302 of file nsAFMObject.cpp.

{
  nsVoidArray* array = NS_STATIC_CAST(nsVoidArray*, aData);
  char* name = ToNewCString(aFamily);
  if (name) {
    array->AppendElement(name);
    return PR_TRUE; // don't stop
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 78 of file nsAFMObject.cpp.

DefFonts gSubstituteFonts[]
Initial value:
 
{
  {"Times-Roman","Times",400,0,&Times_RomanAFM,AFMTimes_RomanChars,-1},
  {"Times-Bold","Times",700,0,&Times_BoldAFM,AFMTimes_BoldChars,-1},
  {"Times-BoldItalic","Times",700,1,&Times_BoldItalicAFM,AFMTimes_BoldItalicChars,-1},
  {"Times-Italic","Times",400,1,&Times_ItalicAFM,AFMTimes_ItalicChars,-1},
  {"Helvetica","Helvetica",400,0,&HelveticaAFM,AFMHelveticaChars,-1},
  {"Helvetica-Bold","Helvetica",700,0,&Helvetica_BoldAFM,AFMHelvetica_BoldChars,-1},
  {"Helvetica-BoldOblique","Helvetica",700,2,&Helvetica_BoldObliqueAFM,AFMHelvetica_BoldObliqueChars,-1},
  {"Helvetica-Oblique","Helvetica",400,2,&Helvetica_ObliqueAFM,AFMHelvetica_ObliqueChars,-1},
  {"Courier","Courier",400,0,&CourierAFM,AFMCourierChars,-1},
  {"Courier-Bold","Courier",700,0,&Courier_BoldAFM,AFMCourier_BoldChars,-1},
  {"Courier-BoldOblique","Courier",700,2,&Courier_BoldObliqueAFM,AFMCourier_BoldObliqueChars,-1},
  {"Courier-Oblique","Courier",400,2,&Courier_ObliqueAFM,AFMCourier_ObliqueChars,-1},
  {"Symbol","Symbol",400,0,&SymbolAFM,AFMSymbolChars,-1}
}

Definition at line 83 of file nsAFMObject.cpp.

Initial value:
 {
  { "serif", 0,0,0},
  { "serif", 0,1,1},
  { "serif", 1,1,2},
  { "serif", 1,0,3},
  { "sans-serif", 0,0,4},
  { "sans-serif", 0,1,5},
  { "sans-serif", 1,1,6},
  { "sans-serif", 1,0,7},
  { "monospace", 0,0,8},
  { "monospace", 0,1,9},
  { "monospace", 1,1,10},
  { "monospace", 1,0,11},
}

Definition at line 62 of file nsAFMObject.cpp.

struct keyname_st keynames[] [static]