]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/letest/cfonts.cpp
ICU-57131.0.1.tar.gz
[apple/icu.git] / icuSources / test / letest / cfonts.cpp
CommitLineData
46f4442e
A
1/*
2 *
b331163b 3 * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
46f4442e
A
4 *
5 */
6
b331163b
A
7#ifndef USING_ICULEHB /* C API not available under HB */
8
9#include "layout/LETypes.h"
46f4442e
A
10#include "loengine.h"
11#include "PortableFontInstance.h"
12#include "SimpleFontInstance.h"
13
14U_CDECL_BEGIN
15
16le_font *le_portableFontOpen(const char *fileName,
17 float pointSize,
18 LEErrorCode *status)
19{
20 return (le_font *) new PortableFontInstance(fileName, pointSize, *status);
21}
22
23le_font *le_simpleFontOpen(float pointSize,
24 LEErrorCode *status)
25{
26 return (le_font *) new SimpleFontInstance(pointSize, *status);
27}
28
29void le_fontClose(le_font *font)
30{
31 LEFontInstance *fontInstance = (LEFontInstance *) font;
32
33 delete fontInstance;
34}
35
36const char *le_getNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
37{
38 PortableFontInstance *pfi = (PortableFontInstance *) font;
39
40 return pfi->getNameString(nameID, platform, encoding, language);
41}
42
43const LEUnicode16 *le_getUnicodeNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
44{
45 PortableFontInstance *pfi = (PortableFontInstance *) font;
46
47 return pfi->getUnicodeNameString(nameID, platform, encoding, language);
48}
49
50void le_deleteNameString(le_font *font, const char *name)
51{
52 PortableFontInstance *pfi = (PortableFontInstance *) font;
53
54 pfi->deleteNameString(name);
55}
56
57void le_deleteUnicodeNameString(le_font *font, const LEUnicode16 *name)
58{
59 PortableFontInstance *pfi = (PortableFontInstance *) font;
60
61 pfi->deleteNameString(name);
62}
63
64le_uint32 le_getFontChecksum(le_font *font)
65{
66 PortableFontInstance *pfi = (PortableFontInstance *) font;
67
68 return pfi->getFontChecksum();
69}
70
71U_CDECL_END
b331163b 72#endif