Hershey Vector Fonts 0.1.0
A C++ library for working with the Hershey vector fonts
Loading...
Searching...
No Matches
Hershey::Glyph Class Reference

A Hershey vector font glyph. More...

#include <glyph.hpp>

Public Member Functions

 Glyph ()
 Create a new glyph.
 
 Glyph (std::string raw)
 Create a new glyph from a raw coordinate definition.
 
std::string get_raw ()
 Get the raw coordinate definition of the glyph.
 
int get_cid ()
 Get the character's unique identifier.
 
int get_lhp ()
 Get the character's left-hand position.
 
int get_rhp ()
 Get the character's right-hand position.
 
int get_nvert ()
 Get the number of vertices making up the character.
 
void print_info ()
 Print information about the character.
 
void print_coords ()
 Print the character's vertices' coordinates in numpy array format.
 
void print_coords_nparray ()
 Print the character's vertices' coordinates in numpy array format.
 
int get_width ()
 Get the character's width.
 
int get_height ()
 Get the character's height.
 

Data Fields

int coords [144][2]
 

Detailed Description

A Hershey vector font glyph.

Constructor & Destructor Documentation

◆ Glyph() [1/2]

Glyph::Glyph ( )

Create a new glyph.

The x and y coordinates of the character's vertices.

◆ Glyph() [2/2]

Glyph::Glyph ( std::string  raw)

Create a new glyph from a raw coordinate definition.

Parameters
rawThe raw coordinate definition of the glyph.

Member Function Documentation

◆ get_cid()

int Glyph::get_cid ( )

Get the character's unique identifier.

Return values
Thecharacter's unique identifier.

◆ get_height()

int Glyph::get_height ( )

Get the character's height.

Return values
Theheight of the character.

◆ get_lhp()

int Glyph::get_lhp ( )

Get the character's left-hand position.

Return values
Thecharacter's left-hand position.

◆ get_nvert()

int Glyph::get_nvert ( )

Get the number of vertices making up the character.

Return values
Thenumber of vertices making up the character.

◆ get_raw()

std::string Glyph::get_raw ( )

Get the raw coordinate definition of the glyph.

Return values
Theraw coordinate definition of the glyph.

◆ get_rhp()

int Glyph::get_rhp ( )

Get the character's right-hand position.

Return values
Thecharacter's right-hand position.

◆ get_width()

int Glyph::get_width ( )

Get the character's width.

Return values
Thewidth of the character.

Field Documentation

◆ coords

int Hershey::Glyph::coords[144][2]

The width of the character.


The documentation for this class was generated from the following files: