Example #1
0
		/**
		 * create a set of attributes.
		 * this calculates all of the glyph metrics from the graphic device.
		 */
		public StretchyGlyphAttributes(IFormattingContext context, IFontHandle fontHandle, ref StretchyGlyphIndices indices)
		{
			orientation = indices.Orientation;

			if(indices.SimpleIndices != null)
			{
				simpleGlyphs = new GlyphAttributes[indices.SimpleIndices.Length];
				for(int i = 0; i < simpleGlyphs.Length; i++)
				{
					simpleGlyphs[i] = new GlyphAttributes(context, fontHandle, 
						indices.SimpleIndices[i], GlyphAttributes.FudgeNone);
				}
			} 
			else
			{
				simpleGlyphs = null;
			}

			if(indices.CompoundIndices != null)
			{
				compoundGlyphs = new GlyphAttributes[indices.CompoundIndices.Length];
				for(int i = 0; i < compoundGlyphs.Length; i++)
				{
					// TODO deal with horizontal glyphs
					compoundGlyphs[i] = new GlyphAttributes(context, fontHandle, 
						indices.CompoundIndices[i], 
						i == StretchyGlyphIndices.Filler ? GlyphAttributes.FudgeHeight : GlyphAttributes.FudgeNone);
				}
			}
			else
			{
				compoundGlyphs = null;
			}
		}
Example #2
0
        /**
         * create a set of attributes.
         * this calculates all of the glyph metrics from the graphic device.
         */
        public StretchyGlyphAttributes(IFormattingContext context, IFontHandle fontHandle, ref StretchyGlyphIndices indices)
        {
            orientation = indices.Orientation;

            if (indices.SimpleIndices != null)
            {
                simpleGlyphs = new GlyphAttributes[indices.SimpleIndices.Length];
                for (int i = 0; i < simpleGlyphs.Length; i++)
                {
                    simpleGlyphs[i] = new GlyphAttributes(context, fontHandle,
                                                          indices.SimpleIndices[i], GlyphAttributes.FudgeNone);
                }
            }
            else
            {
                simpleGlyphs = null;
            }

            if (indices.CompoundIndices != null)
            {
                compoundGlyphs = new GlyphAttributes[indices.CompoundIndices.Length];
                for (int i = 0; i < compoundGlyphs.Length; i++)
                {
                    // TODO deal with horizontal glyphs
                    compoundGlyphs[i] = new GlyphAttributes(context, fontHandle,
                                                            indices.CompoundIndices[i],
                                                            i == StretchyGlyphIndices.Filler ? GlyphAttributes.FudgeHeight : GlyphAttributes.FudgeNone);
                }
            }
            else
            {
                compoundGlyphs = null;
            }
        }
Example #3
0
		public GlyphArea(IFontHandle fontHandle, ref GlyphAttributes attributes)
		{
			this.font = fontHandle;
			this.leftEdge = attributes.Left;
			this.rightEdge = attributes.Right;
			this.box = attributes.Box;
			this.index = (ushort)attributes.Index;
		}