예제 #1
0
        public bool SaveFont(IntPtr ptrToFont, string fileName)
        {
            header.SaveHeader();
            SaveGlyphs();

            Marshal.StructureToPtr <PGFFontRaw>(rawFont, ptrToFont, false);

            return(DLLInterface.SaveFont(fontPtr, fileName));
        }
예제 #2
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();
        }