JWM Source Documentation

font.h File Reference

Header for the font functions. More...

#include "color.h"

Go to the source code of this file.

Enumerations

enum  FontType {
  FONT_BORDER, FONT_MENU, FONT_TASK, FONT_POPUP,
  FONT_CLOCK, FONT_TRAY, FONT_TRAYBUTTON, FONT_PAGER,
  FONT_COUNT
}
 Enumeration of different components that use fonts. More...

Functions

void InitializeFonts ()
void StartupFonts ()
void ShutdownFonts ()
void DestroyFonts ()
void SetFont (FontType type, const char *value)
 Set the font to use for a component.
void RenderString (Drawable d, FontType font, ColorType color, int x, int y, int width, Region region, const char *str)
 Render a string.
int GetStringWidth (FontType type, const char *str)
 Get the width of a string.
int GetStringHeight (FontType type)
 Get the height of a string.

Detailed Description

Header for the font functions.

Author:
Joe Wingbermuehle
Date:
2004-2006

Definition in file font.h.


Enumeration Type Documentation

enum FontType

Enumeration of different components that use fonts.

Enumerator:
FONT_BORDER 
FONT_MENU 
FONT_TASK 
FONT_POPUP 
FONT_CLOCK 
FONT_TRAY 
FONT_TRAYBUTTON 
FONT_PAGER 
FONT_COUNT 

Definition at line 16 of file font.h.


Function Documentation

void DestroyFonts ( )
int GetStringHeight ( FontType  type)

Get the height of a string.

Parameters:
typeThe font used to determine the height.
Returns:
The height in pixels.
int GetStringWidth ( FontType  type,
const char *  str 
)

Get the width of a string.

Parameters:
typeThe font used to determine the width.
strThe string whose width to get.
Returns:
The width of the string in pixels.
void InitializeFonts ( )
void RenderString ( Drawable  d,
FontType  font,
ColorType  color,
int  x,
int  y,
int  width,
Region  region,
const char *  str 
)

Render a string.

Parameters:
dThe drawable on which to render the string.
fontThe font to use.
colorThe text color to use.
xThe x-coordinate at which to render.
yThe y-coordinate at which to render.
widthThe maximum width allowed.
regionA clip region (may be None).
strThe string to render.
void SetFont ( FontType  type,
const char *  value 
)

Set the font to use for a component.

Parameters:
typeThe font component.
valueThe font to use.
void ShutdownFonts ( )
void StartupFonts ( )