File: cfonts.cpp

package info (click to toggle)
icu 76.1-4
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 121,296 kB
  • sloc: cpp: 522,712; ansic: 113,387; sh: 4,983; makefile: 4,709; perl: 3,198; python: 2,847; xml: 2,652; sed: 36; lisp: 12
file content (74 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
 *
 * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
 *
 */

#ifndef USING_ICULEHB /* C API not available under HB */

#include "layout/LETypes.h"
#include "loengine.h"
#include "PortableFontInstance.h"
#include "SimpleFontInstance.h"

U_CDECL_BEGIN

le_font *le_portableFontOpen(const char *fileName,
					float pointSize,
					LEErrorCode *status)
{
	return (le_font *) new PortableFontInstance(fileName, pointSize, *status);
}

le_font *le_simpleFontOpen(float pointSize,
				  LEErrorCode *status)
{
	return (le_font *) new SimpleFontInstance(pointSize, *status);
}

void le_fontClose(le_font *font)
{
	LEFontInstance *fontInstance = (LEFontInstance *) font;

	delete fontInstance;
}

const char *le_getNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
{
	PortableFontInstance *pfi = (PortableFontInstance *) font;

	return pfi->getNameString(nameID, platform, encoding, language);
}

const LEUnicode16 *le_getUnicodeNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language)
{
	PortableFontInstance *pfi = (PortableFontInstance *) font;

	return pfi->getUnicodeNameString(nameID, platform, encoding, language);
}

void le_deleteNameString(le_font *font, const char *name)
{
	PortableFontInstance *pfi = (PortableFontInstance *) font;

	pfi->deleteNameString(name);
}

void le_deleteUnicodeNameString(le_font *font, const LEUnicode16 *name)
{
	PortableFontInstance *pfi = (PortableFontInstance *) font;

	pfi->deleteNameString(name);
}

le_uint32 le_getFontChecksum(le_font *font)
{
	PortableFontInstance *pfi = (PortableFontInstance *) font;

	return pfi->getFontChecksum();
}

U_CDECL_END
#endif