BRL-CAD
vfont.h File Reference
#include "common.h"
#include "bu/file.h"
#include "bu/endian.h"
#include "bu/str.h"
Include dependency graph for vfont.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  header
 
struct  dispatch
 
struct  vfont_file
 

Macros

#define SWAB(shrt)   if (bu_byteorder() == BU_BIG_ENDIAN) (shrt=(((shrt)>>8) & 0xff) | (((shrt)<<8) & 0xff00))
 
#define SWABV(shrt)   (bu_byteorder() == BU_BIG_ENDIAN) ? ((((shrt)>>8) & 0xff) | (((shrt)<<8) & 0xff00)) : (shrt)
 
#define FONTBUFSZ   200
 
#define FONTNAME   "times.r.6" /* Default font name. */
 
#define FONTNAMESZ   128
 
#define SIGNBIT   (1<<7)
 
#define SIGNMASK   ~SIGNBIT
 
#define TWOSCOMP(chr)   ((~(chr)&0xff)+1)
 
#define SignedChar(chr)   chr
 

Functions

struct vfont_file get_font (const char *fontname, void(*vfont_log)(const char *fmt,...))
 

Detailed Description

Header file for putting fonts up.

Definition in file vfont.h.

Macro Definition Documentation

#define SWAB (   shrt)    if (bu_byteorder() == BU_BIG_ENDIAN) (shrt=(((shrt)>>8) & 0xff) | (((shrt)<<8) & 0xff00))

Definition at line 35 of file vfont.h.

Referenced by get_font().

#define SWABV (   shrt)    (bu_byteorder() == BU_BIG_ENDIAN) ? ((((shrt)>>8) & 0xff) | (((shrt)<<8) & 0xff00)) : (shrt)

Definition at line 36 of file vfont.h.

#define FONTBUFSZ   200

Definition at line 38 of file vfont.h.

#define FONTNAME   "times.r.6" /* Default font name. */

Definition at line 39 of file vfont.h.

Referenced by get_font().

#define FONTNAMESZ   128

Definition at line 40 of file vfont.h.

#define SIGNBIT   (1<<7)

Definition at line 42 of file vfont.h.

#define SIGNMASK   ~SIGNBIT

Definition at line 43 of file vfont.h.

#define TWOSCOMP (   chr)    ((~(chr)&0xff)+1)

Definition at line 44 of file vfont.h.

#define SignedChar (   chr)    chr

Definition at line 49 of file vfont.h.

Function Documentation

struct vfont_file get_font ( const char *  fontname,
void(*)(const char *fmt,...)  vfont_log 
)

get_font validates and loads the specified fontname, logging any error messages via the provided log callback.

the ffdes field of the returned struct vfont_file indicates whether the load was successful or not.

Definition at line 37 of file vfont.c.

References bu_brlcad_data(), bu_ftell(), bu_strlcpy, vfont_file::dir, vfont_file::ffdes, FONTNAME, FONTNAMESZ, vfont_file::hdr, header::magic, header::maxx, header::maxy, memset(), vfont_file::offset, header::size, SWAB, and header::xtend.

Here is the call graph for this function: