JWM Source Documentation
Functions | Variables
font.c File Reference

Functions to handle fonts. More...

#include "jwm.h"
#include "font.h"
#include "main.h"
#include "error.h"
#include "misc.h"

Go to the source code of this file.

Functions

static char * GetUTF8String (const char *str)
 Convert a string to UTF-8.
 
static void ReleaseUTF8String (char *utf8String)
 Release a UTF-8 string.
 
void InitializeFonts (void)
 Initialize font data.
 
void StartupFonts (void)
 Startup font support.
 
void ShutdownFonts (void)
 Shutdown font support.
 
void DestroyFonts (void)
 Destroy font data.
 
char * ConvertFromUTF8 (char *str)
 Convert a string from UTF-8.
 
int GetStringWidth (FontType ft, const char *str)
 Get the width of a string.
 
int GetStringHeight (FontType ft)
 Get the height of a string.
 
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, const char *str)
 Display a string.
 

Variables

static const char * DEFAULT_FONT = "FreeSans-9"
 
struct {
   const FontType   src
 
   const FontType   dest
 
INHERITED_FONTS []
 
static char * fontNames [FONT_COUNT]
 
static XftFont * fonts [FONT_COUNT]
 

Detailed Description

Functions to handle fonts.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file font.c.

Function Documentation

char* ConvertFromUTF8 ( char *  str)

Convert a string from UTF-8.

Definition at line 180 of file font.c.

References Allocate, Release, and Warning().

Referenced by ReadWMName().

void DestroyFonts ( void  )

Destroy font data.

Definition at line 158 of file font.c.

References FONT_COUNT, fontNames, and Release.

Referenced by Destroy().

int GetStringHeight ( FontType  ft)
int GetStringWidth ( FontType  ft,
const char *  str 
)
char * GetUTF8String ( const char *  str)
static

Convert a string to UTF-8.

Definition at line 209 of file font.c.

References Allocate, Release, and Warning().

Referenced by GetStringWidth(), and RenderString().

void InitializeFonts ( void  )

Initialize font data.

Definition at line 59 of file font.c.

References FONT_COUNT, fontNames, and fonts.

Referenced by Initialize().

void ReleaseUTF8String ( char *  utf8String)
static

Release a UTF-8 string.

Definition at line 237 of file font.c.

References Release.

Referenced by GetStringWidth(), and RenderString().

void RenderString ( Drawable  d,
FontType  font,
ColorType  color,
int  x,
int  y,
int  width,
const char *  str 
)
void SetFont ( FontType  type,
const char *  value 
)

Set the font to use for a component.

Definition at line 312 of file font.c.

References _, CopyString(), fontNames, JUNLIKELY, Release, and Warning().

Referenced by ParseClockStyle(), ParseMenuStyle(), ParsePagerStyle(), ParsePopupStyle(), ParseTrayButtonStyle(), ParseTrayStyle(), and ParseWindowStyle().

void ShutdownFonts ( void  )

Shutdown font support.

Definition at line 142 of file font.c.

References display, FONT_COUNT, fonts, JXFreeFont, and JXftFontClose.

Referenced by Shutdown().

void StartupFonts ( void  )

Variable Documentation

const char* DEFAULT_FONT = "FreeSans-9"
static

Definition at line 26 of file font.c.

Referenced by StartupFonts().

const FontType dest

Definition at line 33 of file font.c.

char* fontNames[FONT_COUNT]
static

Definition at line 44 of file font.c.

Referenced by DestroyFonts(), InitializeFonts(), SetFont(), and StartupFonts().

XftFont* fonts[FONT_COUNT]
static
struct { ... } INHERITED_FONTS[]
Initial value:

Referenced by StartupFonts().

const FontType src

Definition at line 32 of file font.c.

joewing.net / Projects / JWM