예제 #1
0
 public TPdfUnicodeTrueTypeFont(Font aFont, int aId, TFontSubset aSubset, bool aCompress, bool aUseKerning,
                                TPdfEmbeddedFont aEmbeddedData, FontStyle aAdditionalStyle, TPdfResources aResources) : base(aFont, aId, aCompress, aUseKerning, aEmbeddedData, aAdditionalStyle, aResources)
 {
     UsedChars     = new TUsedCharList();
     ToUnicodeData = new TToUnicode();
     Subset        = aSubset == TFontSubset.Subset;
 }
예제 #2
0
 public TPdfWinAnsiTrueTypeFont(Font aFont, int aId, bool aEmbed, TFontSubset aSubset, bool aCompress, bool aUseKerning,
                                TPdfEmbeddedFont aEmbeddedData, FontStyle aAdditionalStyle, TPdfResources aResources) : base(aFont, aId, aCompress, aUseKerning, aEmbeddedData, aAdditionalStyle, aResources)
 {
     Embed     = aEmbed;
     Subset    = aSubset == TFontSubset.Subset;
     FirstChar = -1;
     LastChar  = 0;
 }
예제 #3
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";
        }
예제 #4
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));
 }
예제 #5
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));
 }
예제 #6
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));
            }
        }
예제 #7
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;
        }
예제 #8
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);
		}
예제 #9
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;
 }