Exemplo n.º 1
0
        public void SetFontFunctions(FontFunctions fontFunctions, object fontData, ReleaseDelegate destroy)
        {
            _ = fontFunctions ?? throw new ArgumentNullException(nameof(fontFunctions));

            var container = new FontUserData(this, fontData);
            var ctx       = DelegateProxies.CreateMultiUserData(destroy, container);

            HarfBuzzApi.hb_font_set_funcs(Handle, fontFunctions.Handle, (void *)ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Exemplo n.º 2
0
        public void SetGeneralCategoryDelegate(GeneralCategoryDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMultiUserData(del, destroy, this);

            HarfBuzzApi.hb_unicode_funcs_set_general_category_func(
                Handle, DelegateProxies.GeneralCategoryProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Exemplo n.º 3
0
        public void SetCombiningClassDelegate(CombiningClassDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMultiUserData(del, destroy, this);

            HarfBuzzApi.hb_unicode_funcs_set_combining_class_func(
                Handle, DelegateProxies.CombiningClassProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Exemplo n.º 4
0
        public void SetDecomposeDelegate(DecomposeDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMultiUserData(del, destroy, this);

            HarfBuzzApi.hb_unicode_funcs_set_decompose_func(
                Handle, DelegateProxies.DecomposeProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Exemplo n.º 5
0
        public void SetScriptDelegate(ScriptDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMultiUserData(del, destroy, this);

            HarfBuzzApi.hb_unicode_funcs_set_script_func(
                Handle, DelegateProxies.ScriptProxy, (void *)ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Exemplo n.º 6
0
        public Face(GetTableDelegate getTable, ReleaseDelegate destroy)
            : this(IntPtr.Zero)
        {
            if (getTable == null)
            {
                throw new ArgumentNullException(nameof(getTable));
            }

            Handle = HarfBuzzApi.hb_face_create_for_tables(
                DelegateProxies.GetTableDelegateProxy,
                DelegateProxies.CreateMultiUserData(getTable, destroy, this),
                DelegateProxies.ReleaseDelegateProxyForMulti);
        }