JWM Source Documentation
|
Header for the font functions. More...
#include "color.h"
Go to the source code of this file.
Macros | |
#define | FONT_BORDER 0 |
#define | FONT_MENU 1 |
#define | FONT_POPUP 2 |
#define | FONT_TRAY 3 |
#define | FONT_PAGER 4 |
#define | FONT_CLOCK 5 |
#define | FONT_TASKLIST 6 |
#define | FONT_TRAYBUTTON 7 |
#define | FONT_COUNT 8 |
Typedefs | |
typedef unsigned char | FontType |
Enumeration of different components that use fonts. | |
Functions | |
void | InitializeFonts (void) |
Initialize font data. | |
void | StartupFonts (void) |
Startup font support. | |
void | ShutdownFonts (void) |
Shutdown font support. | |
void | DestroyFonts (void) |
Destroy font data. | |
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) |
Render a string. | |
int | GetStringWidth (FontType ft, const char *str) |
Get the width of a string. | |
int | GetStringHeight (FontType ft) |
Get the height of a string. | |
char * | ConvertFromUTF8 (char *str) |
Convert a string from UTF-8. | |
#define FONT_BORDER 0 |
Definition at line 17 of file font.h.
Referenced by DrawBorderHelper(), GetTitleHeight(), and ParseWindowStyle().
#define FONT_CLOCK 5 |
Definition at line 22 of file font.h.
Referenced by DrawClock(), ParseClockStyle(), and StartupClock().
#define FONT_COUNT 8 |
Definition at line 25 of file font.h.
Referenced by DestroyFonts(), InitializeFonts(), ShutdownFonts(), and StartupFonts().
#define FONT_MENU 1 |
Definition at line 18 of file font.h.
Referenced by ComputeDimensions(), CreateMoveResizeWindow(), DrawButtons(), DrawDialog(), DrawMenuItem(), InitializeMenu(), ParseMenuStyle(), UpdateMoveWindow(), and UpdateResizeWindow().
#define FONT_PAGER 4 |
Definition at line 21 of file font.h.
Referenced by DrawPager(), and ParsePagerStyle().
#define FONT_POPUP 2 |
Definition at line 19 of file font.h.
Referenced by MeasurePopupText(), ParsePopupStyle(), and ShowPopup().
#define FONT_TASKLIST 6 |
Definition at line 23 of file font.h.
Referenced by ComputeItemSize(), Parse(), Render(), and UpdateTaskBar().
#define FONT_TRAY 3 |
Definition at line 20 of file font.h.
Referenced by Draw(), Parse(), ResetButton(), SetSize(), and StartupTrayButtons().
#define FONT_TRAYBUTTON 7 |
Definition at line 24 of file font.h.
Referenced by Parse(), and ParseTrayButtonStyle().
typedef unsigned char FontType |
char* ConvertFromUTF8 | ( | char * | str | ) |
void DestroyFonts | ( | void | ) |
int GetStringHeight | ( | FontType | ft | ) |
Get the height of a string.
ft | The font used to determine the height. |
Definition at line 305 of file font.c.
Referenced by ComputeDimensions(), ComputeItemSize(), CreateMoveResizeWindow(), DrawBorderHelper(), DrawButton(), DrawClock(), DrawPager(), GetTitleHeight(), InitializeMenu(), MeasurePopupText(), RenderString(), SetSize(), ShowPopup(), StartupClock(), StartupTrayButtons(), and UpdateTaskBar().
int GetStringWidth | ( | FontType | ft, |
const char * | str | ||
) |
Get the width of a string.
ft | The font used to determine the width. |
str | The string whose width to get. |
Definition at line 247 of file font.c.
References AllocateStack, display, fonts, GetUTF8String(), JXftTextExtentsUtf8, ReleaseStack, and ReleaseUTF8String().
Referenced by ComputeDimensions(), CreateMoveResizeWindow(), DrawBorderHelper(), DrawButton(), DrawButtons(), DrawClock(), DrawPager(), InitializeMenu(), MeasurePopupText(), SetSize(), StartupTrayButtons(), UpdateMoveWindow(), and UpdateResizeWindow().
void InitializeFonts | ( | void | ) |
Initialize font data.
Definition at line 59 of file font.c.
References FONT_COUNT, fontNames, and fonts.
Referenced by Initialize().
void RenderString | ( | Drawable | d, |
FontType | font, | ||
ColorType | color, | ||
int | x, | ||
int | y, | ||
int | width, | ||
const char * | str | ||
) |
Render a string.
d | The drawable on which to render the string. |
font | The font to use. |
color | The text color to use. |
x | The x-coordinate at which to render. |
y | The y-coordinate at which to render. |
width | The maximum width allowed. |
str | The string to render. |
Definition at line 325 of file font.c.
References AllocateStack, colors, display, fonts, GetStringHeight(), GetUTF8String(), GetXftColor(), JXCreateGC, JXDrawString, JXFreeGC, JXftDrawChange, JXftDrawSetClip, JXftDrawStringUtf8, JXftTextExtentsUtf8, JXSetFont, JXSetForeground, JXSetRegion, Min, ReleaseStack, ReleaseUTF8String(), rootColormap, rootVisual, and rootWindow.
Referenced by DrawBorderHelper(), DrawButton(), DrawClock(), DrawDialog(), DrawPager(), ShowPopup(), UpdateMoveWindow(), and UpdateResizeWindow().
void SetFont | ( | FontType | type, |
const char * | value | ||
) |
Set the font to use for a component.
type | The font component. |
value | The font to use. |
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 | ) |
Startup font support.
Definition at line 86 of file font.c.
References _, ARRAY_LENGTH, CopyString(), DEFAULT_FONT, dest, display, FatalError(), FONT_COUNT, fontNames, fonts, INHERITED_FONTS, JUNLIKELY, JXftFontOpenName, JXftFontOpenXlfd, JXLoadQueryFont, rootScreen, src, and Warning().
Referenced by Startup().
joewing.net / Projects / JWM