Paste: freetype and clay

Author: guest
Mode: text
Date: Wed, 27 Oct 2010 17:47:27
Plain Text |
on linux 32bit

------------
extracts from the below ft.clay file
------------

private alias OpaquePointer = RawPointer;
alias FT_Library = OpaquePointer;
external FT_Init_FreeType(
    alibrary : Pointer[FT_Library]) Int;


------------
the main file
------------

import ft.*;

main ()
{
	var library = FT_Library;
	var error = FT_Init_FreeType( &library );
	if ( error ) 
		println("... an error occurred during library initialization ..."); 

}

-----------
the error code
-----------

clay -o main -timing main.clay -lc -lfreetype -lz
###############################
{
	var library = FT_Library;
	var error = FT_Init_FreeType( &library );
------------------------------------^
	if ( error ) 
		println("... an error occurred during library initialization ..."); 
###############################
main.clay(6,29): error: no matching operation

compilation context: 
  call(CCodePointer[Pointer[Pointer[UInt8]], Int32], Pointer[Static[Pointer[UInt8]]])
  main()
  callMain(Static[main])


------------
the generated ft.clay file
------------

// Automatically generated by clay-bindgen
// language: c

private alias OpaquePointer = RawPointer;
private alias UnknownType = Int;
private alias AUnionType = Int;


alias __builtin_va_list = Pointer[CChar];

alias ptrdiff_t = Int;

alias size_t = UInt;

alias wchar_t = Int;

external memcpy(
    __dest : RawPointer,
    __src : RawPointer,
    __n : UInt) RawPointer;

external memmove(
    __dest : RawPointer,
    __src : RawPointer,
    __n : UInt) RawPointer;

external memset(
    __s : RawPointer,
    __c : Int,
    __n : UInt) RawPointer;

external memcmp(
    __s1 : RawPointer,
    __s2 : RawPointer,
    __n : UInt) Int;

external memchr(
    __s : RawPointer,
    __c : Int,
    __n : UInt) RawPointer;

external strcpy(
    __dest : Pointer[CChar],
    __src : Pointer[CChar]) Pointer[CChar];

external strncpy(
    __dest : Pointer[CChar],
    __src : Pointer[CChar],
    __n : UInt) Pointer[CChar];

external strcat(
    __dest : Pointer[CChar],
    __src : Pointer[CChar]) Pointer[CChar];

external strncat(
    __dest : Pointer[CChar],
    __src : Pointer[CChar],
    __n : UInt) Pointer[CChar];

external strcmp(
    __s1 : Pointer[CChar],
    __s2 : Pointer[CChar]) Int;

external strncmp(
    __s1 : Pointer[CChar],
    __s2 : Pointer[CChar],
    __n : UInt) Int;

external strcoll(
    __s1 : Pointer[CChar],
    __s2 : Pointer[CChar]) Int;

external strxfrm(
    __dest : Pointer[CChar],
    __src : Pointer[CChar],
    __n : UInt) UInt;

external strchr(
    __s : Pointer[CChar],
    __c : Int) Pointer[CChar];

external strrchr(
    __s : Pointer[CChar],
    __c : Int) Pointer[CChar];

external strcspn(
    __s : Pointer[CChar],
    __reject : Pointer[CChar]) UInt;

external strspn(
    __s : Pointer[CChar],
    __accept : Pointer[CChar]) UInt;

external strpbrk(
    __s : Pointer[CChar],
    __accept : Pointer[CChar]) Pointer[CChar];

external strstr(
    __haystack : Pointer[CChar],
    __needle : Pointer[CChar]) Pointer[CChar];

external strtok(
    __s : Pointer[CChar],
    __delim : Pointer[CChar]) Pointer[CChar];

external __strtok_r(
    __s : Pointer[CChar],
    __delim : Pointer[CChar],
    __save_ptr : Pointer[Pointer[CChar]]) Pointer[CChar];

external strlen(
    __s : Pointer[CChar]) UInt;

external strerror(
    __errnum : Int) Pointer[CChar];

external __bzero(
    __s : RawPointer,
    __n : UInt);

alias __u_char = CUChar;

alias __u_short = UShort;

alias __u_int = UInt;

alias __u_long = CULong;

alias __int8_t = CChar;

alias __uint8_t = CUChar;

alias __int16_t = Short;

alias __uint16_t = UShort;

alias __int32_t = Int;

alias __uint32_t = UInt;

alias __int64_t = Int64;

alias __uint64_t = UInt64;

alias __quad_t = Int64;

alias __u_quad_t = UInt64;

alias __dev_t = UInt64;

alias __uid_t = UInt;

alias __gid_t = UInt;

alias __ino_t = CULong;

alias __ino64_t = UInt64;

alias __mode_t = UInt;

alias __nlink_t = UInt;

alias __off_t = CLong;

alias __off64_t = Int64;

alias __pid_t = Int;

record UnnamedStruct (
    __val : Array[Int,2],
);

alias __fsid_t = UnnamedStruct;

alias __clock_t = CLong;

alias __rlim_t = CULong;

alias __rlim64_t = UInt64;

alias __id_t = UInt;

alias __time_t = CLong;

alias __useconds_t = UInt;

alias __suseconds_t = CLong;

alias __daddr_t = Int;

alias __swblk_t = CLong;

alias __key_t = Int;

alias __clockid_t = Int;

alias __timer_t = RawPointer;

alias __blksize_t = CLong;

alias __blkcnt_t = CLong;

alias __blkcnt64_t = Int64;

alias __fsblkcnt_t = CULong;

alias __fsblkcnt64_t = UInt64;

alias __fsfilcnt_t = CULong;

alias __fsfilcnt64_t = UInt64;

alias __ssize_t = Int;

alias __loff_t = Int64;

alias __qaddr_t = Pointer[Int64];

alias __caddr_t = Pointer[CChar];

alias __intptr_t = Int;

alias __socklen_t = UInt;

alias FILE = Struct__IO_FILE;

alias __FILE = Struct__IO_FILE;

record UnnamedStruct2 (
    __count : Int,
    __value : AUnionType,
);

alias __mbstate_t = UnnamedStruct2;

record UnnamedStruct3 (
    __pos : CLong,
    __state : __mbstate_t,
);

alias _G_fpos_t = UnnamedStruct3;

record UnnamedStruct4 (
    __pos : Int64,
    __state : __mbstate_t,
);

alias _G_fpos64_t = UnnamedStruct4;

alias _G_int16_t = Short;

alias _G_int32_t = Int;

alias _G_uint16_t = UShort;

alias _G_uint32_t = UInt;

alias va_list = __builtin_va_list;

alias __gnuc_va_list = __builtin_va_list;

alias _IO_lock_t = Void;

record Struct__IO_marker (
    _next : Pointer[Struct__IO_marker],
    _sbuf : Pointer[Struct__IO_FILE],
    _pos : Int,
);

alias __codecvt_ok = 0;
alias __codecvt_partial = 1;
alias __codecvt_error = 2;
alias __codecvt_noconv = 3;

record Struct__IO_FILE (
    _flags : Int,
    _IO_read_ptr : Pointer[CChar],
    _IO_read_end : Pointer[CChar],
    _IO_read_base : Pointer[CChar],
    _IO_write_base : Pointer[CChar],
    _IO_write_ptr : Pointer[CChar],
    _IO_write_end : Pointer[CChar],
    _IO_buf_base : Pointer[CChar],
    _IO_buf_end : Pointer[CChar],
    _IO_save_base : Pointer[CChar],
    _IO_backup_base : Pointer[CChar],
    _IO_save_end : Pointer[CChar],
    _markers : Pointer[Struct__IO_marker],
    _chain : Pointer[Struct__IO_FILE],
    _fileno : Int,
    _flags2 : Int,
    _old_offset : CLong,
    _cur_column : UShort,
    _vtable_offset : CChar,
    _shortbuf : Array[CChar,1],
    _lock : RawPointer,
    _offset : Int64,
    __pad1 : RawPointer,
    __pad2 : RawPointer,
    __pad3 : RawPointer,
    __pad4 : RawPointer,
    __pad5 : UInt,
    _mode : Int,
    _unused2 : Array[CChar,40],
);

alias _IO_FILE = Struct__IO_FILE;

external _IO_2_1_stdin_ : Opaque;

external _IO_2_1_stdout_ : Opaque;

external _IO_2_1_stderr_ : Opaque;

external __underflow(
    argument0 : Pointer[_IO_FILE]) Int;

external __uflow(
    argument0 : Pointer[_IO_FILE]) Int;

external __overflow(
    argument0 : Pointer[_IO_FILE],
    argument1 : Int) Int;

external _IO_getc(
    __fp : Pointer[_IO_FILE]) Int;

external _IO_putc(
    __c : Int,
    __fp : Pointer[_IO_FILE]) Int;

external _IO_feof(
    __fp : Pointer[_IO_FILE]) Int;

external _IO_ferror(
    __fp : Pointer[_IO_FILE]) Int;

external _IO_peekc_locked(
    __fp : Pointer[_IO_FILE]) Int;

external _IO_flockfile(
    argument0 : Pointer[_IO_FILE]);

external _IO_funlockfile(
    argument0 : Pointer[_IO_FILE]);

external _IO_ftrylockfile(
    argument0 : Pointer[_IO_FILE]) Int;

external _IO_vfscanf(
    argument0 : Pointer[_IO_FILE],
    argument1 : Pointer[CChar],
    argument2 : __gnuc_va_list,
    argument3 : Pointer[Int]) Int;

external _IO_vfprintf(
    argument0 : Pointer[_IO_FILE],
    argument1 : Pointer[CChar],
    argument2 : __gnuc_va_list) Int;

external _IO_padn(
    argument0 : Pointer[_IO_FILE],
    argument1 : Int,
    argument2 : Int) Int;

external _IO_sgetn(
    argument0 : Pointer[_IO_FILE],
    argument1 : RawPointer,
    argument2 : UInt) UInt;

external _IO_seekoff(
    argument0 : Pointer[_IO_FILE],
    argument1 : Int64,
    argument2 : Int,
    argument3 : Int) Int64;

external _IO_seekpos(
    argument0 : Pointer[_IO_FILE],
    argument1 : Int64,
    argument2 : Int) Int64;

external _IO_free_backup_area(
    argument0 : Pointer[_IO_FILE]);

alias fpos_t = _G_fpos_t;

external stdin : Pointer[Struct__IO_FILE];

external stdout : Pointer[Struct__IO_FILE];

external stderr : Pointer[Struct__IO_FILE];

external remove(
    __filename : Pointer[CChar]) Int;

external rename(
    __old : Pointer[CChar],
    __new : Pointer[CChar]) Int;

external tmpfile() Pointer[FILE];

external tmpnam(
    __s : Pointer[CChar]) Pointer[CChar];

external fclose(
    __stream : Pointer[FILE]) Int;

external fflush(
    __stream : Pointer[FILE]) Int;

external fopen(
    __filename : Pointer[CChar],
    __modes : Pointer[CChar]) Pointer[FILE];

external freopen(
    __filename : Pointer[CChar],
    __modes : Pointer[CChar],
    __stream : Pointer[FILE]) Pointer[FILE];

external setbuf(
    __stream : Pointer[FILE],
    __buf : Pointer[CChar]);

external setvbuf(
    __stream : Pointer[FILE],
    __buf : Pointer[CChar],
    __modes : Int,
    __n : UInt) Int;

external fprintf(
    __stream : Pointer[FILE],
    __format : Pointer[CChar],
    ...) Int;

external printf(
    __format : Pointer[CChar],
    ...) Int;

external sprintf(
    __s : Pointer[CChar],
    __format : Pointer[CChar],
    ...) Int;

external vfprintf(
    __s : Pointer[FILE],
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external vprintf(
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external vsprintf(
    __s : Pointer[CChar],
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external snprintf(
    __s : Pointer[CChar],
    __maxlen : UInt,
    __format : Pointer[CChar],
    ...) Int;

external vsnprintf(
    __s : Pointer[CChar],
    __maxlen : UInt,
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external fscanf(
    __stream : Pointer[FILE],
    __format : Pointer[CChar],
    ...) Int;

external scanf(
    __format : Pointer[CChar],
    ...) Int;

external sscanf(
    __s : Pointer[CChar],
    __format : Pointer[CChar],
    ...) Int;

external vfscanf(
    __s : Pointer[FILE],
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external vscanf(
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external vsscanf(
    __s : Pointer[CChar],
    __format : Pointer[CChar],
    __arg : __gnuc_va_list) Int;

external fgetc(
    __stream : Pointer[FILE]) Int;

external getc(
    __stream : Pointer[FILE]) Int;

external getchar() Int;

external fputc(
    __c : Int,
    __stream : Pointer[FILE]) Int;

external putc(
    __c : Int,
    __stream : Pointer[FILE]) Int;

external putchar(
    __c : Int) Int;

external fgets(
    __s : Pointer[CChar],
    __n : Int,
    __stream : Pointer[FILE]) Pointer[CChar];

external gets(
    __s : Pointer[CChar]) Pointer[CChar];

external fputs(
    __s : Pointer[CChar],
    __stream : Pointer[FILE]) Int;

external puts(
    __s : Pointer[CChar]) Int;

external ungetc(
    __c : Int,
    __stream : Pointer[FILE]) Int;

external fread(
    __ptr : RawPointer,
    __size : UInt,
    __n : UInt,
    __stream : Pointer[FILE]) UInt;

external fwrite(
    __ptr : RawPointer,
    __size : UInt,
    __n : UInt,
    __s : Pointer[FILE]) UInt;

external fseek(
    __stream : Pointer[FILE],
    __off : CLong,
    __whence : Int) Int;

external ftell(
    __stream : Pointer[FILE]) CLong;

external rewind(
    __stream : Pointer[FILE]);

external fgetpos(
    __stream : Pointer[FILE],
    __pos : Pointer[fpos_t]) Int;

external fsetpos(
    __stream : Pointer[FILE],
    __pos : Pointer[fpos_t]) Int;

external clearerr(
    __stream : Pointer[FILE]);

external feof(
    __stream : Pointer[FILE]) Int;

external ferror(
    __stream : Pointer[FILE]) Int;

external perror(
    __s : Pointer[CChar]);

record UnnamedStruct5 (
    quot : Int,
    rem : Int,
);

alias div_t = UnnamedStruct5;

record UnnamedStruct6 (
    quot : CLong,
    rem : CLong,
);

alias ldiv_t = UnnamedStruct6;

record UnnamedStruct7 (
    quot : Int64,
    rem : Int64,
);

alias lldiv_t = UnnamedStruct7;

external __ctype_get_mb_cur_max() UInt;

external atof(
    __nptr : Pointer[CChar]) Double;

external atoi(
    __nptr : Pointer[CChar]) Int;

external atol(
    __nptr : Pointer[CChar]) CLong;

external atoll(
    __nptr : Pointer[CChar]) Int64;

external strtod(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]]) Double;

external strtof(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]]) Float;

external strtold(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]]) UnsupportedCBuiltinType21;

external strtol(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]],
    __base : Int) CLong;

external strtoul(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]],
    __base : Int) CULong;

external strtoll(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]],
    __base : Int) Int64;

external strtoull(
    __nptr : Pointer[CChar],
    __endptr : Pointer[Pointer[CChar]],
    __base : Int) UInt64;

external rand() Int;

external srand(
    __seed : UInt);

external malloc(
    __size : UInt) RawPointer;

external calloc(
    __nmemb : UInt,
    __size : UInt) RawPointer;

external realloc(
    __ptr : RawPointer,
    __size : UInt) RawPointer;

external free(
    __ptr : RawPointer);

external abort();

external atexit(
    __func : CCodePointer[(),()]) Int;

external exit(
    __status : Int);

external _Exit(
    __status : Int);

external getenv(
    __name : Pointer[CChar]) Pointer[CChar];

external __secure_getenv(
    __name : Pointer[CChar]) Pointer[CChar];

external system(
    __command : Pointer[CChar]) Int;

alias __compar_fn_t = CCodePointer[(RawPointer,RawPointer),(Int)];

external bsearch(
    __key : RawPointer,
    __base : RawPointer,
    __nmemb : UInt,
    __size : UInt,
    __compar : __compar_fn_t) RawPointer;

external qsort(
    __base : RawPointer,
    __nmemb : UInt,
    __size : UInt,
    __compar : __compar_fn_t);

external abs(
    __x : Int) Int;

external labs(
    __x : CLong) CLong;

external llabs(
    __x : Int64) Int64;

external div(
    __numer : Int,
    __denom : Int) div_t;

external ldiv(
    __numer : CLong,
    __denom : CLong) ldiv_t;

external lldiv(
    __numer : Int64,
    __denom : Int64) lldiv_t;

external mblen(
    __s : Pointer[CChar],
    __n : UInt) Int;

external mbtowc(
    __pwc : Pointer[Int],
    __s : Pointer[CChar],
    __n : UInt) Int;

external wctomb(
    __s : Pointer[CChar],
    __wchar : Int) Int;

external mbstowcs(
    __pwcs : Pointer[Int],
    __s : Pointer[CChar],
    __n : UInt) UInt;

external wcstombs(
    __s : Pointer[CChar],
    __pwcs : Pointer[Int],
    __n : UInt) UInt;

alias __jmp_buf = Array[Int,6];

alias __sig_atomic_t = Int;

record UnnamedStruct8 (
    __val : Array[CULong,32],
);

alias __sigset_t = UnnamedStruct8;

record Struct___jmp_buf_tag (
    __jmpbuf : __jmp_buf,
    __mask_was_saved : Int,
    __saved_mask : __sigset_t,
);

alias jmp_buf = Array[Struct___jmp_buf_tag,1];

external setjmp(
    __env : Pointer[Struct___jmp_buf_tag]) Int;

external __sigsetjmp(
    __env : Pointer[Struct___jmp_buf_tag],
    __savemask : Int) Int;

external _setjmp(
    __env : Pointer[Struct___jmp_buf_tag]) Int;

external longjmp(
    __env : Pointer[Struct___jmp_buf_tag],
    __val : Int);

alias FT_Int16 = Short;

alias FT_UInt16 = UShort;

alias FT_Int32 = Int;

alias FT_UInt32 = UInt;

alias FT_Fast = Int;

alias FT_UFast = UInt;

alias FT_Mod_Err_Base = 0;
alias FT_Mod_Err_Autofit = 0;
alias FT_Mod_Err_BDF = 0;
alias FT_Mod_Err_Cache = 0;
alias FT_Mod_Err_CFF = 0;
alias FT_Mod_Err_CID = 0;
alias FT_Mod_Err_Gzip = 0;
alias FT_Mod_Err_LZW = 0;
alias FT_Mod_Err_OTvalid = 0;
alias FT_Mod_Err_PCF = 0;
alias FT_Mod_Err_PFR = 0;
alias FT_Mod_Err_PSaux = 0;
alias FT_Mod_Err_PShinter = 0;
alias FT_Mod_Err_PSnames = 0;
alias FT_Mod_Err_Raster = 0;
alias FT_Mod_Err_SFNT = 0;
alias FT_Mod_Err_Smooth = 0;
alias FT_Mod_Err_TrueType = 0;
alias FT_Mod_Err_Type1 = 0;
alias FT_Mod_Err_Type42 = 0;
alias FT_Mod_Err_Winfonts = 0;
alias FT_Mod_Err_Max = 1;

alias FT_Err_Ok = 0;
alias FT_Err_Cannot_Open_Resource = 1;
alias FT_Err_Unknown_File_Format = 2;
alias FT_Err_Invalid_File_Format = 3;
alias FT_Err_Invalid_Version = 4;
alias FT_Err_Lower_Module_Version = 5;
alias FT_Err_Invalid_Argument = 6;
alias FT_Err_Unimplemented_Feature = 7;
alias FT_Err_Invalid_Table = 8;
alias FT_Err_Invalid_Offset = 9;
alias FT_Err_Array_Too_Large = 10;
alias FT_Err_Invalid_Glyph_Index = 16;
alias FT_Err_Invalid_Character_Code = 17;
alias FT_Err_Invalid_Glyph_Format = 18;
alias FT_Err_Cannot_Render_Glyph = 19;
alias FT_Err_Invalid_Outline = 20;
alias FT_Err_Invalid_Composite = 21;
alias FT_Err_Too_Many_Hints = 22;
alias FT_Err_Invalid_Pixel_Size = 23;
alias FT_Err_Invalid_Handle = 32;
alias FT_Err_Invalid_Library_Handle = 33;
alias FT_Err_Invalid_Driver_Handle = 34;
alias FT_Err_Invalid_Face_Handle = 35;
alias FT_Err_Invalid_Size_Handle = 36;
alias FT_Err_Invalid_Slot_Handle = 37;
alias FT_Err_Invalid_CharMap_Handle = 38;
alias FT_Err_Invalid_Cache_Handle = 39;
alias FT_Err_Invalid_Stream_Handle = 40;
alias FT_Err_Too_Many_Drivers = 48;
alias FT_Err_Too_Many_Extensions = 49;
alias FT_Err_Out_Of_Memory = 64;
alias FT_Err_Unlisted_Object = 65;
alias FT_Err_Cannot_Open_Stream = 81;
alias FT_Err_Invalid_Stream_Seek = 82;
alias FT_Err_Invalid_Stream_Skip = 83;
alias FT_Err_Invalid_Stream_Read = 84;
alias FT_Err_Invalid_Stream_Operation = 85;
alias FT_Err_Invalid_Frame_Operation = 86;
alias FT_Err_Nested_Frame_Access = 87;
alias FT_Err_Invalid_Frame_Read = 88;
alias FT_Err_Raster_Uninitialized = 96;
alias FT_Err_Raster_Corrupted = 97;
alias FT_Err_Raster_Overflow = 98;
alias FT_Err_Raster_Negative_Height = 99;
alias FT_Err_Too_Many_Caches = 112;
alias FT_Err_Invalid_Opcode = 128;
alias FT_Err_Too_Few_Arguments = 129;
alias FT_Err_Stack_Overflow = 130;
alias FT_Err_Code_Overflow = 131;
alias FT_Err_Bad_Argument = 132;
alias FT_Err_Divide_By_Zero = 133;
alias FT_Err_Invalid_Reference = 134;
alias FT_Err_Debug_OpCode = 135;
alias FT_Err_ENDF_In_Exec_Stream = 136;
alias FT_Err_Nested_DEFS = 137;
alias FT_Err_Invalid_CodeRange = 138;
alias FT_Err_Execution_Too_Long = 139;
alias FT_Err_Too_Many_Function_Defs = 140;
alias FT_Err_Too_Many_Instruction_Defs = 141;
alias FT_Err_Table_Missing = 142;
alias FT_Err_Horiz_Header_Missing = 143;
alias FT_Err_Locations_Missing = 144;
alias FT_Err_Name_Table_Missing = 145;
alias FT_Err_CMap_Table_Missing = 146;
alias FT_Err_Hmtx_Table_Missing = 147;
alias FT_Err_Post_Table_Missing = 148;
alias FT_Err_Invalid_Horiz_Metrics = 149;
alias FT_Err_Invalid_CharMap_Format = 150;
alias FT_Err_Invalid_PPem = 151;
alias FT_Err_Invalid_Vert_Metrics = 152;
alias FT_Err_Could_Not_Find_Context = 153;
alias FT_Err_Invalid_Post_Table_Format = 154;
alias FT_Err_Invalid_Post_Table = 155;
alias FT_Err_Syntax_Error = 160;
alias FT_Err_Stack_Underflow = 161;
alias FT_Err_Ignore = 162;
alias FT_Err_No_Unicode_Glyph_Name = 163;
alias FT_Err_Missing_Startfont_Field = 176;
alias FT_Err_Missing_Font_Field = 177;
alias FT_Err_Missing_Size_Field = 178;
alias FT_Err_Missing_Fontboundingbox_Field = 179;
alias FT_Err_Missing_Chars_Field = 180;
alias FT_Err_Missing_Startchar_Field = 181;
alias FT_Err_Missing_Encoding_Field = 182;
alias FT_Err_Missing_Bbx_Field = 183;
alias FT_Err_Bbx_Too_Big = 184;
alias FT_Err_Corrupted_Font_Header = 185;
alias FT_Err_Corrupted_Font_Glyphs = 186;
alias FT_Err_Max = 187;

alias FT_Memory = Pointer[Struct_FT_MemoryRec_];

alias FT_Alloc_Func = CCodePointer[(Pointer[Struct_FT_MemoryRec_],CLong),(RawPointer)];

alias FT_Free_Func = CCodePointer[(Pointer[Struct_FT_MemoryRec_],RawPointer),()];

alias FT_Realloc_Func = CCodePointer[(Pointer[Struct_FT_MemoryRec_],CLong,CLong,RawPointer),(RawPointer)];

record Struct_FT_MemoryRec_ (
    user : RawPointer,
    alloc : FT_Alloc_Func,
    free : FT_Free_Func,
    realloc : FT_Realloc_Func,
);

alias FT_Stream = Pointer[Struct_FT_StreamRec_];

alias FT_StreamDesc = AUnionType;

alias FT_Stream_IoFunc = CCodePointer[(Pointer[Struct_FT_StreamRec_],CULong,Pointer[CUChar],CULong),(CULong)];

alias FT_Stream_CloseFunc = CCodePointer[(Pointer[Struct_FT_StreamRec_]),()];

record Struct_FT_StreamRec_ (
    base : Pointer[CUChar],
    size : CULong,
    pos : CULong,
    descriptor : FT_StreamDesc,
    pathname : FT_StreamDesc,
    read : FT_Stream_IoFunc,
    close : FT_Stream_CloseFunc,
    memory : FT_Memory,
    cursor : Pointer[CUChar],
    limit : Pointer[CUChar],
);

alias FT_StreamRec = Struct_FT_StreamRec_;

alias FT_Pos = CLong;

record Struct_FT_Vector_ (
    x : CLong,
    y : CLong,
);

alias FT_Vector = Struct_FT_Vector_;

record Struct_FT_BBox_ (
    xMin : CLong,
    yMin : CLong,
    xMax : CLong,
    yMax : CLong,
);

alias FT_BBox = Struct_FT_BBox_;

alias FT_PIXEL_MODE_NONE = 0;
alias FT_PIXEL_MODE_MONO = 1;
alias FT_PIXEL_MODE_GRAY = 2;
alias FT_PIXEL_MODE_GRAY2 = 3;
alias FT_PIXEL_MODE_GRAY4 = 4;
alias FT_PIXEL_MODE_LCD = 5;
alias FT_PIXEL_MODE_LCD_V = 6;
alias FT_PIXEL_MODE_MAX = 7;

alias FT_Pixel_Mode = Int;

record Struct_FT_Bitmap_ (
    rows : Int,
    width : Int,
    pitch : Int,
    buffer : Pointer[CUChar],
    num_grays : Short,
    pixel_mode : CChar,
    palette_mode : CChar,
    palette : RawPointer,
);

alias FT_Bitmap = Struct_FT_Bitmap_;

record Struct_FT_Outline_ (
    n_contours : Short,
    n_points : Short,
    points : Pointer[FT_Vector],
    tags : Pointer[CChar],
    contours : Pointer[Short],
    flags : Int,
);

alias FT_Outline = Struct_FT_Outline_;

alias FT_Outline_MoveToFunc = CCodePointer[(Pointer[Struct_FT_Vector_],RawPointer),(Int)];

alias FT_Outline_LineToFunc = CCodePointer[(Pointer[Struct_FT_Vector_],RawPointer),(Int)];

alias FT_Outline_ConicToFunc = CCodePointer[(Pointer[Struct_FT_Vector_],Pointer[Struct_FT_Vector_],RawPointer),(Int)];

alias FT_Outline_CubicToFunc = CCodePointer[(Pointer[Struct_FT_Vector_],Pointer[Struct_FT_Vector_],Pointer[Struct_FT_Vector_],RawPointer),(Int)];

record Struct_FT_Outline_Funcs_ (
    move_to : FT_Outline_MoveToFunc,
    line_to : FT_Outline_LineToFunc,
    conic_to : FT_Outline_ConicToFunc,
    cubic_to : FT_Outline_CubicToFunc,
    shift : Int,
    delta : CLong,
);

alias FT_Outline_Funcs = Struct_FT_Outline_Funcs_;

alias FT_GLYPH_FORMAT_NONE = 0;
alias FT_GLYPH_FORMAT_COMPOSITE = 1668246896;
alias FT_GLYPH_FORMAT_BITMAP = 1651078259;
alias FT_GLYPH_FORMAT_OUTLINE = 1869968492;
alias FT_GLYPH_FORMAT_PLOTTER = 1886154612;

alias FT_Glyph_Format = Int;

alias FT_Raster = OpaquePointer;

record Struct_FT_Span_ (
    x : Short,
    len : UShort,
    coverage : CUChar,
);

alias FT_Span = Struct_FT_Span_;

alias FT_SpanFunc = CCodePointer[(Int,Int,Pointer[Struct_FT_Span_],RawPointer),()];

alias FT_Raster_BitTest_Func = CCodePointer[(Int,Int,RawPointer),(Int)];

alias FT_Raster_BitSet_Func = CCodePointer[(Int,Int,RawPointer),()];

record Struct_FT_Raster_Params_ (
    target : Pointer[FT_Bitmap],
    source : RawPointer,
    flags : Int,
    gray_spans : FT_SpanFunc,
    black_spans : FT_SpanFunc,
    bit_test : FT_Raster_BitTest_Func,
    bit_set : FT_Raster_BitSet_Func,
    user : RawPointer,
    clip_box : FT_BBox,
);

alias FT_Raster_Params = Struct_FT_Raster_Params_;

alias FT_Raster_NewFunc = CCodePointer[(RawPointer,Pointer[OpaquePointer]),(Int)];

alias FT_Raster_DoneFunc = CCodePointer[(OpaquePointer),()];

alias FT_Raster_ResetFunc = CCodePointer[(OpaquePointer,Pointer[CUChar],CULong),()];

alias FT_Raster_SetModeFunc = CCodePointer[(OpaquePointer,CULong,RawPointer),(Int)];

alias FT_Raster_RenderFunc = CCodePointer[(OpaquePointer,Pointer[Struct_FT_Raster_Params_]),(Int)];

record Struct_FT_Raster_Funcs_ (
    glyph_format : FT_Glyph_Format,
    raster_new : FT_Raster_NewFunc,
    raster_reset : FT_Raster_ResetFunc,
    raster_set_mode : FT_Raster_SetModeFunc,
    raster_render : FT_Raster_RenderFunc,
    raster_done : FT_Raster_DoneFunc,
);

alias FT_Raster_Funcs = Struct_FT_Raster_Funcs_;

alias FT_Bool = CUChar;

alias FT_FWord = Short;

alias FT_UFWord = UShort;

alias FT_Char = CChar;

alias FT_Byte = CUChar;

alias FT_Bytes = Pointer[CUChar];

alias FT_Tag = UInt;

alias FT_String = CChar;

alias FT_Short = Short;

alias FT_UShort = UShort;

alias FT_Int = Int;

alias FT_UInt = UInt;

alias FT_Long = CLong;

alias FT_ULong = CULong;

alias FT_F2Dot14 = Short;

alias FT_F26Dot6 = CLong;

alias FT_Fixed = CLong;

alias FT_Error = Int;

alias FT_Pointer = RawPointer;

alias FT_Offset = UInt;

alias FT_PtrDist = Int;

record Struct_FT_UnitVector_ (
    x : Short,
    y : Short,
);

alias FT_UnitVector = Struct_FT_UnitVector_;

record Struct_FT_Matrix_ (
    xx : CLong,
    xy : CLong,
    yx : CLong,
    yy : CLong,
);

alias FT_Matrix = Struct_FT_Matrix_;

record Struct_FT_Data_ (
    pointer : Pointer[CUChar],
    length : Int,
);

alias FT_Data = Struct_FT_Data_;

alias FT_Generic_Finalizer = CCodePointer[(RawPointer),()];

record Struct_FT_Generic_ (
    data : RawPointer,
    finalizer : FT_Generic_Finalizer,
);

alias FT_Generic = Struct_FT_Generic_;

alias FT_ListNode = Pointer[Struct_FT_ListNodeRec_];

alias FT_List = Pointer[Struct_FT_ListRec_];

record Struct_FT_ListNodeRec_ (
    prev : FT_ListNode,
    next : FT_ListNode,
    data : RawPointer,
);

alias FT_ListNodeRec = Struct_FT_ListNodeRec_;

record Struct_FT_ListRec_ (
    head : FT_ListNode,
    tail : FT_ListNode,
);

alias FT_ListRec = Struct_FT_ListRec_;

record Struct_FT_Glyph_Metrics_ (
    width : CLong,
    height : CLong,
    horiBearingX : CLong,
    horiBearingY : CLong,
    horiAdvance : CLong,
    vertBearingX : CLong,
    vertBearingY : CLong,
    vertAdvance : CLong,
);

alias FT_Glyph_Metrics = Struct_FT_Glyph_Metrics_;

record Struct_FT_Bitmap_Size_ (
    height : Short,
    width : Short,
    size : CLong,
    x_ppem : CLong,
    y_ppem : CLong,
);

alias FT_Bitmap_Size = Struct_FT_Bitmap_Size_;

alias FT_Library = OpaquePointer;

alias FT_Module = OpaquePointer;

alias FT_Driver = OpaquePointer;

alias FT_Renderer = OpaquePointer;

alias FT_Face = Pointer[Struct_FT_FaceRec_];

alias FT_Size = Pointer[Struct_FT_SizeRec_];

alias FT_GlyphSlot = Pointer[Struct_FT_GlyphSlotRec_];

alias FT_CharMap = Pointer[Struct_FT_CharMapRec_];

alias FT_ENCODING_NONE = 0;
alias FT_ENCODING_MS_SYMBOL = 1937337698;
alias FT_ENCODING_UNICODE = 1970170211;
alias FT_ENCODING_SJIS = 1936353651;
alias FT_ENCODING_GB2312 = 1734484000;
alias FT_ENCODING_BIG5 = 1651074869;
alias FT_ENCODING_WANSUNG = 2002873971;
alias FT_ENCODING_JOHAB = 1785686113;
alias FT_ENCODING_MS_SJIS = 1936353651;
alias FT_ENCODING_MS_GB2312 = 1734484000;
alias FT_ENCODING_MS_BIG5 = 1651074869;
alias FT_ENCODING_MS_WANSUNG = 2002873971;
alias FT_ENCODING_MS_JOHAB = 1785686113;
alias FT_ENCODING_ADOBE_STANDARD = 1094995778;
alias FT_ENCODING_ADOBE_EXPERT = 1094992453;
alias FT_ENCODING_ADOBE_CUSTOM = 1094992451;
alias FT_ENCODING_ADOBE_LATIN_1 = 1818326065;
alias FT_ENCODING_OLD_LATIN_2 = 1818326066;
alias FT_ENCODING_APPLE_ROMAN = 1634889070;

alias FT_Encoding = Int;

record Struct_FT_CharMapRec_ (
    face : FT_Face,
    encoding : FT_Encoding,
    platform_id : UShort,
    encoding_id : UShort,
);

alias FT_CharMapRec = Struct_FT_CharMapRec_;

alias FT_Face_Internal = OpaquePointer;

record Struct_FT_FaceRec_ (
    num_faces : CLong,
    face_index : CLong,
    face_flags : CLong,
    style_flags : CLong,
    num_glyphs : CLong,
    family_name : Pointer[CChar],
    style_name : Pointer[CChar],
    num_fixed_sizes : Int,
    available_sizes : Pointer[FT_Bitmap_Size],
    num_charmaps : Int,
    charmaps : Pointer[FT_CharMap],
    generic : FT_Generic,
    bbox : FT_BBox,
    units_per_EM : UShort,
    ascender : Short,
    descender : Short,
    height : Short,
    max_advance_width : Short,
    max_advance_height : Short,
    underline_position : Short,
    underline_thickness : Short,
    glyph : FT_GlyphSlot,
    size : FT_Size,
    charmap : FT_CharMap,
    driver : FT_Driver,
    memory : FT_Memory,
    stream : FT_Stream,
    sizes_list : FT_ListRec,
    autohint : FT_Generic,
    extensions : RawPointer,
    internal : FT_Face_Internal,
);

alias FT_FaceRec = Struct_FT_FaceRec_;

alias FT_Size_Internal = OpaquePointer;

record Struct_FT_Size_Metrics_ (
    x_ppem : UShort,
    y_ppem : UShort,
    x_scale : CLong,
    y_scale : CLong,
    ascender : CLong,
    descender : CLong,
    height : CLong,
    max_advance : CLong,
);

alias FT_Size_Metrics = Struct_FT_Size_Metrics_;

record Struct_FT_SizeRec_ (
    face : FT_Face,
    generic : FT_Generic,
    metrics : FT_Size_Metrics,
    internal : FT_Size_Internal,
);

alias FT_SizeRec = Struct_FT_SizeRec_;

alias FT_SubGlyph = OpaquePointer;

alias FT_Slot_Internal = OpaquePointer;

record Struct_FT_GlyphSlotRec_ (
    library : FT_Library,
    face : FT_Face,
    next : FT_GlyphSlot,
    reserved : UInt,
    generic : FT_Generic,
    metrics : FT_Glyph_Metrics,
    linearHoriAdvance : CLong,
    linearVertAdvance : CLong,
    advance : FT_Vector,
    format : FT_Glyph_Format,
    bitmap : FT_Bitmap,
    bitmap_left : Int,
    bitmap_top : Int,
    outline : FT_Outline,
    num_subglyphs : UInt,
    subglyphs : FT_SubGlyph,
    control_data : RawPointer,
    control_len : CLong,
    lsb_delta : CLong,
    rsb_delta : CLong,
    other : RawPointer,
    internal : FT_Slot_Internal,
);

alias FT_GlyphSlotRec = Struct_FT_GlyphSlotRec_;

external FT_Init_FreeType(
    alibrary : Pointer[FT_Library]) Int;

external FT_Done_FreeType(
    library : FT_Library) Int;

record Struct_FT_Parameter_ (
    tag : CULong,
    data : FT_Pointer,
);

alias FT_Parameter = Struct_FT_Parameter_;

record Struct_FT_Open_Args_ (
    flags : UInt,
    memory_base : Pointer[CUChar],
    memory_size : CLong,
    pathname : Pointer[CChar],
    stream : FT_Stream,
    driver : FT_Module,
    num_params : Int,
    params : Pointer[FT_Parameter],
);

alias FT_Open_Args = Struct_FT_Open_Args_;

external FT_New_Face(
    library : FT_Library,
    filepathname : Pointer[CChar],
    face_index : CLong,
    aface : Pointer[FT_Face]) Int;

external FT_New_Memory_Face(
    library : FT_Library,
    file_base : Pointer[CUChar],
    file_size : CLong,
    face_index : CLong,
    aface : Pointer[FT_Face]) Int;

external FT_Open_Face(
    library : FT_Library,
    args : Pointer[FT_Open_Args],
    face_index : CLong,
    aface : Pointer[FT_Face]) Int;

external FT_Attach_File(
    face : FT_Face,
    filepathname : Pointer[CChar]) Int;

external FT_Attach_Stream(
    face : FT_Face,
    parameters : Pointer[FT_Open_Args]) Int;

external FT_Done_Face(
    face : FT_Face) Int;

external FT_Select_Size(
    face : FT_Face,
    strike_index : Int) Int;

alias FT_SIZE_REQUEST_TYPE_NOMINAL = 0;
alias FT_SIZE_REQUEST_TYPE_REAL_DIM = 1;
alias FT_SIZE_REQUEST_TYPE_BBOX = 2;
alias FT_SIZE_REQUEST_TYPE_CELL = 3;
alias FT_SIZE_REQUEST_TYPE_SCALES = 4;
alias FT_SIZE_REQUEST_TYPE_MAX = 5;

alias FT_Size_Request_Type = Int;

record Struct_FT_Size_RequestRec_ (
    type : FT_Size_Request_Type,
    width : CLong,
    height : CLong,
    horiResolution : UInt,
    vertResolution : UInt,
);

alias FT_Size_RequestRec = Struct_FT_Size_RequestRec_;

alias FT_Size_Request = Pointer[Struct_FT_Size_RequestRec_];

external FT_Request_Size(
    face : FT_Face,
    req : FT_Size_Request) Int;

external FT_Set_Char_Size(
    face : FT_Face,
    char_width : CLong,
    char_height : CLong,
    horz_resolution : UInt,
    vert_resolution : UInt) Int;

external FT_Set_Pixel_Sizes(
    face : FT_Face,
    pixel_width : UInt,
    pixel_height : UInt) Int;

external FT_Load_Glyph(
    face : FT_Face,
    glyph_index : UInt,
    load_flags : Int) Int;

external FT_Load_Char(
    face : FT_Face,
    char_code : CULong,
    load_flags : Int) Int;

external FT_Set_Transform(
    face : FT_Face,
    matrix : Pointer[FT_Matrix],
    delta : Pointer[FT_Vector]);

alias FT_RENDER_MODE_NORMAL = 0;
alias FT_RENDER_MODE_LIGHT = 1;
alias FT_RENDER_MODE_MONO = 2;
alias FT_RENDER_MODE_LCD = 3;
alias FT_RENDER_MODE_LCD_V = 4;
alias FT_RENDER_MODE_MAX = 5;

alias FT_Render_Mode = Int;

external FT_Render_Glyph(
    slot : FT_GlyphSlot,
    render_mode : FT_Render_Mode) Int;

alias FT_KERNING_DEFAULT = 0;
alias FT_KERNING_UNFITTED = 1;
alias FT_KERNING_UNSCALED = 2;

alias FT_Kerning_Mode = Int;

external FT_Get_Kerning(
    face : FT_Face,
    left_glyph : UInt,
    right_glyph : UInt,
    kern_mode : UInt,
    akerning : Pointer[FT_Vector]) Int;

external FT_Get_Track_Kerning(
    face : FT_Face,
    point_size : CLong,
    degree : Int,
    akerning : Pointer[CLong]) Int;

external FT_Get_Glyph_Name(
    face : FT_Face,
    glyph_index : UInt,
    buffer : FT_Pointer,
    buffer_max : UInt) Int;

external FT_Get_Postscript_Name(
    face : FT_Face) Pointer[CChar];

external FT_Select_Charmap(
    face : FT_Face,
    encoding : FT_Encoding) Int;

external FT_Set_Charmap(
    face : FT_Face,
    charmap : FT_CharMap) Int;

external FT_Get_Charmap_Index(
    charmap : FT_CharMap) Int;

external FT_Get_Char_Index(
    face : FT_Face,
    charcode : CULong) UInt;

external FT_Get_First_Char(
    face : FT_Face,
    agindex : Pointer[UInt]) CULong;

external FT_Get_Next_Char(
    face : FT_Face,
    char_code : CULong,
    agindex : Pointer[UInt]) CULong;

external FT_Get_Name_Index(
    face : FT_Face,
    glyph_name : Pointer[CChar]) UInt;

external FT_Get_SubGlyph_Info(
    glyph : FT_GlyphSlot,
    sub_index : UInt,
    p_index : Pointer[Int],
    p_flags : Pointer[UInt],
    p_arg1 : Pointer[Int],
    p_arg2 : Pointer[Int],
    p_transform : Pointer[FT_Matrix]) Int;

external FT_Get_FSType_Flags(
    face : FT_Face) UShort;

external FT_Face_GetCharVariantIndex(
    face : FT_Face,
    charcode : CULong,
    variantSelector : CULong) UInt;

external FT_Face_GetCharVariantIsDefault(
    face : FT_Face,
    charcode : CULong,
    variantSelector : CULong) Int;

external FT_Face_GetVariantSelectors(
    face : FT_Face) Pointer[UInt];

external FT_Face_GetVariantsOfChar(
    face : FT_Face,
    charcode : CULong) Pointer[UInt];

external FT_Face_GetCharsOfVariant(
    face : FT_Face,
    variantSelector : CULong) Pointer[UInt];

external FT_MulDiv(
    a : CLong,
    b : CLong,
    c : CLong) CLong;

external FT_MulFix(
    a : CLong,
    b : CLong) CLong;

external FT_DivFix(
    a : CLong,
    b : CLong) CLong;

external FT_RoundFix(
    a : CLong) CLong;

external FT_CeilFix(
    a : CLong) CLong;

external FT_FloorFix(
    a : CLong) CLong;

external FT_Vector_Transform(
    vec : Pointer[FT_Vector],
    matrix : Pointer[FT_Matrix]);

external FT_Library_Version(
    library : FT_Library,
    amajor : Pointer[Int],
    aminor : Pointer[Int],
    apatch : Pointer[Int]);

external FT_Face_CheckTrueTypePatents(
    face : FT_Face) CUChar;

external FT_Face_SetUnpatentedHinting(
    face : FT_Face,
    value : CUChar) CUChar;

New Annotation

Summary:
Author:
Mode:
Body: