10596faeddefbf198de137d5e893708495ab1584cFredrik Roubert// © 2016 and later: Unicode, Inc. and others. 264339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// License & terms of use: http://www.unicode.org/copyright.html 3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* 4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * 5f9878a236aa0d9662d8e40cafdaf2e04cd615835ccornelius * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved 6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * 7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */ 8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 9f9878a236aa0d9662d8e40cafdaf2e04cd615835ccornelius#ifndef USING_ICULEHB /* C API not available under HB */ 10f9878a236aa0d9662d8e40cafdaf2e04cd615835ccornelius 11f9878a236aa0d9662d8e40cafdaf2e04cd615835ccornelius#include "layout/LETypes.h" 12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "loengine.h" 13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "PortableFontInstance.h" 14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "SimpleFontInstance.h" 15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_CDECL_BEGIN 17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querule_font *le_portableFontOpen(const char *fileName, 19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru float pointSize, 20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru LEErrorCode *status) 21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{ 22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return (le_font *) new PortableFontInstance(fileName, pointSize, *status); 23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querule_font *le_simpleFontOpen(float pointSize, 26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru LEErrorCode *status) 27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{ 28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return (le_font *) new SimpleFontInstance(pointSize, *status); 29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid le_fontClose(le_font *font) 32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{ 33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru LEFontInstance *fontInstance = (LEFontInstance *) font; 34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru delete fontInstance; 36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruconst char *le_getNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language) 39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{ 40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru PortableFontInstance *pfi = (PortableFontInstance *) font; 41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return pfi->getNameString(nameID, platform, encoding, language); 43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 4585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hoconst LEUnicode16 *le_getUnicodeNameString(le_font *font, le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language) 4685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho{ 4785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho PortableFontInstance *pfi = (PortableFontInstance *) font; 4885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho 4985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho return pfi->getUnicodeNameString(nameID, platform, encoding, language); 5085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho} 5185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho 52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid le_deleteNameString(le_font *font, const char *name) 53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{ 54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru PortableFontInstance *pfi = (PortableFontInstance *) font; 55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru pfi->deleteNameString(name); 57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 5985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Hovoid le_deleteUnicodeNameString(le_font *font, const LEUnicode16 *name) 6085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho{ 6185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho PortableFontInstance *pfi = (PortableFontInstance *) font; 6285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho 6385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho pfi->deleteNameString(name); 6485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho} 6585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho 66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querule_uint32 le_getFontChecksum(le_font *font) 67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{ 68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru PortableFontInstance *pfi = (PortableFontInstance *) font; 69ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return pfi->getFontChecksum(); 71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_CDECL_END 74f9878a236aa0d9662d8e40cafdaf2e04cd615835ccornelius#endif 75