Ejemplo n.º 1
0
        public void SetGlyphFromNameDelegate(GlyphFromNameDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_glyph_from_name_func(
                Handle, DelegateProxies.GlyphFromNameProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 2
0
        public void SetVerticalGlyphOriginDelegate(GlyphOriginDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_glyph_v_origin_func(
                Handle, DelegateProxies.GlyphOriginProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 3
0
        public void SetHorizontalGlyphKerningDelegate(GlyphKerningDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_glyph_h_kerning_func(
                Handle, DelegateProxies.GlyphKerningProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 4
0
        public void SetNominalGlyphsDelegate(NominalGlyphsDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_nominal_glyphs_func(
                Handle, DelegateProxies.NominalGlyphsProxy, (void *)ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 5
0
        public void SetVariationGlyphDelegate(VariationGlyphDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_variation_glyph_func(
                Handle, DelegateProxies.VariationGlyphProxy, (void *)ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 6
0
        public void SetGlyphContourPointDelegate(GlyphContourPointDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_glyph_contour_point_func(
                Handle, DelegateProxies.GlyphContourPointProxy, (void *)ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 7
0
        public void SetVerticalFontExtentsDelegate(FontExtentsDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, destroy);

            HarfBuzzApi.hb_font_funcs_set_font_v_extents_func(
                Handle, DelegateProxies.FontExtentsProxy, (void *)ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 8
0
        public void SetComposeDelegate(ComposeDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, new UserDataDelegate(() => this), destroy);

            HarfBuzzApi.hb_unicode_funcs_set_compose_func(Handle, DelegateProxies.ComposeProxy, ctx,
                                                          DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 9
0
        public void SetGeneralCategoryDelegate(GeneralCategoryDelegate del, ReleaseDelegate destroy = null)
        {
            VerifyParameters(del);

            var ctx = DelegateProxies.CreateMulti(del, new UserDataDelegate(() => this), destroy);

            HarfBuzzApi.hb_unicode_funcs_set_general_category_func(Handle, DelegateProxies.GeneralCategoryProxy, ctx,
                                                                   DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 10
0
        public void SetFontFunctions(FontFunctions fontFunctions, object fontData, ReleaseDelegate destroy)
        {
            _ = fontFunctions ?? throw new ArgumentNullException(nameof(fontFunctions));

            var container      = new FontUserData(this, fontData);
            var actualFontData = new UserDataDelegate(() => container);
            var ctx            = DelegateProxies.CreateMulti(actualFontData, destroy);

            HarfBuzzApi.hb_font_set_funcs(Handle, fontFunctions.Handle, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 11
0
        public Face(GetTableDelegate getTable, object context, ReleaseDelegate destroy)
            : this(IntPtr.Zero)
        {
            if (getTable == null)
            {
                throw new ArgumentNullException(nameof(getTable));
            }

            var ctx = DelegateProxies.CreateMulti <GetTableDelegate> ((_, t, __) => getTable.Invoke(this, t, context), context, destroy);

            Handle = HarfBuzzApi.hb_face_create_for_tables(DelegateProxies.GetTableDelegateProxy, ctx, DelegateProxies.ReleaseDelegateProxyForMulti);
        }
Ejemplo n.º 12
0
        public Face(GetTableDelegate getTable, ReleaseDelegate destroy)
            : this(IntPtr.Zero)
        {
            if (getTable == null)
            {
                throw new ArgumentNullException(nameof(getTable));
            }

            var actualUserData = new UserDataDelegate(() => this);

            Handle = HarfBuzzApi.hb_face_create_for_tables(
                DelegateProxies.GetTableDelegateProxy,
                DelegateProxies.CreateMulti(getTable, actualUserData, destroy),
                DelegateProxies.ReleaseDelegateProxyForMulti);
        }