예제 #1
0
        //
        // .ctor
        //

        #region private PDFFontResource(PDFFontDefinition defn, string resourceName)

        private PDFFontResource(PDFFontDefinition defn, PDFFontWidths widths, string resourceName)
            : base(PDFObjectTypes.FontResource)
        {
            if (null == defn)
            {
                throw new ArgumentNullException("defn");
            }

            _defn     = defn;
            _widths   = widths;
            _fontName = defn.FullName;

            this.Name = (Native.PDFName)resourceName;
        }
예제 #2
0
        //
        // static methods
        //

        #region public static PDFFontResource Load(PDFFontDefinition defn, string resourceName)

        /// <summary>
        /// Loads a PDFFontResource based on the definition and name
        /// </summary>
        /// <param name="defn"></param>
        /// <param name="resourceName"></param>
        /// <returns></returns>
        public static PDFFontResource Load(PDFFontDefinition defn, string resourceName)
        {
            if (null == defn)
            {
                throw new ArgumentNullException("defn");
            }

            if (string.IsNullOrEmpty(resourceName))
            {
                throw new ArgumentNullException("resourceName");
            }

            PDFFontWidths   widths = defn.GetWidths();
            PDFFontResource rsrc   = new PDFFontResource(defn, widths, resourceName);

            return(rsrc);
        }