-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
throw exception using Face#GetSfntName(uint idx) and some method such as Face#GetPSFontInfo(), Face#GetPostscriptName() #96
Comments
Your usage. Try this instead:
That said, maybe |
@HinTak The constructors are indeed overloaded. It's the primary method of creating new objects. lib.NewFace just calls the constructor. @eitguide emailed me earlier with this and one other exception, the second one being a bug in Face.GetPSFontInfo where there is one extra level of indirection in the out parameter. This would lead me to believe I've made a similar mistake with the SFNT API. Both should be relatively simple fixes, and I have a few minutes of spare time right now, so expect a fix in a few minutes. |
APIs fixed: Face.GetSfntName, Face.GetPSFontInfo, and Face.GetPSFontPrivate
Also found that Face.GetPSFontPrivate had an error. I'll do a pass through the API later to see if there are any other areas where this bug exists. |
Thank you so much. If I detect any bugs in lib, I will feedback for you. Thanks. |
Digging deeper, I found that the To maintain backwards compatibility, |
As for the exception in GetPSFontInto and GetPSPrivate, these are not problems in SharpFont. You are trying to access PostScript data for a TrueType font. The exception I got from a sample program was a FreeTypeException for "Invalid argument", which in this case means the font does not support the function you tried to call on it. I downloaded a separate, free PS Type1 font to test this on, and the values now appear to be reasonable. Here is the test case I'm using:
|
when i using following codes, Visual Studio throw exceptio with messege: "An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Library lib = new Library();
Face face = new Face(lib, "Slabo27px-Regular.ttf");
int sfntCount = (int)face.GetSfntNameCount();
for (int i = 0; i < sfntCount; i++)
{
SfntName sfnt = face.GetSfntName(0);
}
And anyone can fix it? Thanks you so much.
The text was updated successfully, but these errors were encountered: