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)
            {
                int ccode   = FTrueTypeData.Glyph(code, true);
                int newcode = EmbeddedData.GetNewGlyphFromOldGlyph(ccode);
                UsedChars.Add((char)newcode, FTrueTypeData.GlyphWidth(ccode));
                ToUnicodeData.Add(newcode, (int)code);
            }

            return(Result);
        }
Beispiel #2
0
        internal override byte[] EncodeString(string s)
        {
            byte[] Result = new byte[2 * s.Length];
            for (int i = 0; i < s.Length; i++)
            {
                int gl = FTrueTypeData.Glyph((int)s[i], true);
                MotorolaSetWord(Result, i * 2, EmbeddedData.GetNewGlyphFromOldGlyph(gl));
            }

            return(Result);
        }