Esempio n. 1
0
        public PGFFont(string fileName)
        {
            if (!File.Exists(fileName))
            {
                throw new FileNotFoundException("Could not find file", fileName);
            }

            IntPtr ptrToFont = DLLInterface.LoadFont(fileName);

            originalFileName = fileName;

            if (ptrToFont == IntPtr.Zero)
            {
                throw new Exception("Failed to load font");
            }

            fontPtr = ptrToFont;
            rawFont = Marshal.PtrToStructure <PGFFontRaw>(ptrToFont);

            header = new PGFHeader(rawFont.header);

            LoadGlyphs();
        }