Hershey Vector Fonts 0.1.0
A C++ library for working with the Hershey vector fonts
Loading...
Searching...
No Matches
hershey_svg.hpp
Go to the documentation of this file.
1#ifndef HERSHEY_SVG_HPP
2#define HERSHEY_SVG_HPP
3
8#include <fstream>
9#include <iostream>
10
11#include "font.hpp"
12#include "glyph.hpp"
13#include "string.hpp"
14
23void write_header(std::ofstream &svg_file, int width, int height, int scale);
24
30void write_footer(std::ofstream &svg_file);
31
41void draw_glyph(
42 std::ofstream &svg_file, Hershey::Glyph glyph, int x0, int y0, int scale
43);
44
54void draw_glyphs(
55 std::ofstream &svg_file, Hershey::String string, int x0, int y0, int scale
56);
57
66void draw_font(std::ofstream &svg_file, Hershey::Font font, int width, int height);
67
75float position(float fraction, float x, float X);
76
77#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(std::ofstream &svg_file, Hershey::Glyph glyph, int x0, int y0, int scale)
Draw a glyph.
Definition hershey_svg.cpp:13
void draw_glyphs(std::ofstream &svg_file, Hershey::String string, int x0, int y0, int scale)
Draw a string of glyphs.
Definition hershey_svg.cpp:35
void write_footer(std::ofstream &svg_file)
Write the svg file header.
Definition hershey_svg.cpp:9
void write_header(std::ofstream &svg_file, int width, int height, int scale)
Write the svg file header.
Definition hershey_svg.cpp:3
float position(float fraction, float x, float X)
Calculate a fractional position.
Definition hershey_cairo.cpp:62
void draw_font(std::ofstream &svg_file, Hershey::Font font, int width, int height)
Draw the glyphs in a font.
Definition hershey_svg.cpp:45