Beispiel #1
0
        public override bool AddChar(int code, int FallbackLevel)
        {
            bool Result = FTrueTypeData.HasGlyph(code);

            if (!Result)
            {
                TPdfFont Fallbk = FallbackFont(FallbackLevel);
                if (Fallbk != null)
                {
                    if (Fallbk.AddChar(code, FallbackLevel + 1))
                    {
                        return(true);
                    }
                }
            }

            if (Result || FallbackLevel == 0)
            {
                //characters on winansi are NOT the same than low byte unicode.f.i. char 0x92 is not defined in unicode.
                byte acode = CharUtils.GetWin1252Bytes_PDF(code);

                if (FirstChar < 0 || acode < FirstChar)
                {
                    FirstChar = acode;
                }
                if (acode > LastChar)
                {
                    LastChar = acode;
                }

                if (Embed && Subset)
                {
                    EmbeddedData.AddGlyphFromChar(code);
                }
            }

            return(Result);
        }