• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  ******************************************************************************
3  * © 2016 and later: Unicode, Inc. and others.                    *
4  * License & terms of use: http://www.unicode.org/copyright.html#License      *
5  ******************************************************************************
6  ******************************************************************************
7  * Copyright (C) 1998-2003, International Business Machines Corporation and   *
8  * others. All Rights Reserved.                                               *
9  ******************************************************************************
10  */
11 
12 #include <windows.h>
13 
14 #include "layout/LEFontInstance.h"
15 
16 #include "GDIFontInstance.h"
17 
18 #include "GUISupport.h"
19 #include "FontMap.h"
20 #include "GDIFontMap.h"
21 
GDIFontMap(GDISurface * surface,const char * fileName,le_int16 pointSize,GUISupport * guiSupport,LEErrorCode & status)22 GDIFontMap::GDIFontMap(GDISurface *surface, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
23     : FontMap(fileName, pointSize, guiSupport, status), fSurface(surface)
24 {
25     // nothing to do?
26 }
27 
~GDIFontMap()28 GDIFontMap::~GDIFontMap()
29 {
30     // anything?
31 }
32 
openFont(const char * fontName,le_int16 pointSize,LEErrorCode & status)33 const LEFontInstance *GDIFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
34 {
35 	LEFontInstance *result = new GDIFontInstance(fSurface, fontName, pointSize, status);
36 
37 	if (LE_FAILURE(status)) {
38 		delete result;
39 		result = NULL;
40 	}
41 
42     return result;
43 }
44