OpenCores
URL https://opencores.org/ocsvn/orsoc_graphics_accelerator/orsoc_graphics_accelerator/trunk

Subversion Repositories orsoc_graphics_accelerator

[/] [orsoc_graphics_accelerator/] [trunk/] [sw/] [utils/] [fonter/] [main.cpp] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 maiden
#include <iostream>
2
#include <deque>
3
#include <ft2build.h>
4
#include <freetype2/freetype/ftglyph.h>
5
#include FT_FREETYPE_H
6
 
7
#include "ttfpoint.h"
8
 
9
using namespace std;
10
 
11
int main(int argc,char** argv)
12
{
13
    if( argc < 2 )
14
    {
15
        cout << "Usage: " << argv[0] << " filename.ttf" << endl;
16
        return 1;
17
    }
18
 
19
    try
20
    {
21
        TTFPoint::InitFreeType();
22
 
23
        /* Open an output file */
24
        string          inFilename(argv[1]);
25
 
26
        TTFPoint points;
27
        points.LoadFont(inFilename);
28
 
29
        points.GenerateWrites(false, L"ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖabcdefghijklmnopqrstuvwxyzåäö");
30
 
31
        string fontname = inFilename.substr(0, inFilename.find('.'));
32
        fontname += "_font";
33
 
34
        points.WriteFontFile(fontname);
35
 
36
        return 0;
37
    }
38
    catch(int error)
39
    {
40
        cout << "Error code " << error << endl;
41
        return 1;
42
    }
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.