iTextSharp.text.pdf.Pfm2afm.Putchartab C# (CSharp) Метод

Putchartab() приватный Метод

private Putchartab ( ) : void
Результат void
        private void Putchartab()
        {
            int count = lastchar - firstchar + 1;
            int[] ctabs = new int[count];
            inp.Seek(chartab);
            for (int k = 0; k < count; ++k)
                ctabs[k] = inp.ReadUnsignedShortLE();
            int[] back = new int[256];
            if (charset == 0) {
                for (int i = firstchar; i <= lastchar; ++i) {
                    if (Win2PSStd[i] != 0)
                        back[Win2PSStd[i]] = i;
                }
            }
            /* Put outp the header */
            outp.Write("StartCharMetrics");
            Outval(count);
            outp.Write('\n');

            /* Put outp all encoded chars */
            if (charset != 0) {
            /*
            * If the charset is not the Windows standard, just put outp
            * unnamed entries.
            */
                for (int i = firstchar; i <= lastchar; i++) {
                    if (ctabs[i - firstchar] != 0) {
                        Outchar(i, ctabs[i - firstchar], null);
                    }
                }
            }
            else {
                for (int i = 0; i < 256; i++) {
                    int j = back[i];
                    if (j != 0) {
                        Outchar(i, ctabs[j - firstchar], WinChars[j]);
                        ctabs[j - firstchar] = 0;
                    }
                }
                /* Put outp all non-encoded chars */
                for (int i = firstchar; i <= lastchar; i++) {
                    if (ctabs[i - firstchar] != 0) {
                        Outchar(-1, ctabs[i - firstchar], WinChars[i]);
                    }
                }
            }
            /* Put outp the trailer */
            outp.Write("EndCharMetrics\n");
        }

Usage Example

Пример #1
0
        /**
         * Converts a PFM file into an AFM file.
         * @param inp the PFM file
         * @param outp the AFM file
         * @throws IOException on error
         */
        public static void Convert(RandomAccessFileOrArray inp, Stream outp)
        {
            Pfm2afm p = new Pfm2afm(inp, outp);

            p.Openpfm();
            p.Putheader();
            p.Putchartab();
            p.Putkerntab();
            p.Puttrailer();
            p.outp.Flush();
        }
All Usage Examples Of iTextSharp.text.pdf.Pfm2afm::Putchartab