1 2 // Copyright 2019 - 2021 Michael D. Parker 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 module bindbc.freetype.bind.ftsnames; 8 9 import bindbc.freetype.config; 10 import bindbc.freetype.bind.freetype, 11 bindbc.freetype.bind.fttypes; 12 13 struct FT_SfntName { 14 FT_UShort platform_id; 15 FT_UShort encoding_id; 16 FT_UShort language_id; 17 FT_UShort name_id; 18 FT_Byte* string; 19 FT_UInt string_len; 20 } 21 22 struct FT_SfntLangTag { 23 FT_Byte* string_; 24 FT_UInt string_len; 25 } 26 27 static if(staticBinding) { 28 extern(C) @nogc nothrow { 29 FT_UInt FT_Get_Sfnt_Name_Count(FT_Face face); 30 FT_Error FT_Get_Sfnt_Name(FT_Face face, FT_UInt idx, FT_SfntName* aname); 31 32 static if(ftSupport >= FTSupport.ft28) { 33 FT_Error FT_Get_Sfnt_LangTag(FT_Face face, FT_UInt langID, FT_SfntLangTag* alangTag); 34 } 35 } 36 } 37 else { 38 extern(C) @nogc nothrow { 39 alias pFT_Get_Sfnt_Name_Count = FT_UInt function(FT_Face face); 40 alias pFT_Get_Sfnt_Name = FT_Error function(FT_Face face, FT_UInt idx, FT_SfntName* aname); 41 42 static if(ftSupport >= FTSupport.ft28) { 43 alias pFT_Get_Sfnt_LangTag = FT_Error function(FT_Face face, FT_UInt langID, FT_SfntLangTag* alangTag); 44 } 45 } 46 47 __gshared { 48 pFT_Get_Sfnt_Name_Count FT_Get_Sfnt_Name_Count; 49 pFT_Get_Sfnt_Name FT_Get_Sfnt_Name; 50 51 static if(ftSupport >= FTSupport.ft28) { 52 pFT_Get_Sfnt_LangTag FT_Get_Sfnt_LangTag; 53 } 54 } 55 }