public override TPdfFont Fallback(char c, int FallbackLevel) { if (FTrueTypeData.HasGlyph((int)c)) { return(this); } TPdfFont Fallbk = FallbackFont(FallbackLevel); if (Fallbk != null) { return(Fallbk.Fallback(c, FallbackLevel + 1)); } return(null); }
public override TPdfFont Fallback(char c, int FallbackLevel) { if (CharUtils.IsWin1252((int)c)) { return(this); } TPdfFont Fallbk = FallbackFont(FallbackLevel); if (Fallbk != null) { return(Fallbk.Fallback(c, FallbackLevel + 1)); } return(null); }
public static void WriteStringInStream(TPdfStream DataStream, string Text, real FontSize, TPdfFont aFont, ref string LastFont, string EndNewText, string StartNewText2, string EndNewText2, TTracedFonts TracedFonts) { TPdfFont LastFallbackFont = aFont; int StartText = 0; int TLen = Text.Length; for (int i = 0; i <= TLen; i++) { TPdfFont FallbackFont = null; if (i < TLen) { FallbackFont = aFont.Fallback(Text[i], 0); if (FallbackFont == null) { FallbackFont = aFont; } } if (FallbackFont != LastFallbackFont) { WriteSimpleString(DataStream, Text.Substring(StartText, i - StartText), LastFallbackFont, EndNewText); StartText = i; if (FallbackFont != null) { TPdfBaseRecord.Write(DataStream, EndNewText2); FallbackFont.Select(DataStream, FontSize, ref LastFont); if (FlexCelTrace.HasListeners && FallbackFont != aFont && !TracedFonts.ContainsKey(aFont.FontName + ";" + FallbackFont.FontName)) { TracedFonts.Add(aFont.FontName + ";" + FallbackFont.FontName, String.Empty); FlexCelTrace.Write(new TPdfUsedFallbackFontError(FlxMessages.GetString(FlxErr.ErrUsedFallbackFont, aFont.FontName, FallbackFont.FontName), aFont.FontName, FallbackFont.FontName)); } TPdfBaseRecord.Write(DataStream, StartNewText2); LastFallbackFont = FallbackFont; } } } }