Difference() публичный Метод

public Difference ( Font font ) : Font
font iTextSharp.text.Font
Результат iTextSharp.text.Font
Пример #1
0
        /**
         * Constructs a new RtfPhrase for the RtfDocument with the given Phrase
         *
         * @param doc The RtfDocument this RtfPhrase belongs to
         * @param phrase The Phrase this RtfPhrase is based on
         */
        public RtfPhrase(RtfDocument doc, Phrase phrase) : base(doc)
        {
            if (phrase == null)
            {
                return;
            }

            if (phrase.HasLeading())
            {
                this.lineLeading = (int)(phrase.Leading * TWIPS_FACTOR);
            }
            else
            {
                this.lineLeading = 0;
            }

            ST.RtfFont phraseFont = new ST.RtfFont(null, phrase.Font);
            for (int i = 0; i < phrase.Count; i++)
            {
                IElement chunk = (IElement)phrase[i];
                if (chunk is Chunk)
                {
                    ((Chunk)chunk).Font = phraseFont.Difference(((Chunk)chunk).Font);
                }
                try {
                    IRtfBasicElement[] rtfElements = doc.GetMapper().MapElement(chunk);
                    for (int j = 0; j < rtfElements.Length; j++)
                    {
                        chunks.Add(rtfElements[j]);
                    }
                } catch (DocumentException) {
                }
            }
        }
Пример #2
0
        /**
         * Constructs a new RtfPhrase for the RtfDocument with the given Phrase
         *
         * @param doc The RtfDocument this RtfPhrase belongs to
         * @param phrase The Phrase this RtfPhrase is based on
         */
        public RtfPhrase(RtfDocument doc, Phrase phrase) : base(doc)
        {
            if (phrase == null)
            {
                return;
            }

            if (phrase.LeadingDefined)
            {
                this.lineLeading = (int)(phrase.Leading * TWIPS_FACTOR);
            }
            else
            {
                this.lineLeading = 0;
            }

            ST.RtfFont phraseFont = new ST.RtfFont(null, phrase.Font);
            for (int i = 0; i < phrase.Count; i++)
            {
                IElement chunk = (IElement)phrase[i];
                if (chunk is Chunk)
                {
                    ((Chunk)chunk).Font = phraseFont.Difference(((Chunk)chunk).Font);
                }
                try {
                    chunks.Add(doc.GetMapper().MapElement(chunk));
                } catch (DocumentException) {
                }
            }
        }
Пример #3
0
 /**
 * Constructs a new RtfPhrase for the RtfDocument with the given Phrase
 * 
 * @param doc The RtfDocument this RtfPhrase belongs to
 * @param phrase The Phrase this RtfPhrase is based on
 */
 public RtfPhrase(RtfDocument doc, Phrase phrase) : base(doc) {
     
     if (phrase == null) {
         return;
     }
     
     if (phrase.HasLeading()) {
         this.lineLeading = (int) (phrase.Leading * TWIPS_FACTOR);
     } else {
         this.lineLeading = 0;
     }
     
     ST.RtfFont phraseFont = new ST.RtfFont(null, phrase.Font);
     for (int i = 0; i < phrase.Count; i++) {
         IElement chunk = (IElement) phrase[i];
         if (chunk is Chunk) {
             ((Chunk) chunk).Font = phraseFont.Difference(((Chunk) chunk).Font);
         }
         try {
             IRtfBasicElement[] rtfElements = doc.GetMapper().MapElement(chunk);
             for (int j = 0; j < rtfElements.Length; j++) {
                 chunks.Add(rtfElements[j]);
             }
         } catch (DocumentException) {
         }
     }
 }
Пример #4
0
        /**
        * Constructs a new RtfPhrase for the RtfDocument with the given Phrase
        *
        * @param doc The RtfDocument this RtfPhrase belongs to
        * @param phrase The Phrase this RtfPhrase is based on
        */
        public RtfPhrase(RtfDocument doc, Phrase phrase)
            : base(doc)
        {
            if (phrase == null) {
                return;
            }

            if (phrase.LeadingDefined) {
                this.lineLeading = (int) (phrase.Leading * TWIPS_FACTOR);
            } else {
                this.lineLeading = 0;
            }

            ST.RtfFont phraseFont = new ST.RtfFont(null, phrase.Font);
            for (int i = 0; i < phrase.Count; i++) {
                IElement chunk = (IElement) phrase[i];
                if (chunk is Chunk) {
                    ((Chunk) chunk).Font = phraseFont.Difference(((Chunk) chunk).Font);
                }
                try {
                    chunks.Add(doc.GetMapper().MapElement(chunk));
                } catch (DocumentException) {
                }
            }
        }