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 // 210 mm
15#define A4_P_HEIGHT 841.889763780 // 297 mm
16#define A5_P_WIDTH 419.527559055 // 148 mm
17#define A5_P_HEIGHT 595.275590551 // 210 mm
18#define A6_P_WIDTH 297.637795276 // 105 mm
19#define A6_P_HEIGHT 419.527559055 // 148 mm
20#define B6_P_WIDTH 354.330708661 // 125 mm
21#define B6_P_HEIGHT 498.897637795 // 176 mm
22#define L4x6_WIDTH 287.716535433 // 101.5 mm
23#define L4x6_HEIGHT 432.000000000 // 152.4 mm
24
34void draw_glyph(cairo_t *cr, Hershey::Glyph glyph, float x0, float y0, float scale);
35
45void draw_glyphs(cairo_t *cr, Hershey::String string, float x0, float y0, float scale);
46
53void draw_font(cairo_t *cr, Hershey::Font font, int width, int height);
54
62float position(float fraction, float x, float X);
63
64#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_glyph(cairo_t *cr, Hershey::Glyph glyph, float x0, float y0, float scale)
Draw a glyph.
Definition hershey_cairo.cpp:3
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, float x0, float y0, float 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