aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mcufontencoder/src/importtools.hh
blob: 20371f22713e2244c6ca52c3ddecf98771fbe0d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Utility functions for processing imported font files.

#pragma once
#include "datafile.hh"

namespace mcufont {

// Find and eliminate any duplicate glyphs by appending their char vectors.
void eliminate_duplicates(std::vector<DataFile::glyphentry_t> &glyphtable);

// Calculate the maximum bounding box of the glyphs and crop them to that.
// Adjust fontinfo accordingly.
void crop_glyphs(std::vector<DataFile::glyphentry_t> &glyphtable,
                 DataFile::fontinfo_t &fontinfo);

// Fill in the flags (BW, monospace) automatically.
void detect_flags(const std::vector<DataFile::glyphentry_t> &glyphtable,
                  DataFile::fontinfo_t &fontinfo);

}