Hershey Vector Fonts 0.1.0
A C++ library for working with the Hershey vector fonts
Loading...
Searching...
No Matches
hershey_xlib.hpp File Reference
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "font.hpp"
#include "glyph.hpp"
#include "string.hpp"

Go to the source code of this file.

Functions

void draw_glyph (Display *display, Window *win, GC *gc, Hershey::Glyph glyph, int x0, int y0, int scale)
 Draw a glyph.
 
void draw_glyphs (Display *display, Window *win, GC *gc, Hershey::String string, int x0, int y0, int scale)
 Draw a string of glyphs.
 
void draw_font (Display *display, Window *win, GC *gc, Hershey::Font font, int width, int height)
 Draw the glyphs in a font.
 
float position (float fraction, float x, float X)
 Calculate a fractional position.
 

Detailed Description

This header file contains the declaration of the functions for the XLib interface.

Function Documentation

◆ draw_font()

void draw_font ( Display *  display,
Window *  win,
GC *  gc,
Hershey::Font  font,
int  width,
int  height 
)

Draw the glyphs in a font.

Parameters
displayThe display
winThe window
gcThe graphics context
fontThe font

◆ draw_glyph()

void draw_glyph ( Display *  display,
Window *  win,
GC *  gc,
Hershey::Glyph  glyph,
int  x0,
int  y0,
int  scale 
)

Draw a glyph.

Parameters
displayThe display
winThe window
gcThe graphics context
x0The starting x position
y0The starting x position
scaleThe amount to scale the glyph by

◆ draw_glyphs()

void draw_glyphs ( Display *  display,
Window *  win,
GC *  gc,
Hershey::String  string,
int  x0,
int  y0,
int  scale 
)

Draw a string of glyphs.

Parameters
displayThe display
winThe window
gcThe graphics context
glyphThe string of glyphs to draw
x0The starting x position
y0The starting x position
scaleThe amount to scale the glyphs by

◆ position()

float position ( float  fraction,
float  x,
float  X 
)

Calculate a fractional position.

Parameters
fractionThe fraction to use
xThe object's size
XThe total size