1/*
2 ******************************************************************************
3 * Copyright (C) 1998-2006, International Business Machines Corporation and   *
4 * others. All Rights Reserved.                                               *
5 ******************************************************************************
6 */
7
8#include <stdio.h>
9
10#include <ft2build.h>
11#include FT_FREETYPE_H
12
13#include "layout/LEFontInstance.h"
14#include "GnomeFontInstance.h"
15
16#include "GUISupport.h"
17#include "FontMap.h"
18#include "GnomeFontMap.h"
19
20GnomeFontMap::GnomeFontMap(FT_Library engine, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
21    : FontMap(fileName, pointSize, guiSupport, status), fEngine(engine)
22{
23    // nothing to do?
24}
25
26GnomeFontMap::~GnomeFontMap()
27{
28    // anything?
29}
30
31const LEFontInstance *GnomeFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
32{
33    LEFontInstance *result = new GnomeFontInstance(fEngine, fontName, pointSize, status);
34
35    if (LE_FAILURE(status)) {
36      delete result;
37      result = NULL;
38    }
39
40    return result;
41}
42