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