2 // Test Font class testing unit
5 // Jordi Mas i Hernandez, jordi@ximian.com
6 // Peter Dennis Bartok, pbartok@novell.com
7 // Sebastien Pouliot <sebastien@ximian.com>
9 // (C) 2003 Ximian, Inc. http://www.ximian.com
10 // Copyright (C) 2004-2007 Novell, Inc (http://www.novell.com)
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using NUnit.Framework;
35 using System.Drawing.Text;
36 using System.Security;
37 using System.Security.Permissions;
38 using System.Runtime.InteropServices;
40 namespace MonoTests.System.Drawing{
43 public class FontTest {
48 public void FixtureSetUp ()
51 using (FontFamily ff = new FontFamily (GenericFontFamilies.Monospace)) {
55 catch (ArgumentException) {
56 Assert.Ignore ("No font family could be found.");
60 // Test basic Font clone, properties and contructor
62 [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
63 public void TestClone()
65 Font f = new Font("Arial",12);
66 Font f2 = (Font) f.Clone();
68 Assert.AreEqual (f.Bold, f2.Bold, "Bold");
69 Assert.AreEqual (f.FontFamily, f2.FontFamily, "FontFamily");
70 Assert.AreEqual (f.GdiCharSet, f2.GdiCharSet, "GdiCharSet");
71 Assert.AreEqual (f.GdiVerticalFont, f2.GdiVerticalFont, "GdiVerticalFont");
72 Assert.AreEqual (f.Height, f2.Height, "Height");
73 Assert.AreEqual (f.Italic, f2.Italic, "Italic");
74 Assert.AreEqual (f.Name, f2.Name, "Name");
75 Assert.AreEqual (f.Size, f2.Size, "Size");
76 Assert.AreEqual (f.SizeInPoints, f2.SizeInPoints, "SizeInPoints");
77 Assert.AreEqual (f.Strikeout, f2.Strikeout, "Strikeout");
78 Assert.AreEqual (f.Style, f2.Style, "Style");
79 Assert.AreEqual (f.Underline, f2.Underline, "Underline");
80 Assert.AreEqual (f.Unit, f2.Unit, "Unit");
83 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
87 public int lfEscapement;
88 public int lfOrientation;
91 public byte lfUnderline;
92 public byte lfStrikeOut;
93 public byte lfCharSet;
94 public byte lfOutPrecision;
95 public byte lfClipPrecision;
96 public byte lfQuality;
97 public byte lfPitchAndFamily;
98 [ MarshalAs(UnmanagedType.ByValTStr, SizeConst=32) ]
99 public string lfFaceName;
102 [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Auto)]
103 struct LOGFONT_STRUCT {
106 public int lfEscapement;
107 public int lfOrientation;
109 public byte lfItalic;
110 public byte lfUnderline;
111 public byte lfStrikeOut;
112 public byte lfCharSet;
113 public byte lfOutPrecision;
114 public byte lfClipPrecision;
115 public byte lfQuality;
116 public byte lfPitchAndFamily;
117 [MarshalAs (UnmanagedType.ByValTStr, SizeConst = 32)]
118 public string lfFaceName;
123 [ExpectedException (typeof (SecurityException))]
124 [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
125 public void ToLogFont_DenyUnmanagedCode ()
131 f = new Font("Arial", 10);
137 [SecurityPermission (SecurityAction.Assert, UnmanagedCode = true)]
138 public void ToLogFont_AssertUnmanagedCode ()
140 Font f = new Font("Arial", 10);
141 LOGFONT lf = new LOGFONT();
144 Assert.AreEqual (400, lf.lfWeight, "lfWeight");
145 Assert.AreEqual (1, lf.lfCharSet, "lfCharSet");
146 Assert.AreEqual (f.Name, lf.lfFaceName, "lfFaceName");
148 LOGFONT_STRUCT lfs = new LOGFONT_STRUCT ();
150 Assert.AreEqual (0, lfs.lfWeight, "struct-lfWeight");
151 Assert.AreEqual (0, lfs.lfCharSet, "struct-lfCharSet");
152 Assert.AreEqual (0, lfs.lfHeight, "struct-lfHeight");
153 Assert.AreEqual (0, lfs.lfWidth, "struct-lfWidth");
154 Assert.AreEqual (0, lfs.lfEscapement, "struct-lfEscapement");
155 Assert.AreEqual (0, lfs.lfOrientation, "struct-lfOrientation");
156 Assert.AreEqual (0, lfs.lfWeight, "struct-lfWeight");
157 Assert.AreEqual (0, lfs.lfItalic, "struct-lfItalic");
158 Assert.AreEqual (0, lfs.lfUnderline, "struct-lfUnderline");
159 Assert.AreEqual (0, lfs.lfStrikeOut, "struct-lfStrikeOut");
160 Assert.AreEqual (0, lfs.lfCharSet, "struct-lfCharSet");
161 Assert.AreEqual (0, lfs.lfOutPrecision, "struct-lfOutPrecision");
162 Assert.AreEqual (0, lfs.lfClipPrecision, "struct-lfClipPrecision");
163 Assert.AreEqual (0, lfs.lfQuality, "struct-lfQuality");
164 Assert.AreEqual (0, lfs.lfPitchAndFamily, "struct-lfPitchAndFamily");
165 Assert.IsNull (lfs.lfFaceName, "struct-lfFaceName");
169 [SecurityPermission (SecurityAction.Assert, UnmanagedCode = true)]
170 [ExpectedException (typeof (ArgumentException))]
171 public void ToLogFont_TooSmall ()
173 Font f = new Font ("Arial", 10);
174 object o = new object ();
176 // no PInvoke conversion exists !?!?
180 [SecurityPermission (SecurityAction.Assert, UnmanagedCode = true)]
181 public void ToLogFont_Int ()
183 Font f = new Font ("Arial", 10);
186 Assert.AreEqual (1, i);
190 [SecurityPermission (SecurityAction.Assert, UnmanagedCode = true)]
192 [ExpectedException (typeof (AccessViolationException))]
194 [ExpectedException (typeof (NullReferenceException))]
196 public void ToLogFont_Null ()
198 Font f = new Font ("Arial", 10);
203 [ExpectedException (typeof (ArgumentNullException))]
205 public void Font_StringNull_Float ()
207 string family = null;
208 Font f = new Font (family, 12.5f);
209 Assert.AreEqual (FontFamily.GenericSansSerif, f.FontFamily, "FontFamily");
210 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
211 Assert.AreEqual (12.5f, f.Size, "Size");
212 Assert.AreEqual (12.5f, f.SizeInPoints, "SizeInPoints");
213 Assert.AreEqual (GraphicsUnit.Point, f.Unit, "Unit");
217 public void Font_String_Float ()
219 Font f = new Font (name, 12.5f);
220 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
221 Assert.IsFalse (f.Bold, "Bold");
222 Assert.AreEqual (1, f.GdiCharSet, "GdiCharSet");
223 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
224 Assert.IsTrue (f.Height > 0, "Height");
225 Assert.IsFalse (f.Italic, "Italic");
226 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
227 Assert.AreEqual (12.5f, f.Size, "Size");
228 Assert.AreEqual (12.5f, f.SizeInPoints, "SizeInPoints");
229 Assert.IsFalse (f.Strikeout, "Strikeout");
230 Assert.IsFalse (f.Underline, "Underline");
231 Assert.AreEqual (GraphicsUnit.Point, f.Unit, "Unit");
235 public void Font_String_Float_FontStyle ()
237 Font f = new Font (name, 12.5f, FontStyle.Bold);
238 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
239 Assert.IsTrue (f.Bold, "Bold");
240 Assert.AreEqual (1, f.GdiCharSet, "GdiCharSet");
241 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
242 Assert.IsTrue (f.Height > 0, "Height");
243 Assert.IsFalse (f.Italic, "Italic");
244 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
245 Assert.AreEqual (12.5f, f.Size, "Size");
246 Assert.AreEqual (12.5f, f.SizeInPoints, "SizeInPoints");
247 Assert.IsFalse (f.Strikeout, "Strikeout");
248 Assert.IsFalse (f.Underline, "Underline");
249 Assert.AreEqual (GraphicsUnit.Point, f.Unit, "Unit");
253 public void Font_String_Float_FontStyle_GraphicsUnit ()
255 Font f = new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Pixel);
256 Assert.IsFalse (f.Bold, "Bold");
257 Assert.AreEqual (1, f.GdiCharSet, "GdiCharSet");
258 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
259 Assert.IsTrue (f.Height > 0, "Height");
260 Assert.IsTrue (f.Italic, "Italic");
261 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
262 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
263 Assert.AreEqual (12.5f, f.Size, "Size");
264 Assert.IsFalse (f.Strikeout, "Strikeout");
265 Assert.IsFalse (f.Underline, "Underline");
266 Assert.AreEqual (GraphicsUnit.Pixel, f.Unit, "Unit");
270 [ExpectedException (typeof (ArgumentException))]
271 public void Font_String_Float_FontStyle_GraphicsUnit_Display ()
273 new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
277 public void Font_String_Float_FontStyle_GraphicsUnit_Byte ()
279 Font f = new Font (name, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
280 Assert.IsFalse (f.Bold, "Bold");
281 Assert.AreEqual (Byte.MaxValue, f.GdiCharSet, "GdiCharSet");
282 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
283 Assert.IsTrue (f.Height > 0, "Height");
284 Assert.IsFalse (f.Italic, "Italic");
285 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
286 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
287 Assert.AreEqual (12.5f, f.Size, "Size");
288 Assert.AreEqual (900f, f.SizeInPoints, "SizeInPoints");
289 Assert.IsTrue (f.Strikeout, "Strikeout");
290 Assert.IsFalse (f.Underline, "Underline");
291 Assert.AreEqual (GraphicsUnit.Inch, f.Unit, "Unit");
295 public void Font_String_Float_FontStyle_GraphicsUnit_Byte_Bool ()
297 Font f = new Font (name, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
298 Assert.IsFalse (f.Bold, "Bold");
299 Assert.AreEqual (Byte.MinValue, f.GdiCharSet, "GdiCharSet");
300 Assert.IsTrue (f.GdiVerticalFont, "GdiVerticalFont");
301 Assert.IsTrue (f.Height > 0, "Height");
302 Assert.IsFalse (f.Italic, "Italic");
303 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
304 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
305 Assert.AreEqual (12.5f, f.Size, "Size");
306 Assert.AreEqual (3f, f.SizeInPoints, "SizeInPoints");
307 Assert.IsFalse (f.Strikeout, "Strikeout");
308 Assert.IsTrue (f.Underline, "Underline");
309 Assert.AreEqual (GraphicsUnit.Document, f.Unit, "Unit");
313 [ExpectedException (typeof (ArgumentNullException))]
314 public void Font_FontFamilyNull_Float ()
316 FontFamily ff = null;
317 new Font (ff, 12.5f);
321 [ExpectedException (typeof (NullReferenceException))]
322 public void Font_FontNull_FontStyle ()
325 new Font (f, FontStyle.Bold);
329 public void Font_FontFamily_Float ()
331 Font f = new Font (FontFamily.GenericMonospace, 12.5f);
332 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
333 Assert.IsFalse (f.Bold, "Bold");
334 Assert.AreEqual (1, f.GdiCharSet, "GdiCharSet");
335 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
336 Assert.IsTrue (f.Height > 0, "Height");
337 Assert.IsFalse (f.Italic, "Italic");
338 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
339 Assert.AreEqual (12.5f, f.Size, "Size");
340 Assert.AreEqual (12.5f, f.SizeInPoints, "SizeInPoints");
341 Assert.IsFalse (f.Strikeout, "Strikeout");
342 Assert.IsFalse (f.Underline, "Underline");
343 Assert.AreEqual (GraphicsUnit.Point, f.Unit, "Unit");
347 public void Font_FontFamily_Float_FontStyle ()
349 Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Bold);
350 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
351 Assert.IsTrue (f.Bold, "Bold");
352 Assert.AreEqual (1, f.GdiCharSet, "GdiCharSet");
353 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
354 Assert.IsTrue (f.Height > 0, "Height");
355 Assert.IsFalse (f.Italic, "Italic");
356 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
357 Assert.AreEqual (12.5f, f.Size, "Size");
358 Assert.AreEqual (12.5f, f.SizeInPoints, "SizeInPoints");
359 Assert.IsFalse (f.Strikeout, "Strikeout");
360 Assert.IsFalse (f.Underline, "Underline");
361 Assert.AreEqual (GraphicsUnit.Point, f.Unit, "Unit");
365 public void Font_FontFamily_Float_FontStyle_GraphicsUnit ()
367 Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Millimeter);
368 Assert.IsFalse (f.Bold, "Bold");
369 Assert.AreEqual (1, f.GdiCharSet, "GdiCharSet");
370 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
371 Assert.IsTrue (f.Height > 0, "Height");
372 Assert.IsTrue (f.Italic, "Italic");
373 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
374 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
375 Assert.AreEqual (12.5f, f.Size, "Size");
376 Assert.AreEqual (35.43307f, f.SizeInPoints, "SizeInPoints");
377 Assert.IsFalse (f.Strikeout, "Strikeout");
378 Assert.IsFalse (f.Underline, "Underline");
379 Assert.AreEqual (GraphicsUnit.Millimeter, f.Unit, "Unit");
383 [ExpectedException (typeof (ArgumentException))]
384 public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Display ()
386 new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
390 public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte ()
392 Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
393 Assert.IsFalse (f.Bold, "Bold");
394 Assert.AreEqual (Byte.MaxValue, f.GdiCharSet, "GdiCharSet");
395 Assert.IsFalse (f.GdiVerticalFont, "GdiVerticalFont");
396 Assert.IsTrue (f.Height > 0, "Height");
397 Assert.IsFalse (f.Italic, "Italic");
398 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
399 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
400 Assert.AreEqual (12.5f, f.Size, "Size");
401 Assert.AreEqual (900f, f.SizeInPoints, "SizeInPoints");
402 Assert.IsTrue (f.Strikeout, "Strikeout");
403 Assert.IsFalse (f.Underline, "Underline");
404 Assert.AreEqual (GraphicsUnit.Inch, f.Unit, "Unit");
408 public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte_Bool ()
410 Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
411 Assert.IsFalse (f.Bold, "Bold");
412 Assert.AreEqual (Byte.MinValue, f.GdiCharSet, "GdiCharSet");
413 Assert.IsTrue (f.GdiVerticalFont, "GdiVerticalFont");
414 Assert.IsTrue (f.Height > 0, "Height");
415 Assert.IsFalse (f.Italic, "Italic");
416 Assert.AreEqual (FontFamily.GenericMonospace, f.FontFamily, "FontFamily");
417 Assert.AreEqual (f.Name, f.FontFamily.Name, "Name");
418 Assert.AreEqual (12.5f, f.Size, "Size");
419 Assert.AreEqual (3f, f.SizeInPoints, "SizeInPoints");
420 Assert.IsFalse (f.Strikeout, "Strikeout");
421 Assert.IsTrue (f.Underline, "Underline");
422 Assert.AreEqual (GraphicsUnit.Document, f.Unit, "Unit");
426 public void Dispose_Double ()
428 Font f = new Font (name, 12.5f);
434 public void Dispose_UseAfter_Works ()
436 Font f = new Font (name, 12.5f);
437 string fname = f.Name;
439 // most properties don't throw, everything seems to be cached
440 Assert.AreEqual (fname, f.Name, "Name");
441 Assert.AreEqual (12.5f, f.Size, "Size");
445 [ExpectedException (typeof (ArgumentException))]
446 public void Dispose_Height ()
448 Font f = new Font (name, 12.5f);
450 Assert.AreEqual (0, f.Height, "Name");
454 [ExpectedException (typeof (ArgumentException))]
455 public void Dispose_ToLogFont ()
457 Font f = new Font (name, 12.5f);
459 LOGFONT lf = new LOGFONT();
464 public void Dispose_ToLogFont_LoopCharSet ()
466 Font f = new Font (name, 12.5f);
468 LOGFONT lf = new LOGFONT ();
470 for (int i = Byte.MinValue; i < Byte.MaxValue; i++) {
475 lf.lfOrientation = b;
481 lf.lfOutPrecision = b;
482 lf.lfClipPrecision = b;
484 lf.lfPitchAndFamily = b;
485 lf.lfFaceName = b.ToString ();
489 catch (ArgumentException) {
490 Assert.AreEqual (b, lf.lfHeight, "lfHeight");
491 Assert.AreEqual (b, lf.lfWidth, "lfWidth");
492 Assert.AreEqual (b, lf.lfEscapement, "lfEscapement");
493 Assert.AreEqual (b, lf.lfOrientation, "lfOrientation");
494 Assert.AreEqual (b, lf.lfWeight, "lfWeight");
495 Assert.AreEqual (b, lf.lfItalic, "lfItalic");
496 Assert.AreEqual (b, lf.lfUnderline, "lfUnderline");
497 Assert.AreEqual (b, lf.lfStrikeOut, "lfStrikeOut");
498 // special case for 0
499 Assert.AreEqual ((i == 0) ? (byte)1 : b, lf.lfCharSet, "lfCharSet");
500 Assert.AreEqual (b, lf.lfOutPrecision, "lfOutPrecision");
501 Assert.AreEqual (b, lf.lfClipPrecision, "lfClipPrecision");
502 Assert.AreEqual (b, lf.lfQuality, "lfQuality");
503 Assert.AreEqual (b, lf.lfPitchAndFamily, "lfPitchAndFamily");
504 Assert.AreEqual (b.ToString (), lf.lfFaceName, "lfFaceName");
506 catch (Exception e) {
507 Assert.Fail ("Unexcepted exception {0} at iteration {1}", e, i);
513 [ExpectedException (typeof (ArgumentException))]
514 public void Dispose_ToHFont ()
516 Font f = new Font (name, 12.5f);
522 [ExpectedException (typeof (ArgumentException))]
523 [Category ("NotWorking")]
524 public void UnavailableStyleException ()
526 // Marked NotWorking because it is dependent on what fonts/styles are available
527 // on the OS. This test is written for Windows.
528 Font f = new Font ("Monotype Corsiva", 8, FontStyle.Regular);
532 public void GetHeight_Float ()
534 using (Font f = new Font (name, 12.5f)) {
535 Assert.AreEqual (0, f.GetHeight (0), "0");
540 public void GetHeight_Graphics ()
542 using (Bitmap bmp = new Bitmap (10, 10)) {
543 using (Graphics g = Graphics.FromImage (bmp)) {
544 using (Font f = new Font (name, 12.5f)) {
545 float expected = f.GetHeight (g.DpiY);
546 Assert.AreEqual (expected, f.GetHeight (g), 0.01f, "Default");
547 g.ScaleTransform (2, 4);
548 Assert.AreEqual (expected, f.GetHeight (g), 0.01f, "ScaleTransform");
550 Assert.AreEqual (expected, f.GetHeight (g), 0.01f, "PageScale");
557 [ExpectedException (typeof (ArgumentNullException))]
558 public void GetHeight_Graphics_Null ()
560 using (Font f = new Font (name, 12.5f)) {
561 Assert.AreEqual (0, f.GetHeight (null), "0");
566 public void FontUniqueHashCode ()
568 Font f1 = new Font ("Arial", 14);
569 Font f2 = new Font ("Arial", 12);
570 Font f3 = new Font (f1, FontStyle.Bold);
572 Assert.IsFalse (f1.GetHashCode () == f2.GetHashCode (), "1) Fonts with different sizes should have different HashCodes");
573 Assert.IsFalse (f1.GetHashCode () == f3.GetHashCode (), "2) Fonts with different styles should have different HashCodes");
577 public void GetHashCode_UnitDiffers_HashesNotEqual()
579 Font f1 = new Font("Arial", 8.25F, GraphicsUnit.Point);
580 Font f2 = new Font("Arial", 8.25F, GraphicsUnit.Pixel);
582 Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
583 "Hashcodes should differ if _unit member differs");
587 public void GetHashCode_NameDiffers_HashesNotEqual()
589 Font f1 = new Font("Arial", 8.25F, GraphicsUnit.Point);
590 Font f2 = new Font("Courier New", 8.25F, GraphicsUnit.Point);
592 Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
593 "Hashcodes should differ if _name member differs");
597 public void GetHashCode_StyleEqualsGdiCharSet_HashesNotEqual()
599 Font f1 = new Font("Arial", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
600 Font f2 = new Font("Arial", 8.25F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(1)));
602 Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
603 "Hashcodes should differ if _style member differs");