Hershey Vector Fonts 0.1.0
A C++ library for working with the Hershey vector fonts
Loading...
Searching...
No Matches
hershey_cairo.hpp
Go to the documentation of this file.
1#ifndef HERSHEY_CAIRO_HPP
2#define HERSHEY_CAIRO_HPP
3
8#include <cairo-pdf.h>
9
10#include "font.hpp"
11#include "glyph.hpp"
12#include "string.hpp"
13
14#define A4_P_WIDTH 595.275590551
15#define A4_P_HEIGHT 841.88976378
16#define A5_P_WIDTH 420.94488189
17#define A5_P_HEIGHT 595.275590551
18
28void draw_glyph(cairo_t *cr, Hershey::Glyph glyph, int x0, int y0, int scale);
29
39void draw_glyphs(cairo_t *cr, Hershey::String string, int x0, int y0, int scale);
40
47void draw_font(cairo_t *cr, Hershey::Font font, int width, int height);
48
56float position(float fraction, float x, float X);
57
58#endif
A Hershey vector font.
Definition font.hpp:19
A Hershey vector font glyph.
Definition glyph.hpp:17
A character string comprising Hershey vector font glyphs.
Definition string.hpp:20
void draw_font(cairo_t *cr, Hershey::Font font, int width, int height)
Draw the glyphs in a font.
Definition hershey_cairo.cpp:28
void draw_glyphs(cairo_t *cr, Hershey::String string, int x0, int y0, int scale)
Draw a string of glyphs.
Definition hershey_cairo.cpp:20
float position(float fraction, float x, float X)
Calculate a fractional position.
Definition hershey_cairo.cpp:62
void draw_glyph(cairo_t *cr, Hershey::Glyph glyph, int x0, int y0, int scale)
Draw a glyph.
Definition hershey_cairo.cpp:3