Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Typedefs | Functions
bdflib.c File Reference
#include <ft2build.h>
#include "bdf.h"
#include "bdferror.h"

Go to the source code of this file.

Macros

#define FT_COMPONENT   trace_bdflib
 
#define ACMSG1
 
#define ACMSG2
 
#define ACMSG3   "Font width != actual width. Old: %hd New: %hd.\n"
 
#define ACMSG4
 
#define ACMSG5   "Font ascent != actual ascent. Old: %hd New: %hd.\n"
 
#define ACMSG6   "Font descent != actual descent. Old: %hd New: %hd.\n"
 
#define ACMSG7   "Font height != actual height. Old: %hd New: %hd.\n"
 
#define ACMSG8   "Glyph scalable width (SWIDTH) adjustments made.\n"
 
#define ACMSG9   "SWIDTH field missing at line %ld. Set automatically.\n"
 
#define ACMSG10   "DWIDTH field missing at line %ld. Set to glyph width.\n"
 
#define ACMSG11   "SIZE bits per pixel field adjusted to %hd.\n"
 
#define ACMSG12   "Duplicate encoding %ld (%s) changed to unencoded.\n"
 
#define ACMSG13   "Glyph %ld extra rows removed.\n"
 
#define ACMSG14   "Glyph %ld extra columns removed.\n"
 
#define ACMSG15   "Incorrect glyph count: %ld indicated but %ld found.\n"
 
#define ACMSG16   "Glyph %ld missing columns padded with zero bits.\n"
 
#define ERRMSG1   "[line %ld] Missing `%s' line.\n"
 
#define ERRMSG2   "[line %ld] Font header corrupted or missing fields.\n"
 
#define ERRMSG3   "[line %ld] Font glyphs corrupted or missing fields.\n"
 
#define ERRMSG4   "[line %ld] BBX too big.\n"
 
#define ERRMSG5   "[line %ld] `%s' value too big.\n"
 
#define ERRMSG6   "[line %ld] Input line too long.\n"
 
#define ERRMSG7   "[line %ld] Font name too long.\n"
 
#define ERRMSG8   "[line %ld] Invalid `%s' value.\n"
 
#define ERRMSG9   "[line %ld] Invalid keyword.\n"
 
#define DBGMSG1   " [%6ld] %s" /* no \n */
 
#define DBGMSG2   " (0x%lX)\n"
 
#define INITIAL_HT_SIZE   241
 
#define setsbit(m, cc)   ( m[(FT_Byte)(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) )
 
#define sbitset(m, cc)   ( m[(FT_Byte)(cc) >> 3] & ( 1 << ( (cc) & 7 ) ) )
 
#define NO_SKIP   256 /* this value cannot be stored in a 'char' */
 
#define _BDF_START   0x0001
 
#define _BDF_FONT_NAME   0x0002
 
#define _BDF_SIZE   0x0004
 
#define _BDF_FONT_BBX   0x0008
 
#define _BDF_PROPS   0x0010
 
#define _BDF_GLYPHS   0x0020
 
#define _BDF_GLYPH   0x0040
 
#define _BDF_ENCODING   0x0080
 
#define _BDF_SWIDTH   0x0100
 
#define _BDF_DWIDTH   0x0200
 
#define _BDF_BBX   0x0400
 
#define _BDF_BITMAP   0x0800
 
#define _BDF_SWIDTH_ADJ   0x1000
 
#define _BDF_GLYPH_BITS
 
#define _BDF_GLYPH_WIDTH_CHECK   0x40000000UL
 
#define _BDF_GLYPH_HEIGHT_CHECK   0x80000000UL
 

Typedefs

typedef void(* hash_free_func) (hashnode node)
 
typedef FT_Error(* _bdf_line_func_t) (char *line, unsigned long linelen, unsigned long lineno, void *call_data, void *client_data)
 
typedef struct _bdf_list_t_ _bdf_list_t
 
typedef struct _bdf_parse_t_ _bdf_parse_t
 

Functions

 bdf_get_property (char *name, bdf_font_t *font)
 
 bdf_load_font (FT_Stream stream, FT_Memory extmemory, bdf_options_t *opts, bdf_font_t **font)
 
 bdf_free_font (bdf_font_t *font)
 
 bdf_get_font_property (bdf_font_t *font, const char *name)
 

Macro Definition Documentation

◆ _BDF_BBX

#define _BDF_BBX   0x0400

Definition at line 1115 of file bdflib.c.

◆ _BDF_BITMAP

#define _BDF_BITMAP   0x0800

Definition at line 1116 of file bdflib.c.

◆ _BDF_DWIDTH

#define _BDF_DWIDTH   0x0200

Definition at line 1114 of file bdflib.c.

◆ _BDF_ENCODING

#define _BDF_ENCODING   0x0080

Definition at line 1112 of file bdflib.c.

◆ _BDF_FONT_BBX

#define _BDF_FONT_BBX   0x0008

Definition at line 1108 of file bdflib.c.

◆ _BDF_FONT_NAME

#define _BDF_FONT_NAME   0x0002

Definition at line 1106 of file bdflib.c.

◆ _BDF_GLYPH

#define _BDF_GLYPH   0x0040

Definition at line 1111 of file bdflib.c.

◆ _BDF_GLYPH_BITS

#define _BDF_GLYPH_BITS
Value:
_BDF_ENCODING | \
_BDF_SWIDTH | \
_BDF_DWIDTH | \
_BDF_BBX | \
_BDF_BITMAP )
#define _BDF_GLYPH
Definition: bdflib.c:1111

Definition at line 1120 of file bdflib.c.

◆ _BDF_GLYPH_HEIGHT_CHECK

#define _BDF_GLYPH_HEIGHT_CHECK   0x80000000UL

Definition at line 1128 of file bdflib.c.

◆ _BDF_GLYPH_WIDTH_CHECK

#define _BDF_GLYPH_WIDTH_CHECK   0x40000000UL

Definition at line 1127 of file bdflib.c.

◆ _BDF_GLYPHS

#define _BDF_GLYPHS   0x0020

Definition at line 1110 of file bdflib.c.

◆ _BDF_PROPS

#define _BDF_PROPS   0x0010

Definition at line 1109 of file bdflib.c.

◆ _BDF_SIZE

#define _BDF_SIZE   0x0004

Definition at line 1107 of file bdflib.c.

◆ _BDF_START

#define _BDF_START   0x0001

Definition at line 1105 of file bdflib.c.

◆ _BDF_SWIDTH

#define _BDF_SWIDTH   0x0100

Definition at line 1113 of file bdflib.c.

◆ _BDF_SWIDTH_ADJ

#define _BDF_SWIDTH_ADJ   0x1000

Definition at line 1118 of file bdflib.c.

◆ ACMSG1

#define ACMSG1
Value:
"FONT_ASCENT property missing. " \
"Added `FONT_ASCENT %hd'.\n"

Definition at line 173 of file bdflib.c.

◆ ACMSG10

#define ACMSG10   "DWIDTH field missing at line %ld. Set to glyph width.\n"

Definition at line 185 of file bdflib.c.

◆ ACMSG11

#define ACMSG11   "SIZE bits per pixel field adjusted to %hd.\n"

Definition at line 186 of file bdflib.c.

◆ ACMSG12

#define ACMSG12   "Duplicate encoding %ld (%s) changed to unencoded.\n"

Definition at line 187 of file bdflib.c.

◆ ACMSG13

#define ACMSG13   "Glyph %ld extra rows removed.\n"

Definition at line 188 of file bdflib.c.

◆ ACMSG14

#define ACMSG14   "Glyph %ld extra columns removed.\n"

Definition at line 189 of file bdflib.c.

◆ ACMSG15

#define ACMSG15   "Incorrect glyph count: %ld indicated but %ld found.\n"

Definition at line 190 of file bdflib.c.

◆ ACMSG16

#define ACMSG16   "Glyph %ld missing columns padded with zero bits.\n"

Definition at line 191 of file bdflib.c.

◆ ACMSG2

#define ACMSG2
Value:
"FONT_DESCENT property missing. " \
"Added `FONT_DESCENT %hd'.\n"

Definition at line 175 of file bdflib.c.

◆ ACMSG3

#define ACMSG3   "Font width != actual width. Old: %hd New: %hd.\n"

Definition at line 177 of file bdflib.c.

◆ ACMSG4

#define ACMSG4
Value:
"Font left bearing != actual left bearing. " \
"Old: %hd New: %hd.\n"

Definition at line 178 of file bdflib.c.

◆ ACMSG5

#define ACMSG5   "Font ascent != actual ascent. Old: %hd New: %hd.\n"

Definition at line 180 of file bdflib.c.

◆ ACMSG6

#define ACMSG6   "Font descent != actual descent. Old: %hd New: %hd.\n"

Definition at line 181 of file bdflib.c.

◆ ACMSG7

#define ACMSG7   "Font height != actual height. Old: %hd New: %hd.\n"

Definition at line 182 of file bdflib.c.

◆ ACMSG8

#define ACMSG8   "Glyph scalable width (SWIDTH) adjustments made.\n"

Definition at line 183 of file bdflib.c.

◆ ACMSG9

#define ACMSG9   "SWIDTH field missing at line %ld. Set automatically.\n"

Definition at line 184 of file bdflib.c.

◆ DBGMSG1

#define DBGMSG1   " [%6ld] %s" /* no \n */

Definition at line 205 of file bdflib.c.

◆ DBGMSG2

#define DBGMSG2   " (0x%lX)\n"

Definition at line 206 of file bdflib.c.

◆ ERRMSG1

#define ERRMSG1   "[line %ld] Missing `%s' line.\n"

Definition at line 194 of file bdflib.c.

◆ ERRMSG2

#define ERRMSG2   "[line %ld] Font header corrupted or missing fields.\n"

Definition at line 195 of file bdflib.c.

◆ ERRMSG3

#define ERRMSG3   "[line %ld] Font glyphs corrupted or missing fields.\n"

Definition at line 196 of file bdflib.c.

◆ ERRMSG4

#define ERRMSG4   "[line %ld] BBX too big.\n"

Definition at line 197 of file bdflib.c.

◆ ERRMSG5

#define ERRMSG5   "[line %ld] `%s' value too big.\n"

Definition at line 198 of file bdflib.c.

◆ ERRMSG6

#define ERRMSG6   "[line %ld] Input line too long.\n"

Definition at line 199 of file bdflib.c.

◆ ERRMSG7

#define ERRMSG7   "[line %ld] Font name too long.\n"

Definition at line 200 of file bdflib.c.

◆ ERRMSG8

#define ERRMSG8   "[line %ld] Invalid `%s' value.\n"

Definition at line 201 of file bdflib.c.

◆ ERRMSG9

#define ERRMSG9   "[line %ld] Invalid keyword.\n"

Definition at line 202 of file bdflib.c.

◆ FT_COMPONENT

#define FT_COMPONENT   trace_bdflib

Definition at line 52 of file bdflib.c.

◆ INITIAL_HT_SIZE

#define INITIAL_HT_SIZE   241

Definition at line 218 of file bdflib.c.

◆ NO_SKIP

#define NO_SKIP   256 /* this value cannot be stored in a 'char' */

Definition at line 658 of file bdflib.c.

◆ sbitset

#define sbitset (   m,
  cc 
)    ( m[(FT_Byte)(cc) >> 3] & ( 1 << ( (cc) & 7 ) ) )

Definition at line 429 of file bdflib.c.

◆ setsbit

#define setsbit (   m,
  cc 
)    ( m[(FT_Byte)(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) )

Definition at line 427 of file bdflib.c.

Typedef Documentation

◆ _bdf_line_func_t

typedef FT_Error(* _bdf_line_func_t) (char *line, unsigned long linelen, unsigned long lineno, void *call_data, void *client_data)

Definition at line 377 of file bdflib.c.

◆ _bdf_list_t

typedef struct _bdf_list_t_ _bdf_list_t

◆ _bdf_parse_t

typedef struct _bdf_parse_t_ _bdf_parse_t

◆ hash_free_func

typedef void(* hash_free_func) (hashnode node)

Definition at line 221 of file bdflib.c.

Function Documentation

◆ bdf_free_font()

bdf_free_font ( bdf_font_t font)

Definition at line 2523 of file bdflib.c.

References FT_FREE, and i.

Referenced by BDF_Face_Done().

◆ bdf_get_font_property()

bdf_get_font_property ( bdf_font_t font,
const char *  name 
)

Definition at line 2604 of file bdflib.c.

Referenced by BDF_Face_Init().

◆ bdf_get_property()

bdf_get_property ( char *  name,
bdf_font_t font 
)

Definition at line 1075 of file bdflib.c.

◆ bdf_load_font()

bdf_load_font ( FT_Stream  stream,
FT_Memory  extmemory,
bdf_options_t opts,
bdf_font_t **  font 
)

Definition at line 2365 of file bdflib.c.

References error, FT_Err_Ok, FT_NEW, and NULL.

Referenced by BDF_Face_Init().