Author: dhudson Date: 2007-11-09 12:32:32 -0500 (Fri, 09 Nov 2007) New Revision: 89328
Modified: trunk/tao/src/Tao.FreeType/FreeType.cs Log: updated from emacinnes Modified: trunk/tao/src/Tao.FreeType/FreeType.cs =================================================================== --- trunk/tao/src/Tao.FreeType/FreeType.cs 2007-11-09 17:05:38 UTC (rev 89327) +++ trunk/tao/src/Tao.FreeType/FreeType.cs 2007-11-09 17:32:32 UTC (rev 89328) @@ -25,12 +25,25 @@ */ #endregion License +#region Version // based on http://www.koders.com/csharp/fid840ED1F892217853EE1DD8692B953A84E1D5C2AE.aspx // -// Amendments are to: +// Applicable to Freetype 2.1.9 or later +// +// 2007-Nov-9- Euan D MacInnes. +// Converted names to official FreeType names +// Added help text from FreeType website +// +// 2007-Nov-01 Euan D MacInnes. Amendments are to: // Init_FreeType, to make the libptr "out" // New_Face, to make the aface "out" +// NOTE: Some FreeType variables do not start with FT. +// Some structures exist here ***Rec_, that are currently unused. +// These were originally intended as typed pointer references. +// However IntPtr's have been used for now. +#endregion + using System; using System.Collections; using System.Runtime.InteropServices; @@ -83,10 +96,10 @@ } /// <summary> - /// + /// A structure used to describe an input stream. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct StreamRec + public struct FT_StreamRec { /// <summary> /// @@ -103,11 +116,11 @@ /// <summary> /// /// </summary> - public StreamDesc descriptor; + public FT_StreamDesc descriptor; /// <summary> /// /// </summary> - public StreamDesc pathname; + public FT_StreamDesc pathname; /// <summary> /// /// </summary> @@ -131,10 +144,10 @@ } /// <summary> - /// + /// A union type used to store either a long or a pointer. This is used to store a file descriptor or a �FILE*� in an input stream /// </summary> [StructLayout(LayoutKind.Explicit)] - public struct StreamDesc + public struct FT_StreamDesc { /// <summary> /// @@ -149,10 +162,10 @@ } /// <summary> - /// + /// A simple structure used to store a 2D vector; coordinates are of the FT_Pos type. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Vector + public struct FT_Vector { /// <summary> /// @@ -165,10 +178,10 @@ } /// <summary> - /// + /// A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct BBox + public struct FT_BBox { /// <summary> /// @@ -189,10 +202,10 @@ } /// <summary> - /// + /// A structure used to describe a bitmap or pixmap to the raster. Note that we now manage pixmaps of various depths through the �pixel_mode� field. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Bitmap + public struct FT_Bitmap { /// <summary> /// @@ -229,10 +242,10 @@ } /// <summary> - /// + /// This structure is used to describe an outline to the scan-line converter. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Outline + public struct FT_Outline { /// <summary> /// @@ -261,10 +274,10 @@ } /// <summary> - /// + /// A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic B�ziers, as well as �move to� and �close to� operations. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Outline_Funcs + public struct FT_Outline_Funcs { /// <summary> /// @@ -301,10 +314,10 @@ } /// <summary> - /// + /// A structure used to model a single span of gray (or black) pixels when rendering a monochrome or anti-aliased bitmap /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Span + public struct FT_Span { /// <summary> /// @@ -321,10 +334,10 @@ } /// <summary> - /// + /// A structure to hold the arguments used by a raster's render functions /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Raster_Params + public struct FT_Raster_Params { /// <summary> /// @@ -361,19 +374,19 @@ /// <summary> /// /// </summary> - public BBox clip_box; + public FT_BBox clip_box; } /// <summary> - /// + /// A structure used to describe a given raster class to the library. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Raster_Funcs + public struct FT_Raster_Funcs { /// <summary> /// /// </summary> - public Glyph_Format glyph_format; + public FT_Glyph_Format glyph_format; /// <summary> /// /// </summary> @@ -397,10 +410,10 @@ } /// <summary> - /// + /// A simple structure used to store a 2D vector unit vector. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct UnitVector + public struct FT_UnitVector { /// <summary> /// @@ -413,10 +426,12 @@ } /// <summary> - /// + /// A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed float format. The computation performed is: + /// x' = x*xx + y*xy + /// y' = x*yx + y*yy /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Matrix + public struct FT_Matrix { /// <summary> /// @@ -437,10 +452,10 @@ } /// <summary> - /// + /// Read-only binary data represented as a pointer and a length. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Data + public struct FT_Data { /// <summary> /// @@ -453,10 +468,12 @@ } /// <summary> - /// + /// Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object. + /// Most FreeType object contains a �generic� field, of type FT_Generic, which usage is left to client applications and font servers. + /// It can be used to store a pointer to client-specific data, as well as the address of a �finalizer� function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the �finalizer� field). /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Generic + public struct FT_Generic { /// <summary> /// @@ -469,10 +486,10 @@ } /// <summary> - /// + /// A structure used to hold a single list element. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct ListNodeRec + public struct FT_ListNodeRec { /// <summary> /// @@ -489,10 +506,10 @@ } /// <summary> - /// + /// A structure used to hold a simple double-linked list. These are used in many parts of FreeType. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct ListRec + public struct FT_ListRec { /// <summary> /// @@ -505,10 +522,10 @@ } /// <summary> - /// + /// A structure used to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Glyph_Metrics + public struct FT_Glyph_Metrics { /// <summary> /// @@ -545,10 +562,10 @@ } /// <summary> - /// + /// This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the �available_sizes� field of FT_Face. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Bitmap_Size + public struct FT_Bitmap_Size { /// <summary> /// @@ -605,10 +622,10 @@ } /// <summary> - /// + /// FreeType root face class structure. A face object models a typeface in a font file. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct FaceRec + public struct FT_FaceRec { /// <summary> /// @@ -657,11 +674,11 @@ /// <summary> /// /// </summary> - public Generic generic; + public FT_Generic generic; /// <summary> /// /// </summary> - public BBox bbox; + public FT_BBox bbox; /// <summary> /// /// </summary> @@ -721,11 +738,11 @@ /// <summary> /// /// </summary> - public ListRec sizes_list; + public FT_ListRec sizes_list; /// <summary> /// /// </summary> - public Generic autohint; + public FT_Generic autohint; /// <summary> /// /// </summary> @@ -737,10 +754,10 @@ } /// <summary> - /// + /// FreeType root size class structure. A size object models a face object at a given size. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct SizeRec + public struct FT_SizeRec { /// <summary> /// @@ -749,11 +766,11 @@ /// <summary> /// /// </summary> - public Generic generic; + public FT_Generic generic; /// <summary> /// /// </summary> - public Size_Metrics metrics; + public FT_Size_Metrics metrics; /// <summary> /// /// </summary> @@ -761,10 +778,10 @@ } /// <summary> - /// + /// FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct GlyphSlotRec + public struct FT_GlyphSlotRec { /// <summary> /// @@ -786,11 +803,11 @@ /// <summary> /// /// </summary> - public Generic generic; + public FT_Generic generic; /// <summary> /// /// </summary> - public Glyph_Metrics metrics; + public FT_Glyph_Metrics metrics; /// <summary> /// /// </summary> @@ -802,15 +819,15 @@ /// <summary> /// /// </summary> - public Vector advance; + public FT_Vector advance; /// <summary> /// /// </summary> - public Glyph_Format format; + public FT_Glyph_Format format; /// <summary> /// /// </summary> - public Bitmap bitmap; + public FT_Bitmap bitmap; /// <summary> /// /// </summary> @@ -822,7 +839,7 @@ /// <summary> /// /// </summary> - public Outline outline; + public FT_Outline outline; /// <summary> /// /// </summary> @@ -858,10 +875,10 @@ } /// <summary> - /// + /// The base charmap structure. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct CharMapRec + public struct FT_CharMapRec { /// <summary> /// @@ -870,7 +887,7 @@ /// <summary> /// /// </summary> - public Encoding encoding; + public FT_Encoding encoding; /// <summary> /// /// </summary> @@ -898,10 +915,10 @@ } /// <summary> - /// + /// The size metrics structure gives the metrics of a size object. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Size_Metrics + public struct FT_Size_Metrics { /// <summary> /// @@ -954,10 +971,10 @@ } /// <summary> - /// + /// A simple structure used to pass more or less generic parameters to FT_Open_Face. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Parameter + public struct FT_Parameter { /// <summary> /// @@ -970,10 +987,10 @@ } /// <summary> - /// + /// A structure used to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions FT_Open_Face and FT_Attach_Stream. /// </summary> [StructLayout(LayoutKind.Sequential)] - public struct Open_Args + public struct FT_Open_Args { /// <summary> /// @@ -1010,206 +1027,211 @@ } /// <summary> - /// + /// An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future. /// </summary> - public enum Pixel_Mode + public enum FT_Pixel_Mode { /// <summary> /// /// </summary> - PIXEL_MODE_NONE = 0, + FT_PIXEL_MODE_NONE = 0, /// <summary> /// /// </summary> - PIXEL_MODE_MONO, + FT_PIXEL_MODE_MONO, /// <summary> /// /// </summary> - PIXEL_MODE_GRAY, + FT_PIXEL_MODE_GRAY, /// <summary> /// /// </summary> - PIXEL_MODE_GRAY2, + FT_PIXEL_MODE_GRAY2, /// <summary> /// /// </summary> - PIXEL_MODE_GRAY4, + FT_PIXEL_MODE_GRAY4, /// <summary> /// /// </summary> - PIXEL_MODE_LCD, + FT_PIXEL_MODE_LCD, /// <summary> /// /// </summary> - PIXEL_MODE_LCD_V, + FT_PIXEL_MODE_LCD_V, /// <summary> /// /// </summary> - PIXEL_MODE_MAX, + FT_PIXEL_MODE_MAX, } /// <summary> - /// + /// An enumeration type used to describe the format of a given glyph image. Note that this version of FreeType only supports two image formats, even though future font drivers will be able to register their own format. /// </summary> - public enum Glyph_Format + public enum FT_Glyph_Format { /// <summary> /// /// </summary> - GLYPH_FORMAT_NONE = (int)((uint)0 << 24 | (uint)0 << 16 | (uint)0 << 8 | (uint)0), + FT_GLYPH_FORMAT_NONE = (int)((uint)0 << 24 | (uint)0 << 16 | (uint)0 << 8 | (uint)0), /// <summary> /// /// </summary> - GLYPH_FORMAT_COMPOSITE = (int)((uint)'c' << 24 | (uint)'o' << 16 | (uint)'m' << 8 | (uint)'p'), + FT_GLYPH_FORMAT_COMPOSITE = (int)((uint)'c' << 24 | (uint)'o' << 16 | (uint)'m' << 8 | (uint)'p'), /// <summary> /// /// </summary> - GLYPH_FORMAT_BITMAP = (int)((uint)'b' << 24 | (uint)'i' << 16 | (uint)'t' << 8 | (uint)'s'), + FT_GLYPH_FORMAT_BITMAP = (int)((uint)'b' << 24 | (uint)'i' << 16 | (uint)'t' << 8 | (uint)'s'), /// <summary> /// /// </summary> - GLYPH_FORMAT_OUTLINE = (int)((uint)'o' << 24 | (uint)'u' << 16 | (uint)'t' << 8 | (uint)'l'), + FT_GLYPH_FORMAT_OUTLINE = (int)((uint)'o' << 24 | (uint)'u' << 16 | (uint)'t' << 8 | (uint)'l'), /// <summary> /// /// </summary> - GLYPH_FORMAT_PLOTTER = (int)((uint)'p' << 24 | (uint)'l' << 16 | (uint)'o' << 8 | (uint)'t'), + FT_GLYPH_FORMAT_PLOTTER = (int)((uint)'p' << 24 | (uint)'l' << 16 | (uint)'o' << 8 | (uint)'t'), } /// <summary> - /// + /// An enumeration used to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function. + /// note: + /// Despite the name, this enumeration lists specific character repertories (i.e., charsets), and not text encoding methods (e.g., UTF-8, UTF-16, GB2312_EUC, etc.). + /// Because of 32-bit charcodes defined in Unicode (i.e., surrogates), all character codes must be expressed as FT_Longs. + /// Other encodings might be defined in the future. /// </summary> - public enum Encoding + public enum FT_Encoding { /// <summary> /// / /// </summary> - ENCODING_NONE = (int)((uint)0 << 24 | (uint)0 << 16 | (uint)0 << 8 | (uint)0), + FT_ENCODING_NONE = (int)((uint)0 << 24 | (uint)0 << 16 | (uint)0 << 8 | (uint)0), /// <summary> /// /// </summary> - ENCODING_MS_SYMBOL = (int)((uint)'s' << 24 | (uint)'y' << 16 | (uint)'m' << 8 | (uint)'b'), + FT_ENCODING_MS_SYMBOL = (int)((uint)'s' << 24 | (uint)'y' << 16 | (uint)'m' << 8 | (uint)'b'), /// <summary> /// /// </summary> - ENCODING_UNICODE = (int)((uint)'u' << 24 | (uint)'n' << 16 | (uint)'i' << 8 | (uint)'c'), + FT_ENCODING_UNICODE = (int)((uint)'u' << 24 | (uint)'n' << 16 | (uint)'i' << 8 | (uint)'c'), /// <summary> /// /// </summary> - ENCODING_SJIS = (int)((uint)'s' << 24 | (uint)'j' << 16 | (uint)'i' << 8 | (uint)'s'), + FT_ENCODING_SJIS = (int)((uint)'s' << 24 | (uint)'j' << 16 | (uint)'i' << 8 | (uint)'s'), /// <summary> /// /// </summary> - ENCODING_GB2312 = (int)((uint)'g' << 24 | (uint)'b' << 16 | (uint)' ' << 8 | (uint)' '), + FT_ENCODING_GB2312 = (int)((uint)'g' << 24 | (uint)'b' << 16 | (uint)' ' << 8 | (uint)' '), /// <summary> /// /// </summary> - ENCODING_BIG5 = (int)((uint)'b' << 24 | (uint)'i' << 16 | (uint)'g' << 8 | (uint)'5'), + FT_ENCODING_BIG5 = (int)((uint)'b' << 24 | (uint)'i' << 16 | (uint)'g' << 8 | (uint)'5'), /// <summary> /// /// </summary> - ENCODING_WANSUNG = (int)((uint)'w' << 24 | (uint)'a' << 16 | (uint)'n' << 8 | (uint)'s'), + FT_ENCODING_WANSUNG = (int)((uint)'w' << 24 | (uint)'a' << 16 | (uint)'n' << 8 | (uint)'s'), /// <summary> /// /// </summary> - ENCODING_JOHAB = (int)((uint)'j' << 24 | (uint)'o' << 16 | (uint)'h' << 8 | (uint)'a'), + FT_ENCODING_JOHAB = (int)((uint)'j' << 24 | (uint)'o' << 16 | (uint)'h' << 8 | (uint)'a'), /// <summary> /// /// </summary> - ENCODING_MS_SJIS = (int)(Encoding.ENCODING_SJIS), + FT_ENCODING_MS_SJIS = (int)(FT_Encoding.FT_ENCODING_SJIS), /// <summary> /// /// </summary> - ENCODING_MS_GB2312 = (int)(Encoding.ENCODING_GB2312), + FT_ENCODING_MS_GB2312 = (int)(FT_Encoding.FT_ENCODING_GB2312), /// <summary> /// /// </summary> - ENCODING_MS_BIG5 = (int)(Encoding.ENCODING_BIG5), + FT_ENCODING_MS_BIG5 = (int)(FT_Encoding.FT_ENCODING_BIG5), /// <summary> /// /// </summary> - ENCODING_MS_WANSUNG = (int)(Encoding.ENCODING_WANSUNG), + FT_ENCODING_MS_WANSUNG = (int)(FT_Encoding.FT_ENCODING_WANSUNG), /// <summary> /// /// </summary> - ENCODING_MS_JOHAB = (int)(Encoding.ENCODING_JOHAB), + FT_ENCODING_MS_JOHAB = (int)(FT_Encoding.FT_ENCODING_JOHAB), /// <summary> /// /// </summary> - ENCODING_ADOBE_STANDARD = (int)((uint)'A' << 24 | (uint)'D' << 16 | (uint)'O' << 8 | (uint)'B'), + FT_ENCODING_ADOBE_STANDARD = (int)((uint)'A' << 24 | (uint)'D' << 16 | (uint)'O' << 8 | (uint)'B'), /// <summary> /// /// </summary> - ENCODING_ADOBE_EXPERT = (int)((uint)'A' << 24 | (uint)'D' << 16 | (uint)'B' << 8 | (uint)'E'), + FT_ENCODING_ADOBE_EXPERT = (int)((uint)'A' << 24 | (uint)'D' << 16 | (uint)'B' << 8 | (uint)'E'), /// <summary> /// /// </summary> - ENCODING_ADOBE_CUSTOM = (int)((uint)'A' << 24 | (uint)'D' << 16 | (uint)'B' << 8 | (uint)'C'), + FT_ENCODING_ADOBE_CUSTOM = (int)((uint)'A' << 24 | (uint)'D' << 16 | (uint)'B' << 8 | (uint)'C'), /// <summary> /// /// </summary> - ENCODING_ADOBE_LATIN_1 = (int)((uint)'l' << 24 | (uint)'a' << 16 | (uint)'t' << 8 | (uint)'1'), + FT_ENCODING_ADOBE_LATIN_1 = (int)((uint)'l' << 24 | (uint)'a' << 16 | (uint)'t' << 8 | (uint)'1'), /// <summary> /// /// </summary> - ENCODING_OLD_LATIN_2 = (int)((uint)'l' << 24 | (uint)'a' << 16 | (uint)'t' << 8 | (uint)'2'), + FT_ENCODING_OLD_LATIN_2 = (int)((uint)'l' << 24 | (uint)'a' << 16 | (uint)'t' << 8 | (uint)'2'), /// <summary> /// /// </summary> - ENCODING_APPLE_ROMAN = (int)((uint)'a' << 24 | (uint)'r' << 16 | (uint)'m' << 8 | (uint)'n'), + FT_ENCODING_APPLE_ROMAN = (int)((uint)'a' << 24 | (uint)'r' << 16 | (uint)'m' << 8 | (uint)'n'), } /// <summary> - /// + /// An enumeration type that lists the render modes supported by FreeType 2. Each mode corresponds to a specific type of scanline conversion performed on the outline. + /// For bitmap fonts the �bitmap->pixel_mode� field in the FT_GlyphSlotRec structure gives the format of the returned bitmap. /// </summary> - public enum Render_Mode + public enum FT_Render_Mode { /// <summary> /// /// </summary> - RENDER_MODE_NORMAL = 0, + FT_RENDER_MODE_NORMAL = 0, /// <summary> /// /// </summary> - RENDER_MODE_LIGHT, + FT_RENDER_MODE_LIGHT, /// <summary> /// /// </summary> - RENDER_MODE_MONO, + FT_RENDER_MODE_MONO, /// <summary> /// /// </summary> - RENDER_MODE_LCD, + FT_RENDER_MODE_LCD, /// <summary> /// /// </summary> - RENDER_MODE_LCD_V, + FT_RENDER_MODE_LCD_V, /// <summary> /// /// </summary> - RENDER_MODE_MAX, + FT_RENDER_MODE_MAX, } /// <summary> - /// + /// An enumeration used to specify which kerning values to return in FT_Get_Kerning. /// </summary> - public enum Kerning_Mode + public enum FT_Kerning_Mode { /// <summary> /// /// </summary> - KERNING_DEFAULT = 0, + FT_KERNING_DEFAULT = 0, /// <summary> /// /// </summary> - KERNING_UNFITTED, + FT_KERNING_UNFITTED, /// <summary> /// /// </summary> - KERNING_UNSCALED, + FT_KERNING_UNSCALED, } /// <summary> - /// + /// Main FreeType method class. Call FT_Init_FreeType to initialise /// </summary> public class FT { @@ -1540,63 +1562,63 @@ /// <summary> /// /// </summary> - public const int LOAD_CROP_BITMAP = 0x40; + public const int FT_LOAD_CROP_BITMAP = 0x40; /// <summary> /// /// </summary> - public const int LOAD_DEFAULT = 0x0; + public const int FT_LOAD_DEFAULT = 0x0; /// <summary> /// /// </summary> - public const int LOAD_FORCE_AUTOHINT = 0x20; + public const int FT_LOAD_FORCE_AUTOHINT = 0x20; /// <summary> /// /// </summary> - public const int LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 0x200; + public const int FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 0x200; /// <summary> /// /// </summary> - public const int LOAD_IGNORE_TRANSFORM = 0x800; + public const int FT_LOAD_IGNORE_TRANSFORM = 0x800; /// <summary> /// /// </summary> - public const int LOAD_LINEAR_DESIGN = 0x2000; + public const int FT_LOAD_LINEAR_DESIGN = 0x2000; /// <summary> /// /// </summary> - public const int LOAD_MONOCHROME = 0x1000; + public const int FT_LOAD_MONOCHROME = 0x1000; /// <summary> /// /// </summary> - public const int LOAD_NO_BITMAP = 0x8; + public const int FT_LOAD_NO_BITMAP = 0x8; /// <summary> /// /// </summary> - public const int LOAD_NO_HINTING = 0x2; + public const int FT_LOAD_NO_HINTING = 0x2; /// <summary> /// /// </summary> - public const int LOAD_NO_RECURSE = 0x400; + public const int FT_LOAD_NO_RECURSE = 0x400; /// <summary> /// /// </summary> - public const int LOAD_NO_SCALE = 0x1; + public const int FT_LOAD_NO_SCALE = 0x1; /// <summary> /// /// </summary> - public const int LOAD_PEDANTIC = 0x80; + public const int FT_LOAD_PEDANTIC = 0x80; /// <summary> /// /// </summary> - public const int LOAD_RENDER = 0x4; + public const int FT_LOAD_RENDER = 0x4; /// <summary> /// /// </summary> - public const int LOAD_SBITS_ONLY = 0x4000; + public const int FT_LOAD_SBITS_ONLY = 0x4000; /// <summary> /// /// </summary> - public const int LOAD_VERTICAL_LAYOUT = 0x10; + public const int FT_LOAD_VERTICAL_LAYOUT = 0x10; /// <summary> /// /// </summary> @@ -1604,67 +1626,67 @@ /// <summary> /// /// </summary> - public const uint OPEN_DRIVER = 0x8; + public const uint FT_OPEN_DRIVER = 0x8; /// <summary> /// /// </summary> - public const uint OPEN_MEMORY = 0x1; + public const uint FT_OPEN_MEMORY = 0x1; /// <summary> /// /// </summary> - public const uint OPEN_PARAMS = 0x10; + public const uint FT_OPEN_PARAMS = 0x10; /// <summary> /// /// </summary> - public const uint OPEN_PATHNAME = 0x4; + public const uint FT_OPEN_PATHNAME = 0x4; /// <summary> /// /// </summary> - public const uint OPEN_STREAM = 0x2; + public const uint FT_OPEN_STREAM = 0x2; /// <summary> /// /// </summary> - public const uint OUTLINE_EVEN_ODD_FILL = 0x2; + public const uint FT_OUTLINE_EVEN_ODD_FILL = 0x2; /// <summary> /// /// </summary> - public const uint OUTLINE_HIGH_PRECISION = 0x100; + public const uint FT_OUTLINE_HIGH_PRECISION = 0x100; /// <summary> /// /// </summary> - public const uint OUTLINE_IGNORE_DROPOUTS = 0x8; + public const uint FT_OUTLINE_IGNORE_DROPOUTS = 0x8; /// <summary> /// /// </summary> - public const uint OUTLINE_NONE = 0x0; + public const uint FT_OUTLINE_NONE = 0x0; /// <summary> /// /// </summary> - public const uint OUTLINE_OWNER = 0x1; + public const uint FT_OUTLINE_OWNER = 0x1; /// <summary> /// /// </summary> - public const uint OUTLINE_REVERSE_FILL = 0x4; + public const uint FT_OUTLINE_REVERSE_FILL = 0x4; /// <summary> /// /// </summary> - public const uint OUTLINE_SINGLE_PASS = 0x200; + public const uint FT_OUTLINE_SINGLE_PASS = 0x200; /// <summary> /// /// </summary> - public const uint RASTER_FLAG_AA = 0x1; + public const uint FT_RASTER_FLAG_AA = 0x1; /// <summary> /// /// </summary> - public const uint RASTER_FLAG_CLIP = 0x4; + public const uint FT_RASTER_FLAG_CLIP = 0x4; /// <summary> /// /// </summary> - public const uint RASTER_FLAG_DEFAULT = 0x0; + public const uint FT_RASTER_FLAG_DEFAULT = 0x0; /// <summary> /// /// </summary> - public const uint RASTER_FLAG_DIRECT = 0x2; + public const uint FT_RASTER_FLAG_DIRECT = 0x2; /// <summary> /// /// </summary> @@ -2099,305 +2121,333 @@ public const int Err_Missing_Bbx_Field = (int)(0xB6 + 0); /// <summary> - /// + /// Initialize a new FreeType library object. The set of modules that are registered by this function is determined at build time. /// </summary> - /// <param name="alibrary"></param> - /// <returns></returns> + /// <param name="alibrary">A handle to a new library object.</param> + /// <returns>FreeType error code. 0 means success.</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Init_FreeType(out IntPtr /*IntPtr LibraryRec_*/ alibrary); /// <summary> - /// + /// Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH. /// </summary> - /// <param name="library"></param> - /// <param name="amajor"></param> - /// <param name="aminor"></param> - /// <param name="apatch"></param> + /// <param name="library">A source library handle.</param> + /// <param name="amajor">The major version number.</param> + /// <param name="aminor">The minor version number</param> + /// <param name="apatch">The patch version number</param> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern void FT_Library_Version(IntPtr /*LibraryRec_*/ library, [In, Out] int[] amajor, [In, Out] int[] aminor, [In, Out] int[] apatch); /// <summary> - /// + /// Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc. /// </summary> - /// <param name="library"></param> - /// <returns></returns> + /// <param name="library">A handle to the target library object</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Done_FreeType(IntPtr /*LibraryRec_*/ library); /// <summary> - /// + /// This function calls FT_Open_Face to open a font by its pathname. /// </summary> - /// <param name="library"></param> - /// <param name="filepathname"></param> - /// <param name="face_index"></param> - /// <param name="aface"></param> - /// <returns></returns> + /// <param name="library">A handle to the library resource.</param> + /// <param name="filepathname">A path to the font file</param> + /// <param name="face_index">The index of the face within the font. The first face has index 0</param> + /// <param name="aface"> A handle to a new face object. If �face_index� is greater than or equal to zero, it must be non-NULL. See FT_Open_Face for more details.</param> + /// <returns>FreeType error code. 0 means success.</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_New_Face(IntPtr /*LibraryRec_*/ library, string filepathname, int face_index, out IntPtr /*IntPtr FaceRec*/ aface); /// <summary> - /// + /// This function calls FT_Open_Face to open a font which has been loaded into memory. + /// You must not deallocate the memory before calling FT_Done_Face. /// </summary> - /// <param name="library"></param> - /// <param name="file_base"></param> - /// <param name="file_size"></param> - /// <param name="face_index"></param> - /// <param name="aface"></param> - /// <returns></returns> + /// <param name="library">A handle to the library resource</param> + /// <param name="file_base">A pointer to the beginning of the font data</param> + /// <param name="file_size">The size of the memory chunk used by the font data</param> + /// <param name="face_index">The index of the face within the font. The first face has index 0</param> + /// <param name="aface">A handle to a new face object. If �face_index� is greater than or equal to zero, it must be non-NULL. See FT_Open_Face for more details.</param> + /// <returns>FreeType error code. 0 means success.</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_New_Memory_Face(IntPtr /*LibraryRec_*/ library, [In] byte[] file_base, int file_size, int face_index, IntPtr /*IntPtr FaceRec*/ aface); /// <summary> - /// + /// Create a face object from a given resource described by FT_Open_Args. + /// Unlike FreeType 1.x, this function automatically creates a glyph slot for the face object which can be accessed directly through �face->glyph�. + /// FT_Open_Face can be used to quickly check whether the font format of a given font resource is supported by FreeType. If the �face_index� field is negative, the function's return value is 0 if the font format is recognized, or non-zero otherwise; the function returns a more or less empty face handle in �*aface� (if �aface� isn't NULL). The only useful field in this special case is �face->num_faces� which gives the number of faces within the font file. After examination, the returned FT_Face structure should be deallocated with a call to FT_Done_Face. + /// Each new face object created with this function also owns a default FT_Size object, accessible as �face->size�. /// </summary> - /// <param name="library"></param> - /// <param name="args"></param> - /// <param name="face_index"></param> - /// <param name="aface"></param> - /// <returns></returns> + /// <param name="library">A handle to the library resource</param> + /// <param name="args">A pointer to an �FT_Open_Args� structure which must be filled by the caller.</param> + /// <param name="face_index">The index of the face within the font. The first face has index 0</param> + /// <param name="aface">A handle to a new face object. If �face_index� is greater than or equal to zero, it must be non-NULL. See note below</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Open_Face(IntPtr /*LibraryRec_*/ library, Open_Args args, int face_index, IntPtr /*IntPtr FaceRec*/ aface); /// <summary> - /// + /// This function calls FT_Attach_Stream to attach a file. /// </summary> - /// <param name="face"></param> - /// <param name="filepathname"></param> - /// <returns></returns> + /// <param name="face">The target face object.</param> + /// <param name="filepathname">The pathname</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Attach_File(IntPtr /*FaceRec*/ face, string filepathname); /// <summary> - /// + /// �Attach� data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type 1 font to get the kerning values and other metrics /// </summary> - /// <param name="face"></param> - /// <param name="parameters"></param> - /// <returns></returns> + /// <param name="face">The target face object</param> + /// <param name="parameters">A pointer to FT_Open_Args which must be filled by the caller</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Attach_Stream(IntPtr /*FaceRec*/ face, ref Open_Args parameters); /// <summary> - /// + /// Discard a given face object, as well as all of its child slots and sizes. /// </summary> - /// <param name="face"></param> - /// <returns></returns> + /// <param name="face">A handle to a target face object.</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Done_Face(IntPtr /*FaceRec*/ face); /// <summary> - /// + /// This function calls FT_Request_Size to request the nominal size (in points). + /// If either the character width or height is zero, it is set equal to the other value. + /// If either the horizontal or vertical resolution is zero, it is set equal to the other value. + /// A character width or height smaller than 1pt is set to 1pt; if both resolution values are zero, they are set to 72dpi. /// </summary> - /// <param name="face"></param> - /// <param name="char_width"></param> - /// <param name="char_height"></param> - /// <param name="horz_resolution"></param> - /// <param name="vert_resolution"></param> - /// <returns></returns> + /// <param name="face">A handle to a target face object</param> + /// <param name="char_width">The nominal width, in 26.6 fractional points</param> + /// <param name="char_height">The nominal height, in 26.6 fractional points</param> + /// <param name="horz_resolution">The horizontal resolution in dpi</param> + /// <param name="vert_resolution">The vertical resolution in dpi</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Set_Char_Size(IntPtr /*FaceRec*/ face, int char_width, int char_height, uint horz_resolution, uint vert_resolution); /// <summary> - /// + /// This function calls FT_Request_Size to request the nominal size (in pixels). /// </summary> - /// <param name="face"></param> - /// <param name="pixel_width"></param> - /// <param name="pixel_height"></param> - /// <returns></returns> + /// <param name="face">A handle to the target face object.</param> + /// <param name="pixel_width">The nominal width, in pixels.</param> + /// <param name="pixel_height">The nominal height, in pixels</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Set_Pixel_Sizes(IntPtr /*FaceRec*/ face, uint pixel_width, uint pixel_height); /// <summary> - /// + /// A function used to load a single glyph into the glyph slot of a face object. + /// The loaded glyph may be transformed. See FT_Set_Transform for the details. /// </summary> - /// <param name="face"></param> - /// <param name="glyph_index"></param> - /// <param name="load_flags"></param> - /// <returns></returns> + /// <param name="face">A handle to the target face object where the glyph is loaded.</param> + /// <param name="glyph_index">The index of the glyph in the font file. For CID-keyed fonts (either in PS or in CFF format) this argument specifies the CID value.</param> + /// <param name="load_flags">A flag indicating what to load for this glyph. The FT_LOAD_XXX constants can be used to control the glyph loading process (e.g., whether the outline should be scaled, whether to load bitmaps or not, whether to hint the outline, etc).</param> + /// <returns>FreeType error code. 0 means success.</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Load_Glyph(IntPtr /*FaceRec*/ face, uint glyph_index, int load_flags); /// <summary> - /// + /// A function used to load a single glyph into the glyph slot of a face object, according to its character code. + /// This function simply calls FT_Get_Char_Index and FT_Load_Glyph. /// </summary> - /// <param name="face"></param> - /// <param name="char_code"></param> - /// <param name="load_flags"></param> - /// <returns></returns> + /// <param name="face">A handle to a target face object where the glyph is loaded.</param> + /// <param name="char_code">The glyph's character code, according to the current charmap used in the face</param> + /// <param name="load_flags">A flag indicating what to load for this glyph. The FT_LOAD_XXX constants can be used to control the glyph loading process (e.g., whether the outline should be scaled, whether to load bitmaps or not, whether to hint the outline, etc).</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Load_Char(IntPtr /*FaceRec*/ face, uint char_code, int load_flags); /// <summary> - /// + /// A function used to set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph. + /// The transformation is only applied to scalable image formats after the glyph has been loaded. It means that hinting is unaltered by the transformation and is performed on the character size given in the last call to FT_Set_Char_Size or FT_Set_Pixel_Sizes. + /// Note that this also transforms the �face.glyph.advance� field, but not the values in �face.glyph.metrics� /// </summary> - /// <param name="face"></param> - /// <param name="matrix"></param> - /// <param name="delta"></param> + /// <param name="face">A handle to the source face object</param> + /// <param name="matrix">A pointer to the transformation's 2x2 matrix. Use 0 for the identity matrix</param> + /// <param name="delta">A pointer to the translation vector. Use 0 for the null vector</param> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern void FT_Set_Transform(IntPtr /*FaceRec*/ face, ref Matrix matrix, ref Vector delta); /// <summary> - /// + /// Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it /// </summary> - /// <param name="slot"></param> - /// <param name="render_mode"></param> - /// <returns></returns> + /// <param name="slot">A handle to the glyph slot containing the image to convert</param> + /// <param name="render_mode">This is the render mode used to render the glyph image into a bitmap. See FT_Render_Mode for a list of possible values</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Render_Glyph(ref GlyphSlotRec slot, Render_Mode render_mode); /// <summary> - /// + /// Return the kerning vector between two glyphs of a same face /// </summary> - /// <param name="face"></param> - /// <param name="left_glyph"></param> - /// <param name="right_glyph"></param> - /// <param name="kern_mode"></param> - /// <param name="akerning"></param> - /// <returns></returns> + /// <param name="face">A handle to a source face object</param> + /// <param name="left_glyph">The index of the left glyph in the kern pair</param> + /// <param name="right_glyph">The index of the right glyph in the kern pair</param> + /// <param name="kern_mode">See FT_Kerning_Mode for more information. Determines the scale and dimension of the returned kerning vector</param> + /// <param name="akerning">The kerning vector. This is either in font units or in pixels (26.6 format) for scalable formats, and in pixels for fixed-sizes formats</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Get_Kerning(IntPtr /*FaceRec*/ face, uint left_glyph, uint right_glyph, uint kern_mode, out Vector akerning); /// <summary> - /// + /// Retrieve the ASCII name of a given glyph in a face. This only works for those faces where FT_HAS_GLYPH_NAMES(face) returns 1 + /// An error is returned if the face doesn't provide glyph names or if the glyph index is invalid. In all cases of failure, the first byte of �buffer� is set to 0 to indicate an empty name. + /// The glyph name is truncated to fit within the buffer if it is too long. The returned string is always zero-terminated. + /// This function is not compiled within the library if the config macro �FT_CONFIG_OPTION_NO_GLYPH_NAMES� is defined in �include/freetype/config/ftoptions.h� /// </summary> - /// <param name="face"></param> - /// <param name="glyph_index"></param> - /// <param name="buffer"></param> - /// <param name="buffer_max"></param> - /// <returns></returns> + /// <param name="face">A handle to a source face object</param> + /// <param name="glyph_index">The glyph index</param> + /// <param name="buffer">A pointer to a target buffer where the name is copied to</param> + /// <param name="buffer_max">The maximal number of bytes available in the buffer</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Get_Glyph_Name(IntPtr /*FaceRec*/ face, uint glyph_index, IntPtr buffer, uint buffer_max); /// <summary> - /// + /// Retrieve the ASCII Postscript name of a given face, if available. This only works with Postscript and TrueType fonts + /// The returned pointer is owned by the face and is destroyed with it /// </summary> - /// <param name="face"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <returns>A pointer to the face's Postscript name. NULL if unavailable</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern IntPtr /*sbyte*/ FT_Get_Postscript_Name(IntPtr /*FaceRec*/ face); /// <summary> - /// + /// Select a given charmap by its encoding tag (as listed in �freetype.h�). + /// This function returns an error if no charmap in the face corresponds to the encoding queried here. + /// Because many fonts contain more than a single cmap for Unicode encoding, this function has some special code to select the one which covers Unicode best. It is thus preferable to FT_Set_Charmap in this case /// </summary> - /// <param name="face"></param> - /// <param name="encoding"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <param name="encoding">A handle to the selected encoding</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Select_Charmap(IntPtr /*FaceRec*/ face, Encoding encoding); /// <summary> - /// + /// Select a given charmap for character code to glyph index mapping + /// This function returns an error if the charmap is not part of the face (i.e., if it is not listed in the �face->charmaps� table) /// </summary> - /// <param name="face"></param> - /// <param name="charmap"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <param name="charmap">A handle to the selected charmap</param> + /// <returns>FreeType error code. 0 means success</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Set_Charmap(IntPtr /*FaceRec*/ face, ref CharMapRec charmap); /// <summary> - /// + /// Retrieve index of a given charmap /// </summary> - /// <param name="charmap"></param> - /// <returns></returns> + /// <param name="charmap">A handle to a charmap</param> + /// <returns>The index into the array of character maps within the face to which �charmap� belongs</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_Get_Charmap_Index(ref CharMapRec charmap); /// <summary> - /// + /// Return the glyph index of a given character code. This function uses a charmap object to do the mapping + /// If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the �missing glyph�. /// </summary> - /// <param name="face"></param> - /// <param name="charcode"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <param name="charcode">The character code</param> + /// <returns>The glyph index. 0 means �undefined character code�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern uint FT_Get_Char_Index(IntPtr /*FaceRec*/ face, uint charcode); /// <summary> - /// + /// This function is used to return the first character code in the current charmap of a given face. It also returns the corresponding glyph index. + /// You should use this function with FT_Get_Next_Char to be able to parse all character codes available in a given charmap. + /// Note that �agindex� is set to 0 if the charmap is empty. The result itself can be 0 in two cases: if the charmap is empty or when the value 0 is the first valid character code /// </summary> - /// <param name="face"></param> - /// <param name="agindex"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <param name="agindex">Glyph index of first character code. 0 if charmap is empty</param> + /// <returns>The charmap's first character code</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern uint FT_Get_First_Char(IntPtr /*FaceRec*/ face, [In, Out] uint[] agindex); /// <summary> - /// + /// This function is used to return the next character code in the current charmap of a given face following the value �char_code�, as well as the corresponding glyph index. + /// You should use this function with FT_Get_First_Char to walk over all character codes available in a given charmap. See the note for this function for a simple code example. + /// Note that �*agindex� is set to 0 when there are no more codes in the charmap. /// </summary> - /// <param name="face"></param> - /// <param name="char_code"></param> - /// <param name="agindex"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <param name="char_code">The starting character code</param> + /// <param name="agindex">Glyph index of first character code. 0 if charmap is empty</param> + /// <returns>The charmap's next character code</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern uint FT_Get_Next_Char(IntPtr /*FaceRec*/ face, uint char_code, [In, Out] uint[] agindex); /// <summary> - /// + /// Return the glyph index of a given glyph name. This function uses driver specific objects to do the translation /// </summary> - /// <param name="face"></param> - /// <param name="glyph_name"></param> - /// <returns></returns> + /// <param name="face">A handle to the source face object</param> + /// <param name="glyph_name">The glyph name</param> + /// <returns>The glyph index. 0 means �undefined character code�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern uint FT_Get_Name_Index(IntPtr /*FaceRec*/ face, [In, Out] sbyte[] glyph_name); /// <summary> - /// + /// A very simple function used to perform the computation �(a*b)/c� with maximal accuracy (it uses a 64-bit intermediate integer whenever necessary). + /// This function isn't necessarily as fast as some processor specific operations, but is at least completely portable. /// </summary> - /// <param name="a"></param> - /// <param name="b"></param> - /// <param name="c"></param> - /// <returns></returns> + /// <param name="a">The first multiplier</param> + /// <param name="b">The second multiplier</param> + /// <param name="c">The divisor</param> + /// <returns>The result of �(a*b)/c�. This function never traps when trying to divide by zero; it simply returns �MaxInt� or �MinInt� depending on the signs of �a� and �b�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_MulDiv(int a, int b, int c); /// <summary> - /// + /// A very simple function used to perform the computation �(a*b)/0x10000� with maximal accuracy. Most of the time this is used to multiply a given value by a 16.16 fixed float factor + /// This function has been optimized for the case where the absolute value of �a� is less than 2048, and �b� is a 16.16 scaling factor. As this happens mainly when scaling from notional units to fractional pixels in FreeType, it resulted in noticeable speed improvements between versions 2.x and 1.x. + /// As a conclusion, always try to place a 16.16 factor as the second argument of this function; this can make a great difference /// </summary> - /// <param name="a"></param> - /// <param name="b"></param> - /// <returns></returns> + /// <param name="a">The first multiplier</param> + /// <param name="b">The second multiplier. Use a 16.16 factor here whenever possible</param> + /// <returns>The result of �(a*b)/0x10000�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_MulFix(int a, int b); /// <summary> - /// + /// A very simple function used to perform the computation �(a*0x10000)/b� with maximal accuracy. Most of the time, this is used to divide a given value by a 16.16 fixed float factor + /// The optimization for FT_DivFix() is simple: If (a << 16) fits in 32 bits, then the division is computed directly. Otherwise, we use a specialized version of FT_MulDiv /// </summary> - /// <param name="a"></param> - /// <param name="b"></param> - /// <returns></returns> + /// <param name="a">The first multiplier</param> + /// <param name="b">The second multiplier. Use a 16.16 factor here whenever possible</param> + /// <returns>The result of �(a*0x10000)/b�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_DivFix(int a, int b); /// <summary> - /// + /// A very simple function used to round a 16.16 fixed number /// </summary> - /// <param name="a"></param> - /// <returns></returns> + /// <param name="a">The number to be rounded</param> + /// <returns>The result of �(a + 0x8000) & -0x10000�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_RoundFix(int a); - + /// <summary> - /// + /// A very simple function used to compute the ceiling function of a 16.16 fixed number /// </summary> - /// <param name="a"></param> - /// <returns></returns> + /// <param name="a">The number for which the ceiling function is to be computed</param> + /// <returns>The result of �(a + 0x10000 - 1) & -0x10000�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_CeilFix(int a); /// <summary> - /// + /// A very simple function used to compute the floor function of a 16.16 fixed number /// </summary> - /// <param name="a"></param> - /// <returns></returns> + /// <param name="a">The number for which the floor function is to be computed</param> + /// <returns>The result of �a & -0x10000�</returns> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern int FT_FloorFix(int a); /// <summary> - /// + /// Transform a single vector through a 2x2 matrix. + /// The result is undefined if either �vector� or �matrix� is invalid /// </summary> - /// <param name="vec"></param> - /// <param name="matrix"></param> + /// <param name="vec">The target vector to transform</param> + /// <param name="matrix">A pointer to the source 2x2 matrix</param> [DllImport(FT_DLL), SuppressUnmanagedCodeSecurity] public static extern void FT_Vector_Transform(ref Vector vec, ref Matrix matrix); } -} \ No newline at end of file +}
_______________________________________________ Mono-patches maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-patches
