1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4  *
5  * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
6  *
7  */
8 
9 #ifndef USING_ICULEHB /* C API not available under HB */
10 
11 #include "layout/LETypes.h"
12 #include "loengine.h"
13 #include "PortableFontInstance.h"
14 #include "SimpleFontInstance.h"
15 
16 U_CDECL_BEGIN
17 
le_portableFontOpen(const char * fileName,float pointSize,LEErrorCode * status)18 le_font *le_portableFontOpen(const char *fileName,
19 					float pointSize,
20 					LEErrorCode *status)
21 {
22 	return (le_font *) new PortableFontInstance(fileName, pointSize, *status);
23 }
24 
le_simpleFontOpen(float pointSize,LEErrorCode * status)25 le_font *le_simpleFontOpen(float pointSize,
26 				  LEErrorCode *status)
27 {
28 	return (le_font *) new SimpleFontInstance(pointSize, *status);
29 }
30 
le_fontClose(le_font * font)31 void le_fontClose(le_font *font)
32 {
33 	LEFontInstance *fontInstance = (LEFontInstance *) font;
34 
35 	delete fontInstance;
36 }
37 
le_getNameString(le_font * font,le_uint16 nameID,le_uint16 platform,le_uint16 encoding,le_uint16 language)38 const char *le_getNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
39 {
40 	PortableFontInstance *pfi = (PortableFontInstance *) font;
41 
42 	return pfi->getNameString(nameID, platform, encoding, language);
43 }
44 
le_getUnicodeNameString(le_font * font,le_uint16 nameID,le_uint16 platform,le_uint16 encoding,le_uint16 language)45 const LEUnicode16 *le_getUnicodeNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
46 {
47 	PortableFontInstance *pfi = (PortableFontInstance *) font;
48 
49 	return pfi->getUnicodeNameString(nameID, platform, encoding, language);
50 }
51 
le_deleteNameString(le_font * font,const char * name)52 void le_deleteNameString(le_font *font, const char *name)
53 {
54 	PortableFontInstance *pfi = (PortableFontInstance *) font;
55 
56 	pfi->deleteNameString(name);
57 }
58 
le_deleteUnicodeNameString(le_font * font,const LEUnicode16 * name)59 void le_deleteUnicodeNameString(le_font *font, const LEUnicode16 *name)
60 {
61 	PortableFontInstance *pfi = (PortableFontInstance *) font;
62 
63 	pfi->deleteNameString(name);
64 }
65 
le_getFontChecksum(le_font * font)66 le_uint32 le_getFontChecksum(le_font *font)
67 {
68 	PortableFontInstance *pfi = (PortableFontInstance *) font;
69 
70 	return pfi->getFontChecksum();
71 }
72 
73 U_CDECL_END
74 #endif
75