Exemplo n.º 1
0
        /// <summary>
        /// Creates a new FlexCelPdfExport instance.
        /// </summary>
        public FlexCelPdfExport()
        {
            FCompress = true;
            FRenderer = new FlexCelRender();
            FRenderer.ReverseRightToLeftStrings = true;
            FPrintRange = new TXlsCellRange(0, 0, 0, 0);
            FProperties = new TPdfProperties();
            PageSize    = null;
            FProgress   = new FlexCelPdfExportProgress();

            FFontEmbed     = TFontEmbed.None;
            FFontSubset    = TFontSubset.Subset;
            FFontMapping   = TFontMapping.ReplaceStandardFonts;
            FFallbackFonts = "Arial Unicode MS";
        }
Exemplo n.º 2
0
 internal TPdfFont GetFont(TFontMapping Mapping, Font aFont, string s,
                           TFontEmbed aEmbed, TFontSubset aSubset, bool aUseKerning)
 {
     return(Resources.GetFont(Mapping, aFont, s, aEmbed, aSubset, aUseKerning));
 }
Exemplo n.º 3
0
 internal TPdfFont SelectFont(TPdfStream DataStream, TFontMapping Mapping, Font aFont, string s,
                              TFontEmbed aEmbed, TFontSubset aSubSet, bool aUseKerning, ref string LastFont)
 {
     return(Resources.SelectFont(DataStream, Mapping, aFont, s, aEmbed, aSubSet, aUseKerning, ref LastFont));
 }
Exemplo n.º 4
0
        internal static TPdfFont CreateInstance(TFontMapping Mapping, Font aFont, bool aUnicode, int aId, TFontEmbed aEmbed, TFontSubset aSubset, bool aCompress, bool aUseKerning,
                                                TFontEvents FontEvents, TPdfEmbeddedFontList EmbeddedFontList, TPdfResources aResources)
        {
            if (!aUnicode &&
                (Mapping == TFontMapping.ReplaceAllFonts || (Mapping == TFontMapping.ReplaceStandardFonts && IsStandardFont(aFont.Name)))
                )
            {
                return(new TPdfInternalFont(aFont, aId, aUseKerning, aResources));
            }

            FontStyle        AdditionalStyle;
            TPdfEmbeddedFont EmbeddedData = EmbeddedFontList.Add(aFont, FontEvents, aSubset == TFontSubset.Subset, aUseKerning, out AdditionalStyle);

            if (AdditionalStyle != FontStyle.Regular)
            {
                if (FlexCelTrace.HasListeners)
                {
                    FlexCelTrace.Write(new TPdfFauxBoldOrItalicsError(FlxMessages.GetString(FlxErr.ErrFauxBoldOrItalic, aFont.Name, GetAdditionalStyleName(AdditionalStyle)), aFont.Name, AdditionalStyle));
                }
            }

            if (aUnicode)
            {
                return(new TPdfUnicodeTrueTypeFont(aFont, aId, aSubset, aCompress, aUseKerning, EmbeddedData, AdditionalStyle, aResources));
            }
            else
            {
                bool DoEmbed = aEmbed == TFontEmbed.Embed || EmbeddedData.TrueTypeData.NeedsEmbed(aEmbed);

                if (FontEvents.OnFontEmbed != null)
                {
                    FontEmbedEventArgs ae = new FontEmbedEventArgs(aFont, DoEmbed);
                    FontEvents.OnFontEmbed(FontEvents.Sender, ae);
                    DoEmbed = ae.Embed;
                }

                return(new TPdfWinAnsiTrueTypeFont(aFont, aId, DoEmbed, aSubset, aCompress, aUseKerning, EmbeddedData, AdditionalStyle, aResources));
            }
        }
Exemplo n.º 5
0
        internal TPdfFont GetFont(TFontMapping Mapping, Font aFont, bool NeedsUnicode, TFontEmbed aEmbed, TFontSubset aSubset, bool aUseKerning)
        {
			string key = GetKey(aFont, NeedsUnicode);
            TPdfFont SearchFont;

			if (Fonts.ContainsKey(key))
			{
				SearchFont = ((TPdfFont)Fonts[key]);
			}

			else
			{
				SearchFont = TPdfFont.CreateInstance(Mapping, aFont, NeedsUnicode, Fonts.Count, aEmbed, aSubset, FCompress, aUseKerning, FFontEvents, EmbeddedFontList, this);
				Fonts.Add(key, SearchFont);
			}

            return SearchFont;
        }
Exemplo n.º 6
0
		internal TPdfFont GetFont(TFontMapping Mapping, Font aFont, string s, TFontEmbed aEmbed, TFontSubset aSubset, bool aUseKerning)
		{
			bool NeedsUnicode = CharUtils.IsWin1252(s);
			return GetFont(Mapping, aFont, NeedsUnicode, aEmbed, aSubset, aUseKerning);
		}
Exemplo n.º 7
0
 internal TPdfFont SelectFont(TPdfStream DataStream, TFontMapping Mapping, Font aFont, string s, TFontEmbed aEmbed, TFontSubset aSubset, bool aUseKerning,
     ref string LastFont)
 {
     TPdfFont Result = GetFont(Mapping, aFont, s, aEmbed, aSubset, aUseKerning);
     Result.AddString(s);
     Result.Select(DataStream, aFont.SizeInPoints, ref LastFont);
     return Result;
 }