]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/letest/cfonts.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / letest / cfonts.cpp
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
46f4442e
A
3/*
4 *
b331163b 5 * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
46f4442e
A
6 *
7 */
8
b331163b
A
9#ifndef USING_ICULEHB /* C API not available under HB */
10
11#include "layout/LETypes.h"
46f4442e
A
12#include "loengine.h"
13#include "PortableFontInstance.h"
14#include "SimpleFontInstance.h"
15
16U_CDECL_BEGIN
17
18le_font *le_portableFontOpen(const char *fileName,
19 float pointSize,
20 LEErrorCode *status)
21{
22 return (le_font *) new PortableFontInstance(fileName, pointSize, *status);
23}
24
25le_font *le_simpleFontOpen(float pointSize,
26 LEErrorCode *status)
27{
28 return (le_font *) new SimpleFontInstance(pointSize, *status);
29}
30
31void le_fontClose(le_font *font)
32{
33 LEFontInstance *fontInstance = (LEFontInstance *) font;
34
35 delete fontInstance;
36}
37
38const 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
45const 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
52void le_deleteNameString(le_font *font, const char *name)
53{
54 PortableFontInstance *pfi = (PortableFontInstance *) font;
55
56 pfi->deleteNameString(name);
57}
58
59void le_deleteUnicodeNameString(le_font *font, const LEUnicode16 *name)
60{
61 PortableFontInstance *pfi = (PortableFontInstance *) font;
62
63 pfi->deleteNameString(name);
64}
65
66le_uint32 le_getFontChecksum(le_font *font)
67{
68 PortableFontInstance *pfi = (PortableFontInstance *) font;
69
70 return pfi->getFontChecksum();
71}
72
73U_CDECL_END
b331163b 74#endif