Home | History | Annotate | Download | only in leperf
      1 /*
      2  *
      3  * Copyright (C) 2016 and later: Unicode, Inc. and others.
      4  * License & terms of use: http://www.unicode.org/copyright.html#License
      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 
     15 U_CDECL_BEGIN
     16 
     17 le_font *le_portableFontOpen(const char *fileName,
     18 					float pointSize,
     19 					LEErrorCode *status)
     20 {
     21 	return (le_font *) new PortableFontInstance(fileName, pointSize, *status);
     22 }
     23 
     24 le_font *le_simpleFontOpen(float pointSize,
     25 				  LEErrorCode *status)
     26 {
     27 	return (le_font *) new SimpleFontInstance(pointSize, *status);
     28 }
     29 
     30 void le_fontClose(le_font *font)
     31 {
     32 	LEFontInstance *fontInstance = (LEFontInstance *) font;
     33 
     34 	delete fontInstance;
     35 }
     36 
     37 const 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 
     44 const 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 
     51 void le_deleteNameString(le_font *font, const char *name)
     52 {
     53 	PortableFontInstance *pfi = (PortableFontInstance *) font;
     54 
     55 	pfi->deleteNameString(name);
     56 }
     57 
     58 void le_deleteUnicodeNameString(le_font *font, const LEUnicode16 *name)
     59 {
     60 	PortableFontInstance *pfi = (PortableFontInstance *) font;
     61 
     62 	pfi->deleteNameString(name);
     63 }
     64 
     65 le_uint32 le_getFontChecksum(le_font *font)
     66 {
     67 	PortableFontInstance *pfi = (PortableFontInstance *) font;
     68 
     69 	return pfi->getFontChecksum();
     70 }
     71 
     72 U_CDECL_END
     73