Exemple #1
0
        public virtual int CreateEllipsisTrimmingSign(
            IDWriteTextFormat textFormat,
            out IDWriteInlineObject trimmingSign
            )
        {
            var fp = GetFunctionPointer(20);

            if (m_CreateEllipsisTrimmingSignFunc == null)
            {
                m_CreateEllipsisTrimmingSignFunc = (CreateEllipsisTrimmingSignFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateEllipsisTrimmingSignFunc));
            }
            trimmingSign = new IDWriteInlineObject();
            return(m_CreateEllipsisTrimmingSignFunc(m_ptr, textFormat != null ? textFormat.Ptr : IntPtr.Zero, out trimmingSign.PtrForNew));
        }
Exemple #2
0
        public virtual int CreateTextLayout(
            ref ushort _string,
            uint stringLength,
            IDWriteTextFormat textFormat,
            float maxWidth,
            float maxHeight,
            out IDWriteTextLayout textLayout
            )
        {
            var fp = GetFunctionPointer(18);

            if (m_CreateTextLayoutFunc == null)
            {
                m_CreateTextLayoutFunc = (CreateTextLayoutFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateTextLayoutFunc));
            }
            textLayout = new IDWriteTextLayout();
            return(m_CreateTextLayoutFunc(m_ptr, ref _string, stringLength, textFormat != null ? textFormat.Ptr : IntPtr.Zero, maxWidth, maxHeight, out textLayout.PtrForNew));
        }
        public virtual void DrawText(
            ref ushort _string,
            uint stringLength,
            IDWriteTextFormat textFormat,
            ref System.Numerics.Vector4 layoutRect,
            ID2D1Brush defaultFillBrush,
            D2D1_DRAW_TEXT_OPTIONS options,
            DWRITE_MEASURING_MODE measuringMode
            )
        {
            var fp = GetFunctionPointer(27);

            if (m_DrawTextWFunc == null)
            {
                m_DrawTextWFunc = (DrawTextWFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawTextWFunc));
            }

            m_DrawTextWFunc(m_ptr, ref _string, stringLength, textFormat != null ? textFormat.Ptr : IntPtr.Zero, ref layoutRect, defaultFillBrush != null ? defaultFillBrush.Ptr : IntPtr.Zero, options, measuringMode);
        }
Exemple #4
0
        public virtual int CreateTextFormat(
            ref ushort fontFamilyName,
            IDWriteFontCollection fontCollection,
            DWRITE_FONT_WEIGHT fontWeight,
            DWRITE_FONT_STYLE fontStyle,
            DWRITE_FONT_STRETCH fontStretch,
            float fontSize,
            ref ushort localeName,
            out IDWriteTextFormat textFormat
            )
        {
            var fp = GetFunctionPointer(15);

            if (m_CreateTextFormatFunc == null)
            {
                m_CreateTextFormatFunc = (CreateTextFormatFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateTextFormatFunc));
            }
            textFormat = new IDWriteTextFormat();
            return(m_CreateTextFormatFunc(m_ptr, ref fontFamilyName, fontCollection != null ? fontCollection.Ptr : IntPtr.Zero, fontWeight, fontStyle, fontStretch, fontSize, ref localeName, out textFormat.PtrForNew));
        }
Exemple #5
0
        public virtual int CreateGdiCompatibleTextLayout(
            ref ushort _string,
            uint stringLength,
            IDWriteTextFormat textFormat,
            float layoutWidth,
            float layoutHeight,
            float pixelsPerDip,
            ref DWRITE_MATRIX transform,
            int useGdiNatural,
            out IDWriteTextLayout textLayout
            )
        {
            var fp = GetFunctionPointer(19);

            if (m_CreateGdiCompatibleTextLayoutFunc == null)
            {
                m_CreateGdiCompatibleTextLayoutFunc = (CreateGdiCompatibleTextLayoutFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateGdiCompatibleTextLayoutFunc));
            }
            textLayout = new IDWriteTextLayout();
            return(m_CreateGdiCompatibleTextLayoutFunc(m_ptr, ref _string, stringLength, textFormat != null ? textFormat.Ptr : IntPtr.Zero, layoutWidth, layoutHeight, pixelsPerDip, ref transform, useGdiNatural, out textLayout.PtrForNew));
        }