コード例 #1
0
 internal TextAnalyzerSource(char *text, uint length, string culture,
                             IDWriteFactory factory, bool isRightToLeft, string numberCulture,
                             bool ignoreUserOverride, uint numberSubstitutionMethod)
 {
     pText              = text;
     TextLength         = length;
     NumberSubstitution = factory.CreateNumberSubstitution(numberSubstitutionMethod, numberCulture, ignoreUserOverride);
     PinnedLocaleName   = GCHandle.Alloc(culture, GCHandleType.Pinned);
     ReadingDirection   = isRightToLeft ? DWriteReadingDirection.RightToLeft : DWriteReadingDirection.LeftToRight;
 }
コード例 #2
0
        internal TextAnalyzerSource(char *text, uint length, string culture,
                                    IDWriteFactory factory, bool isRightToLeft, string numberCulture,
                                    bool ignoreUserOverride, uint numberSubstitutionMethod)
        {
            var segment = new TextSegment();

            segment.ptr        = new IntPtr(text);
            segment.start      = 0;
            segment.end        = length;
            TextSegments       = new TextSegment[] { segment };
            TextLength         = length;
            NumberSubstitution = factory.CreateNumberSubstitution(numberSubstitutionMethod, numberCulture, ignoreUserOverride);
            PinnedLocaleName   = GCHandle.Alloc(culture, GCHandleType.Pinned);
            ReadingDirection   = isRightToLeft ? DWriteReadingDirection.RightToLeft : DWriteReadingDirection.LeftToRight;
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DWriteUnderline"/> struct.
 /// </summary>
 /// <param name="width">Width of the underline, measured parallel to the baseline.</param>
 /// <param name="thickness">Thickness of the underline, measured perpendicular to the baseline.</param>
 /// <param name="offset">Offset of the underline from the baseline.</param>
 /// <param name="runHeight">Height of the tallest run where the underline applies.</param>
 /// <param name="readingDirection">Reading direction of the text associated with the underline.</param>
 /// <param name="flowDirection">Flow direction of the text associated with the underline.</param>
 /// <param name="localeName">Locale of the text the underline is being drawn under.</param>
 /// <param name="measuringMode">The measuring mode.</param>
 public DWriteUnderline(
     float width,
     float thickness,
     float offset,
     float runHeight,
     DWriteReadingDirection readingDirection,
     DWriteFlowDirection flowDirection,
     string localeName,
     DWriteMeasuringMode measuringMode)
 {
     this.width            = width;
     this.thickness        = thickness;
     this.offset           = offset;
     this.runHeight        = runHeight;
     this.readingDirection = readingDirection;
     this.flowDirection    = flowDirection;
     this.localeName       = localeName;
     this.measuringMode    = measuringMode;
 }
コード例 #4
0
        internal TextAnalyzerSource(IntPtr[] text_ptrs, uint[] lengths, string culture,
                                    IDWriteFactory factory, bool isRightToLeft, string numberCulture,
                                    bool ignoreUserOverride, uint numberSubstitutionMethod)
        {
            TextSegments = new TextSegment[text_ptrs.Length];
            uint pos = 0;

            for (int i = 0; i < text_ptrs.Length; i++)
            {
                var segment = new TextSegment();
                segment.ptr     = text_ptrs[i];
                segment.start   = pos;
                pos            += lengths[i];
                segment.end     = pos;
                TextSegments[i] = segment;
            }
            TextLength         = pos;
            NumberSubstitution = factory.CreateNumberSubstitution(numberSubstitutionMethod, numberCulture, ignoreUserOverride);
            PinnedLocaleName   = GCHandle.Alloc(culture, GCHandleType.Pinned);
            ReadingDirection   = isRightToLeft ? DWriteReadingDirection.RightToLeft : DWriteReadingDirection.LeftToRight;
        }