示例#1
0
        public override bool Equals(object o)
        {
            ShapeTypeface t = o as ShapeTypeface;

            if (t == null)
            {
                return(false);
            }

            if (_deviceFont == null)
            {
                if (t._deviceFont != null)
                {
                    return(false);
                }
            }
            else
            {
                if (t._deviceFont == null || t._deviceFont.Name != _deviceFont.Name)
                {
                    return(false);
                }
            }

            return(_glyphTypeface.Equals(t._glyphTypeface));
        }
示例#2
0
 internal ScaledShapeTypeface(
     GlyphTypeface glyphTypeface,
     IDeviceFont deviceFont,
     double scaleInEm,
     bool nullShape
     )
 {
     _shapeTypeface = new ShapeTypeface(glyphTypeface, deviceFont);
     _scaleInEm     = scaleInEm;
     _nullShape     = nullShape;
 }
示例#3
0
        internal void GetShapeableText(
            Typeface typeface,
            CharacterBufferReference characterBufferReference,
            int stringLength,
            TextRunProperties textRunProperties,
            CultureInfo digitCulture,
            bool isRightToLeftParagraph,
            IList <TextShapeableSymbols> shapeableList,
            IShapeableTextCollector collector,
            TextFormattingMode textFormattingMode
            )
        {
            if (!typeface.Symbol)
            {
                Lookup(typeface).GetShapeableText(
                    characterBufferReference,
                    stringLength,
                    textRunProperties,
                    digitCulture,
                    isRightToLeftParagraph,
                    shapeableList,
                    collector,
                    textFormattingMode
                    );
            }
            else
            {
                // It's a non-Unicode ("symbol") font, where code points have non-standard meanings. We
                // therefore want to bypass the usual itemization and font linking. Instead, just map
                // everything to the default script and first GlyphTypeface.

                ShapeTypeface shapeTypeface = new ShapeTypeface(
                    typeface.TryGetGlyphTypeface(),
                    null // device font
                    );

                collector.Add(
                    shapeableList,
                    new CharacterBufferRange(characterBufferReference, stringLength),
                    textRunProperties,
                    new MS.Internal.Text.TextInterface.ItemProps(),
                    shapeTypeface,
                    1.0,   // scale in Em
                    false, // null shape
                    textFormattingMode
                    );
            }
        }
示例#4
0
        internal void GetShapeableText(
            Typeface                    typeface, 
            CharacterBufferReference    characterBufferReference,
            int                         stringLength,
            TextRunProperties           textRunProperties,
            CultureInfo                 digitCulture, 
            bool                        isRightToLeftParagraph,
            IList<TextShapeableSymbols> shapeableList, 
            IShapeableTextCollector     collector, 
            TextFormattingMode              textFormattingMode
            ) 
        {
            if (!typeface.Symbol)
            {
                Lookup(typeface).GetShapeableText( 
                    characterBufferReference,
                    stringLength, 
                    textRunProperties, 
                    digitCulture,
                    isRightToLeftParagraph, 
                    shapeableList,
                    collector,
                    textFormattingMode
                    ); 
            }
            else 
            { 
                // It's a non-Unicode ("symbol") font, where code points have non-standard meanings. We
                // therefore want to bypass the usual itemization and font linking. Instead, just map 
                // everything to the default script and first GlyphTypeface.

                ShapeTypeface shapeTypeface = new ShapeTypeface(
                    typeface.TryGetGlyphTypeface(), 
                    null // device font
                    ); 
 
                collector.Add(
                    shapeableList, 
                    new CharacterBufferRange(characterBufferReference, stringLength),
                    textRunProperties,
                    new MS.Internal.Text.TextInterface.ItemProps(),
                    shapeTypeface, 
                    1.0,   // scale in Em
                    false,  // null shape 
                    textFormattingMode 
                    );
            } 
        }
 /// <summary>
 /// Construct a shapeable characters object
 /// </summary>
 /// <remarks>
 /// The shapeTypeface parameter can be null if and only if CheckFastPathNominalGlyphs
 /// has previously returned true.
 /// </remarks>
 internal TextShapeableCharacters(
     CharacterBufferRange    characterRange,
     TextRunProperties       properties,
     double                  emSize,
     ItemProps               textItem,
     ShapeTypeface           shapeTypeface,
     bool                    nullShape,
     TextFormattingMode      textFormattingMode,
     bool isSideways
     )
 {
     _isSideways = isSideways;
     _textFormattingMode = textFormattingMode;
     _characterBufferRange = characterRange;
     _properties = properties;
     _emSize = emSize;
     _textItem = textItem;
     _shapeTypeface = shapeTypeface;
     _nullShape = nullShape;
 }
示例#6
0
        /// <summary>
        /// Add shapeable text object to the list
        /// </summary>
        void IShapeableTextCollector.Add(
            IList<TextShapeableSymbols>  shapeables,
            CharacterBufferRange         characterBufferRange,
            TextRunProperties            textRunProperties,
            MS.Internal.Text.TextInterface.ItemProps textItem,
            ShapeTypeface                shapeTypeface,
            double                       emScale,
            bool                         nullShape,
            TextFormattingMode               textFormattingMode
            )
        {
            Debug.Assert(shapeables != null);

            shapeables.Add(
                new TextShapeableCharacters(
                    characterBufferRange,
                    textRunProperties,
                    textRunProperties.FontRenderingEmSize * emScale,
                    textItem,
                    shapeTypeface,
                    nullShape,
                    textFormattingMode,
                    false
                    )
                );
        }
示例#7
0
 internal ScaledShapeTypeface(
     GlyphTypeface           glyphTypeface,
     IDeviceFont             deviceFont,
     double                  scaleInEm,
     bool                    nullShape
     )
 {
     _shapeTypeface = new ShapeTypeface(glyphTypeface, deviceFont);
     _scaleInEm = scaleInEm;
     _nullShape = nullShape;
 }