+2006-08-11 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Font.cs: Remove the, now unrequired, FaceNameOffset field and
+ use the object size instead of the structure size when copying.
+
2006-08-11 Sebastien Pouliot <sebastien@ximian.com>
* Font.cs: Added more checks to ToLogFont and fixed it's behaviour
private const byte DefaultCharSet = 1;
private static int CharSetOffset = -1;
- private static int FaceNameOffset = -1;
private void CreateFont (string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical)
{
// note: there is no exception if 'logFont' isn't big enough
Type lf = typeof (LOGFONT);
- int size = Marshal.SizeOf (lf);
- if (Marshal.SizeOf (logFont) >= size) {
+ int size = Marshal.SizeOf (logFont);
+ if (size >= Marshal.SizeOf (lf)) {
Status status;
IntPtr copy = Marshal.AllocHGlobal (size);
try {
if (CharSetOffset == -1) {
CharSetOffset = (int) Marshal.OffsetOf (lf, "lfCharSet");
- FaceNameOffset = (int) Marshal.OffsetOf (lf, "lfFaceName");
}
// note: Marshal.WriteByte(object,*) methods are unimplemented on Mono