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