Ejemplo n.º 1
0
        public PdfScript(PdfXRef AXref, string AName) : base(AXref, AName)
        {
            PdfArray      FWidths;
            PdfDictionary FFont;
            PdfDictionary FFontDescriptor;

            FFont = new PdfDictionary(AXref);
            AXref.AddObject(FFont);

            AddStrElements(FFont, Generic._String_Table());
            AddIntElements(FFont, Generic._Int_Table());
            FFont.AddItem("BaseFont", new PdfName("Script"));

            FFontDescriptor = new PdfDictionary(AXref);
            AXref.AddObject(FFontDescriptor);

            AddStrElements(FFontDescriptor, Generic._Script_String_Table());
            AddIntElements(FFontDescriptor, Generic._Script_Int_Table());
            FFontDescriptor.AddItem("FontBBox", new PdfArray(AXref, SCRIPT_BBOX));
            FFont.AddItem("FontDescriptor", FFontDescriptor);

            FWidths = new PdfArray(AXref, SCRIPT_W_ARRAY);
            FFont.AddItem("Widths", FWidths);
            SetData(FFont);
        }
Ejemplo n.º 2
0
//				internal bool XT
//				{
//					get
//					{
//						return (this.PR != null);
//					}
//				}
//
//				internal bool XU
//				{
//					get
//					{
//						if (this.PR != null)
//						{
//							return this.PR.NA;
//						}
//						return false;
//					}
//					set
//					{
//						if (this.PR != null)
//						{
//							this.PR.NA = 09F;
//						}
//					}
//				}

//				internal bool XV
//				{
//					get
//					{
//						if (((this.PK != null) && this.PK.Bold) && ((this.PR != null) && this.PR.NA))
//						{
//							return !this.PR.XA;
//						}
//						return false;
//					}
//				}
//
//				internal bool XW
//				{
//					get
//					{
//						if (((this.PK != null) && this.PK.Italic) && ((this.PR != null) && this.PR.NA))
//						{
//							return !this.PR.XB;
//						}
//						return false;
//					}
//				}
        #endregion
        #region Constructors
        public PdfTrueTypeFont(PdfXRef AXref, string AName) : base(AXref, AName)
        {
            PdfDictionary FFont;

            PK = fntReturnFont(AName);
            if (PK != null)
            {
                vAdjustFontSize(PK);
                PdfDictionary dicFontDescriptor = dicCreateFontDescriptor(AXref, AName, PK);
                FFont = new PdfDictionary(AXref);
                AXref.AddObject(FFont);
                FFont.AddItem("Type", new PdfName("Font"));
                FFont.AddItem("Subtype", new PdfName("TrueType"));
                FFont.AddItem("BaseFont", new PdfName(AName));
                FFont.AddInternalItem("FontDescriptor", dicFontDescriptor);
                FFont.AddItem("Encoding", new PdfName("WinAnsiEncoding"));
                FFont.AddItem("FirstChar", new PdfNumber(FFirstChar));
                FFont.AddItem("LastChar", new PdfNumber(FLastChar));

                PdfArray faWidths = new PdfArray(AXref, ARIAL_W_ARRAY);
                AXref.AddObject(faWidths);
                FFont.AddInternalItem("Widths", faWidths);

                SetData(FFont);
            }
        }
Ejemplo n.º 3
0
        public PdfTimesRoman(PdfXRef AXref, string AName) : base(AXref, AName)
        {
            PdfArray      FWidths;
            PdfDictionary FFont;

            FFont = new PdfDictionary(AXref);
            AXref.AddObject(FFont);

            AddStrElements(FFont, Generic._String_Table());
            AddIntElements(FFont, Generic._Int_Table());
            FFont.AddItem("BaseFont", new PdfName("Times-Roman"));

            FWidths = new PdfArray(AXref, TIMES_ROMAN_W_ARRAY);
            FFont.AddInternalItem("Widths", FWidths);
            SetData(FFont);
        }
Ejemplo n.º 4
0
        public PdfFixedWidthItalic(PdfXRef AXref, string AName) : base(AXref, AName)
        {
            PdfArray      FWidths;
            PdfDictionary FFont;

            FFont = new PdfDictionary(AXref);
            AXref.AddObject(FFont);

            AddStrElements(FFont, Generic._String_Table());
            AddIntElements(FFont, Generic._Int_Table());
            FFont.AddItem("BaseFont", new PdfName("Courier-Oblique"));

            FWidths = new PdfArray(AXref, FIXED_WIDTH_ITALIC_W_ARRAY);
            FFont.AddInternalItem("Widths", FWidths);
            SetData(FFont);
        }
Ejemplo n.º 5
0
        public PdfArial(PdfXRef AXref, string AName) : base(AXref, AName)
        {
            PdfArray      FWidths;
            PdfDictionary FFont;

            FFont = new PdfDictionary(AXref);
            AXref.AddObject(FFont);

            AddStrElements(FFont, Generic._String_Table());
            AddIntElements(FFont, Generic._Int_Table());
            FFont.AddItem("BaseFont", new PdfName("Helvetica"));

            FWidths = new PdfArray(AXref, ARIAL_W_ARRAY);
            FFont.AddInternalItem("Widths", FWidths);
            SetData(FFont);
        }
Ejemplo n.º 6
0
        private PdfDictionary dicCreateFontDescriptor(PdfXRef AXref, string AName, System.Drawing.Font fntFont)
        {
            PdfDictionary dicFontDescriptor = new PdfDictionary(AXref);

            AXref.AddObject(dicFontDescriptor);
            dicFontDescriptor.AddItem("Type", new PdfName("FontDescriptor"));
            dicFontDescriptor.AddItem("FontName", new PdfName(AName));
            dicFontDescriptor.AddItem("Flags", new PdfNumber(this.nFlag()));
            dicFontDescriptor.AddItem("FontBBox", new PdfArray(AXref, this.aintFontBox()));
            dicFontDescriptor.AddItem("MissingWidth", new PdfNumber((long)this.PS.QS.PY));
            dicFontDescriptor.AddItem("StemV", new PdfNumber(((long)(this.PK.Bold ? 144 : 72))));
            dicFontDescriptor.AddItem("StemH", new PdfNumber(((long)(this.PK.Bold ? 144 : 72))));
            dicFontDescriptor.AddItem("ItalicAngle", new PdfNumber(((long)(this.PK.Italic ? (this.PS.QZ / 10) : 0))));
            dicFontDescriptor.AddItem("CapHeight", new PdfNumber((long)this.PS.R4));
            dicFontDescriptor.AddItem("XHeight", new PdfNumber((long)this.PS.R5));
            dicFontDescriptor.AddItem("Ascent", new PdfNumber((long)this.PS.R1));
            dicFontDescriptor.AddItem("Descent", new PdfNumber((long)this.PS.R2));
            dicFontDescriptor.AddItem("Leading", new PdfNumber((long)this.PS.QS.PX));
            dicFontDescriptor.AddItem("MaxWidth", new PdfNumber((long)this.PS.QS.PZ));
            dicFontDescriptor.AddItem("AvgWidth", new PdfNumber((long)this.PS.QS.PY));
            return(dicFontDescriptor);
        }