Exemplo n.º 1
0
        public PDFName RegisterFont(Scryber.Drawing.PDFFont font)
        {
            PDFFontResource defn = this.Document.GetFontResource(font, true);

            defn.RegisterUse(this.Resources, this);
            return(defn.Name);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Comares the two font instances and returns true if they are equal
 /// </summary>
 /// <param name="one">The first to compare</param>
 /// <param name="two">The other instance to compare</param>
 /// <returns>True if the instances are comparably equal</returns>
 public static bool Equals(PDFFont one, PDFFont two)
 {
     if (null == one)
     {
         return(null == two);
     }
     else if (null == two)
     {
         return(false);
     }
     else
     {
         return((one.FamilyName == two.FamilyName) && (one.FontStyle == two.FontStyle) && (one.Size == two.Size));
     }
 }
        public void SetCurrentFont(PDFFont font)
        {
            PDFResource rsrc = this.Container.Document.GetResource(PDFResource.FontDefnResourceType, font.FullName, true);

            if (null == rsrc)
            {
                throw new NullReferenceException(String.Format(Errors.FontNotFound, font.FullName));
            }

            PDFName name = this.Container.Register(rsrc);

            this.CurrentFontResource = (PDFFontResource)rsrc;
            this.CurrentFont         = font;

            if (null != this.Writer)
            {
                this.Writer.WriteOpCodeS(PDFOpCode.TxtFont, name, font.Size.RealValue);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Returns true if the font matches this font
 /// </summary>
 /// <param name="font">The font to compare</param>
 /// <returns>Returns true if the font matches this instance</returns>
 public bool Equals(PDFFont font)
 {
     return(Equals(this, font));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new PDFFont based upon the existing font and the provided size adn font style
 /// </summary>
 /// <param name="basefont">The existing PDFFont</param>
 /// <param name="size">the new font size</param>
 /// <param name="style">the new font style</param>
 public PDFFont(PDFFont basefont, PDFUnit size, FontStyle style)
     : this(basefont.Selector, size, style)
 {
     this._familyName = basefont._familyName;
 }