예제 #1
0
        public static void FT_Error_To_Exception(Constants.FT_Error err)
        {
            if (err == Constants.FT_Error.None)
            {
                return;
            }

            switch (err)
            {
            case Constants.FT_Error.Array_Too_Large:
            case Constants.FT_Error.Bad_Argument:
            {
                throw new ArgumentException(err.ToString());
            }

            case Constants.FT_Error.Bbx_Too_Big:
            case Constants.FT_Error.Cannot_Open_Resource:
            case Constants.FT_Error.Cannot_Open_Stream:
            case Constants.FT_Error.Cannot_Render_Glyph:
            case Constants.FT_Error.CMap_Table_Missing:
            default:
            {
                throw new Exception(err.ToString());
            }
            }
        }
예제 #2
0
        public static Constants.FT_Error FT_Set_Pixel_Sizes(IntPtr hFace, uint pixel_width, uint pixel_height)
        {
            Constants.FT_Error err = Constants.FT_Error.None;
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.MacOSX:
            case PlatformID.Unix:
            {
                err = Linux.Methods.FT_Set_Pixel_Sizes(hFace, pixel_width, pixel_height);
                break;
            }

            default:
            {
                throw new PlatformNotSupportedException();
            }
            }
            FT_Error_To_Exception(err);
            return(err);
        }
예제 #3
0
        public static Constants.FT_Error FT_Load_Char(IntPtr face, ulong char_code, Constants.FT_Load_Flags load_flags)
        {
            Constants.FT_Error err = Constants.FT_Error.None;
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.MacOSX:
            case PlatformID.Unix:
            {
                err = Linux.Methods.FT_Load_Char(face, char_code, load_flags);
                break;
            }

            default:
            {
                throw new PlatformNotSupportedException();
            }
            }
            FT_Error_To_Exception(err);
            return(err);
        }
예제 #4
0
        public static Constants.FT_Error FT_New_Face(IntPtr hFreeType, string filename, int faceIndex, ref IntPtr face)
        {
            Constants.FT_Error err = Constants.FT_Error.None;
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.MacOSX:
            case PlatformID.Unix:
            {
                err = Linux.Methods.FT_New_Face(hFreeType, filename, faceIndex, ref face);
                break;
            }

            default:
            {
                throw new PlatformNotSupportedException();
            }
            }
            FT_Error_To_Exception(err);
            return(err);
        }
예제 #5
0
        public static Constants.FT_Error FT_Init_FreeType(ref IntPtr /*FT_Library*/ alibrary)
        {
            Constants.FT_Error err = Constants.FT_Error.None;
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.MacOSX:
            case PlatformID.Unix:
            {
                err = Linux.Methods.FT_Init_FreeType(ref alibrary);
                break;
            }

            default:
            {
                throw new PlatformNotSupportedException();
            }
            }
            FT_Error_To_Exception(err);
            return(err);
        }
예제 #6
0
        public static Constants.FT_Error FT_Done_Face(IntPtr /*FT_Face*/ hFace)
        {
            Constants.FT_Error err = Constants.FT_Error.None;
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.MacOSX:
            case PlatformID.Unix:
            {
                err = Linux.Methods.FT_Done_Face(hFace);
                break;
            }

            default:
            {
                throw new PlatformNotSupportedException();
            }
            }
            FT_Error_To_Exception(err);
            return(err);
        }