summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-4.4/samples/layout/GDIFontMap.cpp
blob: 480bbe0eb8aeb3dad11c615339dbae26eb7a7c80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 ******************************************************************************
 * Copyright (C) 1998-2003, International Business Machines Corporation and   *
 * others. All Rights Reserved.                                               *
 ******************************************************************************
 */

#include <windows.h>

#include "layout/LEFontInstance.h"

#include "GDIFontInstance.h"

#include "GUISupport.h"
#include "FontMap.h"
#include "GDIFontMap.h"

GDIFontMap::GDIFontMap(GDISurface *surface, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
    : FontMap(fileName, pointSize, guiSupport, status), fSurface(surface)
{
    // nothing to do?
}

GDIFontMap::~GDIFontMap()
{
    // anything?
}

const LEFontInstance *GDIFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
{
	LEFontInstance *result = new GDIFontInstance(fSurface, fontName, pointSize, status);

	if (LE_FAILURE(status)) {
		delete result;
		result = NULL;
	}

    return result;
}